Now let’s implement our domain model! Our goal is to get some sort of diagram showing up on the http://localhost:5173/garden page.
- The plants must show up as the appropriate size (e.g. tomatoes must be 2x2 tiles)
- The plant tiles (
ItemPlacementin the UI domain model) should have a working icon (it’s ok if a few don’t work). Icons are inpackages/client/public/plant-icons/*and if you just provide anItem.iconPaththat’s set to a filename in that folder, it should show up on the tile
You might find that it appears you can drag tiles around. Let’s not get ahead of ourselves — we’ll get to that!
Context
packages/server/src/entities/garden.tswill certainly need to be altered and you will probably need to create some more entities in that folderpackages/server/src/application/gardens-router.tswill need to be altered so that it’s not hardcoding an emptyzones: []fieldpackages/server/src/services/gardens-service.tswill need an update tocreateExampleGarden— the easiest way to play with a garden setup (including whatever sub-objects you assemble underneath it). This will re-run every time you save, and give you a totally fresh database
Bonus
packages/client/src/lib/ItemTooltipContent.svelte is the UI component where your Item.metadata will eventually end up as plantMetadata. Add some info that your user cares about to the tooltip!