mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 20:21:09 +02:00
Deleted: - DOCKER_REGISTRY_SETUP.md, QUICK_START_CICD.md (legacy CI/CD docs) - docs/ULOAD-DEPLOYMENT.md (Hetzner VPS deployment guide) - scripts/get-ssh-key.sh, scripts/remove-coolify-references.sh (legacy scripts) Updated Hetzner → MinIO references in: - shared-storage (package.json, README, client.ts, types.ts) - App CLAUDE.md files (mukke, storage, planta, picture) - .claude/GUIDELINES.md, sveltekit-web.md guideline - TROUBLESHOOTING.md, SETUP_TEMPLATES.md (replaced IPs with placeholders) - GIT_WORKFLOW.md, COMMANDS.md - services/matrix-project-doc-bot/CLAUDE.md Remaining Hetzner mentions are in historical devlogs/audits and docs that list Hetzner as a hosting alternative (not as active infrastructure). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5.1 KiB
5.1 KiB
Planta Project Guide
Project Structure
apps/planta/
├── apps/
│ ├── backend/ # NestJS API server (@planta/backend)
│ └── web/ # SvelteKit web application (@planta/web)
├── packages/
│ └── shared/ # Shared types, utils (@planta/shared)
└── package.json
Commands
Root Level (from monorepo root)
pnpm planta:dev # Run all planta apps
pnpm dev:planta:web # Start web app
pnpm dev:planta:backend # Start backend server
pnpm dev:planta:app # Start web + backend together
pnpm dev:planta:full # Start auth + backend + web with DB setup
Backend (apps/planta/apps/backend)
pnpm dev # Start with hot reload
pnpm build # Build for production
pnpm start:prod # Start production server
pnpm db:push # Push schema to database
pnpm db:studio # Open Drizzle Studio
Web App (apps/planta/apps/web)
pnpm dev # Start dev server
pnpm build # Build for production
pnpm preview # Preview production build
Technology Stack
- Web: SvelteKit 2.x, Svelte 5 (runes mode), Tailwind CSS
- Backend: NestJS 10, Drizzle ORM, PostgreSQL
- AI: Google Gemini Vision for plant analysis
- Storage: MinIO (S3-compatible)
- Auth: Mana Core Auth (JWT)
- Types: TypeScript 5.x
Architecture
Core Flow
- User uploads plant photo
- Photo stored in S3/MinIO
- Gemini Vision analyzes the image
- Plant profile created with care recommendations
- Watering schedule tracked
Backend API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/api/health |
GET | Health check |
/api/plants |
GET | Get user's plants |
/api/plants |
POST | Create new plant |
/api/plants/:id |
GET | Get plant details |
/api/plants/:id |
PUT | Update plant |
/api/plants/:id |
DELETE | Delete plant |
/api/photos/upload |
POST | Upload plant photo |
/api/photos/:id |
DELETE | Delete photo |
/api/analysis/identify |
POST | Analyze photo with AI |
/api/analysis/:photoId |
GET | Get analysis results |
/api/watering/upcoming |
GET | Plants needing water |
/api/watering/:plantId/water |
POST | Log watering event |
Database Schema
plants - User's plants
id(UUID) - Primary keyuser_id(TEXT) - User referencename(TEXT) - Plant nicknamescientific_name(TEXT) - From AI analysiscommon_name(TEXT) - Common namelight_requirements(TEXT) - low/medium/bright/directwatering_frequency_days(INT) - Days between wateringhumidity(TEXT) - low/medium/highcare_notes(TEXT) - Care tipshealth_status(TEXT) - healthy/needs_attention/sick
plant_photos - Plant photos
id(UUID) - Primary keyplant_id(UUID) - FK to plantsstorage_path(TEXT) - S3 pathpublic_url(TEXT) - Public URLis_primary(BOOLEAN) - Primary photo flagis_analyzed(BOOLEAN) - Analysis flag
plant_analyses - AI analysis results
id(UUID) - Primary keyphoto_id(UUID) - FK to plant_photosidentified_species(TEXT) - Detected speciesconfidence(INT) - 0-100 confidencehealth_assessment(TEXT) - Health statuswatering_advice(TEXT) - Watering recommendationgeneral_tips(JSONB) - Care tips array
watering_schedules - Watering tracking
id(UUID) - Primary keyplant_id(UUID) - FK to plantsfrequency_days(INT) - Intervallast_watered_at(TIMESTAMP) - Last wateringnext_watering_at(TIMESTAMP) - Next watering
Environment Variables
Backend (.env)
NODE_ENV=development
PORT=3022
DATABASE_URL=postgresql://manacore:devpassword@localhost:5432/planta
MANA_CORE_AUTH_URL=http://localhost:3001
GOOGLE_GEMINI_API_KEY=xxx
CORS_ORIGINS=http://localhost:5173,http://localhost:5191
S3_ENDPOINT=http://localhost:9000
S3_BUCKET=planta-storage
S3_ACCESS_KEY=minioadmin
S3_SECRET_KEY=minioadmin
Web (.env)
PUBLIC_BACKEND_URL=http://localhost:3022
PUBLIC_MANA_CORE_AUTH_URL=http://localhost:3001
Shared Package
@planta/shared
- Types:
Plant,PlantPhoto,PlantAnalysis,WateringSchedule - Utils: Date helpers, care level formatters
Code Style Guidelines
- TypeScript: Strict typing with interfaces
- Web: Svelte 5 runes mode (
$state,$derived,$effect) - Styling: Tailwind CSS
- Formatting: Prettier with project config
Important Notes
- Authentication: Uses Mana Core Auth (JWT in Authorization header)
- Database: PostgreSQL with Drizzle ORM
- Port: Backend runs on port 3022 by default
- Storage: Photos stored in MinIO (S3-compatible)
- AI: Google Gemini Vision for plant identification