# mysthade/smartgarden architecture

> Architecture diagram of the GitHub repository mysthade/smartgarden, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mysthade/smartgarden
- Repository: https://github.com/mysthade/smartgarden

## Overview

Smart Garden is a garden-planning and gardening diary product. The main workflow is account access, organizing gardens into zones, placing and managing plants, recording care and outcomes, then reviewing dashboard and analytics summaries. The web app also documents a visual zone editor with autosave, drag-and-drop, and undo/redo. The README establishes the product capabilities; sampled source confirms selected controller-to-service calls and auth/storage behavior, but not all service-to-database wiring, so uncertain links are omitted.

Main entry points: [`apps/web/src/lib/api.ts`](https://github.com/mysthade/smartgarden/blob/main/apps/web/src/lib/api.ts) (API access), [`apps/api/src/prisma`](https://github.com/mysthade/smartgarden/tree/main/apps/api/src/prisma) (PostgreSQL data), [`apps/web/src/app/(app)`](https://github.com/mysthade/smartgarden/tree/main/apps/web/src/app/(app)) (Web experience), [`apps/web/src/app/(auth)`](https://github.com/mysthade/smartgarden/tree/main/apps/web/src/app/(auth)) (Sign-in UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_web["Web experience"]
  node_webapi["API access<br/>[api.ts]"]
  node_authui["Sign-in UI"]
  node_zoneeditor["Zone editor"]
  node_mapeditor["Garden map"]
end

subgraph group_garden["Garden planning"]
  node_gardens["Gardens and zones"]
  node_plants["Plant catalog"]
end

subgraph group_records["Garden records"]
  node_journal["Journal"]
  node_harvests["Harvests"]
  node_problems["Plant problems"]
  node_care["Care activities"]
  node_tasks["Tasks"]
  node_attachments["Photo attachments"]
  node_dashboard["Dashboard"]
  node_analytics["Analytics"]
end

subgraph group_platform["API and integrations"]
  node_authapi["Authentication"]
  node_profile["Profile"]
  node_database[("PostgreSQL data")]
  node_objectstorage["S3-compatible storage<br/>[storage.service.ts]"]
  node_mail["Email delivery"]
end

node_gardener(("Gardener"))

node_gardener -->|"uses"| node_web
node_gardener -->|"signs in"| node_authui
node_web -->|"requests data"| node_webapi
node_authui -->|"authenticates"| node_webapi
node_webapi -->|"calls API"| node_authapi
node_webapi -->|"calls API"| node_profile
node_webapi -->|"calls API"| node_gardens
node_webapi -->|"calls API"| node_plants
node_webapi -->|"calls API"| node_journal
node_webapi -->|"calls API"| node_harvests
node_webapi -->|"calls API"| node_problems
node_webapi -->|"calls API"| node_care
node_webapi -->|"calls API"| node_tasks
node_webapi -->|"calls API"| node_attachments
node_webapi -->|"calls API"| node_dashboard
node_webapi -->|"calls API"| node_analytics
node_zoneeditor -->|"saves layout"| node_webapi
node_mapeditor -->|"saves map"| node_webapi
node_authapi -->|"sends email"| node_mail
node_attachments -->|"stores files"| node_objectstorage
node_gardens -->|"persists data"| node_database
node_plants -->|"persists data"| node_database
node_journal -->|"persists data"| node_database
node_harvests -->|"persists data"| node_database
node_problems -->|"persists data"| node_database
node_care -->|"persists data"| node_database
node_tasks -->|"persists data"| node_database
node_dashboard -->|"reads summaries"| node_database
node_analytics -->|"reads metrics"| node_database

click node_web "https://github.com/mysthade/smartgarden/tree/main/apps/web/src/app/(app)"
click node_webapi "https://github.com/mysthade/smartgarden/blob/main/apps/web/src/lib/api.ts"
click node_authui "https://github.com/mysthade/smartgarden/tree/main/apps/web/src/app/(auth)"
click node_gardens "https://github.com/mysthade/smartgarden/tree/main/apps/api/src/gardens"
click node_plants "https://github.com/mysthade/smartgarden/tree/main/apps/api/src/plants"
click node_zoneeditor "https://github.com/mysthade/smartgarden/tree/main/apps/web/src/features/zone-editor"
click node_mapeditor "https://github.com/mysthade/smartgarden/tree/main/apps/web/src/features/garden-map"
click node_authapi "https://github.com/mysthade/smartgarden/tree/main/apps/api/src/auth"
click node_profile "https://github.com/mysthade/smartgarden/tree/main/apps/api/src/profile"
click node_journal "https://github.com/mysthade/smartgarden/tree/main/apps/api/src/journal"
click node_harvests "https://github.com/mysthade/smartgarden/tree/main/apps/api/src/harvests"
click node_problems "https://github.com/mysthade/smartgarden/tree/main/apps/api/src/problems"
click node_care "https://github.com/mysthade/smartgarden/tree/main/apps/api/src/care-activities"
click node_tasks "https://github.com/mysthade/smartgarden/tree/main/apps/api/src/tasks"
click node_attachments "https://github.com/mysthade/smartgarden/tree/main/apps/api/src/attachments"
click node_dashboard "https://github.com/mysthade/smartgarden/tree/main/apps/api/src/dashboard"
click node_analytics "https://github.com/mysthade/smartgarden/tree/main/apps/api/src/analytics"
click node_database "https://github.com/mysthade/smartgarden/tree/main/apps/api/src/prisma"
click node_objectstorage "https://github.com/mysthade/smartgarden/blob/main/apps/api/src/storage/storage.service.ts"
click node_mail "https://github.com/mysthade/smartgarden/tree/main/apps/api/src/mail"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web,node_webapi,node_authui,node_zoneeditor,node_mapeditor toneBlue
class node_gardens,node_plants toneAmber
class node_journal,node_harvests,node_problems,node_care,node_tasks,node_attachments,node_dashboard,node_analytics toneMint
class node_authapi,node_profile,node_database,node_objectstorage,node_mail toneRose
class node_gardener toneIndigo
```

## Components

### Web client

- [Web experience](https://github.com/mysthade/smartgarden/tree/main/apps/web/src/app/(app)): `apps/web/src/app/(app)`
- [API access](https://github.com/mysthade/smartgarden/blob/main/apps/web/src/lib/api.ts): `apps/web/src/lib/api.ts`
- [Sign-in UI](https://github.com/mysthade/smartgarden/tree/main/apps/web/src/app/(auth)): `apps/web/src/app/(auth)`
- [Zone editor](https://github.com/mysthade/smartgarden/tree/main/apps/web/src/features/zone-editor): `apps/web/src/features/zone-editor`
- [Garden map](https://github.com/mysthade/smartgarden/tree/main/apps/web/src/features/garden-map): `apps/web/src/features/garden-map`

### Garden planning

- [Gardens and zones](https://github.com/mysthade/smartgarden/tree/main/apps/api/src/gardens): `apps/api/src/gardens`
- [Plant catalog](https://github.com/mysthade/smartgarden/tree/main/apps/api/src/plants): `apps/api/src/plants`

### Garden records

- [Journal](https://github.com/mysthade/smartgarden/tree/main/apps/api/src/journal): `apps/api/src/journal`
- [Harvests](https://github.com/mysthade/smartgarden/tree/main/apps/api/src/harvests): `apps/api/src/harvests`
- [Plant problems](https://github.com/mysthade/smartgarden/tree/main/apps/api/src/problems): `apps/api/src/problems`
- [Care activities](https://github.com/mysthade/smartgarden/tree/main/apps/api/src/care-activities): `apps/api/src/care-activities`
- [Tasks](https://github.com/mysthade/smartgarden/tree/main/apps/api/src/tasks): `apps/api/src/tasks`
- [Photo attachments](https://github.com/mysthade/smartgarden/tree/main/apps/api/src/attachments): `apps/api/src/attachments`
- [Dashboard](https://github.com/mysthade/smartgarden/tree/main/apps/api/src/dashboard): `apps/api/src/dashboard`
- [Analytics](https://github.com/mysthade/smartgarden/tree/main/apps/api/src/analytics): `apps/api/src/analytics`

### API and integrations

- [Authentication](https://github.com/mysthade/smartgarden/tree/main/apps/api/src/auth): `apps/api/src/auth`
- [Profile](https://github.com/mysthade/smartgarden/tree/main/apps/api/src/profile): `apps/api/src/profile`
- [PostgreSQL data](https://github.com/mysthade/smartgarden/tree/main/apps/api/src/prisma): `apps/api/src/prisma`
- [S3-compatible storage](https://github.com/mysthade/smartgarden/blob/main/apps/api/src/storage/storage.service.ts): `apps/api/src/storage/storage.service.ts`
- [Email delivery](https://github.com/mysthade/smartgarden/tree/main/apps/api/src/mail): `apps/api/src/mail`

### Other components

- **Gardener**

## Connections

- Gardener → Web experience: uses
- Gardener → Sign-in UI: signs in
- Web experience → API access: requests data
- Sign-in UI → API access: authenticates
- API access → Authentication: calls API
- API access → Profile: calls API
- API access → Gardens and zones: calls API
- API access → Plant catalog: calls API
- API access → Journal: calls API
- API access → Harvests: calls API
- API access → Plant problems: calls API
- API access → Care activities: calls API
- API access → Tasks: calls API
- API access → Photo attachments: calls API
- API access → Dashboard: calls API
- API access → Analytics: calls API
- Zone editor → API access: saves layout
- Garden map → API access: saves map
- Authentication → Email delivery: sends email
- Photo attachments → S3-compatible storage: stores files
- Gardens and zones → PostgreSQL data: persists data
- Plant catalog → PostgreSQL data: persists data
- Journal → PostgreSQL data: persists data
- Harvests → PostgreSQL data: persists data
- Plant problems → PostgreSQL data: persists data
- Care activities → PostgreSQL data: persists data
- Tasks → PostgreSQL data: persists data
- Dashboard → PostgreSQL data: reads summaries
- Analytics → PostgreSQL data: reads metrics
