3.1 KiB
3.1 KiB
CLAUDE.md
This repository contains the GreenLens mobile app, the Express backend, and the self-hosted landing/deployment stack.
Commands
Mobile app
npm install
npm run start
npm run android
npm run ios
npm run test
Backend
cd server
npm install
npm run start
npm run rebuild:batches
npm run diagnostics
Production iOS builds
npx eas-cli build:version:set -p ios
npx eas-cli build -p ios --profile production
npx eas-cli submit -p ios --latest
Architecture
Mobile app
- Expo Router entrypoint:
app/_layout.tsx - Global app state:
context/AppContext.tsx - Backend HTTP client:
services/backend/backendApiClient.ts - In-app fallback mock:
services/backend/mockBackendService.ts
Backend
Single Express server in server/index.js with supporting modules in server/lib/:
postgres.jsfor PostgreSQL accesssqlite.jsas a compatibility shim re-exporting the PostgreSQL layerplants.jsfor plant catalog persistence and diagnosticsauth.jsfor JWT authbilling.jsfor credits, RevenueCat, Stripe, and idempotencyopenai.jsfor scan and health-check model callsstorage.jsfor MinIO/S3 object uploads
Primary backend environment variables:
DATABASE_URL
POSTGRES_HOST
POSTGRES_PORT
POSTGRES_DB
POSTGRES_USER
POSTGRES_PASSWORD
JWT_SECRET
OPENAI_API_KEY
STRIPE_SECRET_KEY
MINIO_ENDPOINT
MINIO_ACCESS_KEY
MINIO_SECRET_KEY
MINIO_BUCKET
MINIO_PUBLIC_URL
Landing and deployment
greenlns-landing/ is a Next.js 16 app built with output: 'standalone'.
The production-style stack lives in greenlns-landing/docker-compose.yml and includes:
caddyfor TLS and reverse proxylandingfor the Next.js appapifor the Express backendpostgresfor persistent app dataminiofor object storage
greenlns-landing/Caddyfile routes:
/to the landing app/api/*,/auth/*,/v1/*,/health,/plants/*to the Express API/storage/*to MinIO
Data model notes
- PostgreSQL is the source of truth for server persistence.
- Nested plant metadata such as
categoriesandcareInfousesJSONB. - Billing idempotency responses also use
JSONB. - SQL placeholders use PostgreSQL syntax:
$1,$2, ...
Skill routing
When the user's request matches an available skill, ALWAYS invoke it using the Skill tool as your FIRST action. Do NOT answer directly, do NOT use other tools first. The skill has specialized workflows that produce better results than ad-hoc answers.
Key routing rules:
- Product ideas, "is this worth building", brainstorming -> invoke office-hours
- Bugs, errors, "why is this broken", 500 errors -> invoke investigate
- Ship, deploy, push, create PR -> invoke ship
- QA, test the site, find bugs -> invoke qa
- Code review, check my diff -> invoke review
- Update docs after shipping -> invoke document-release
- Weekly retro -> invoke retro
- Design system, brand -> invoke design-consultation
- Visual audit, design polish -> invoke design-review
- Architecture review -> invoke plan-eng-review
- Save progress, checkpoint, resume -> invoke checkpoint
- Code quality, health check -> invoke health