Getting Started
This guide takes you from a fresh clone to a running local stack. Cropto is an npm-workspaces monorepo — every app and shared package lives in one repository and shares one dependency tree.
The 60-second quickstart
bash
# 1. Clone and install all workspaces from the repo root
git clone <repo-url> cropto && cd cropto
npm install # installs every workspace (uses npm workspaces)
# 2. Configure environment
cp .env.example .env # fill in DATABASE_URL, JWT_SECRET, etc.
# 3. Generate the Prisma client and apply the schema
npx prisma generate --schema=prisma/schema.prisma
npx prisma migrate dev --schema=prisma/schema.prisma
# 4. Seed lookups + taxonomy
npm run seed:lookups
npx prisma db seed
# 5. Run the apps you need (separate terminals)
npm run dev --workspace=apps/api # Express API on :3000
npm run dev --workspace=apps/web # Web app on :5173
npm run dev --workspace=apps/admin # Admin panel on :5174 (or next free port)Package manager
This project uses npm workspaces only. Never use yarn or pnpm — the lockfile and workspace resolution assume npm.
What runs where
| Service | Command | Default port |
|---|---|---|
| API (Express) | npm run dev --workspace=apps/api | 3000 |
| Web app (Vite) | npm run dev --workspace=apps/web | 5173 |
| Admin panel (Vite) | npm run dev --workspace=apps/admin | 5174* |
| Marketing site (Next.js) | npm run dev --workspace=apps/marketing | 3002 |
| Mobile (Expo) | npm run android --workspace=apps/mobile | Metro / device |
| API docs (Swagger) | — served by API | /api/docs |
| Job dashboard (Bull Board) | — served by API (admin auth) | /admin/queues |
* Vite auto-increments the port if the default is taken.
External dependencies
Cropto talks to several managed services. Most are optional in local development — the code degrades gracefully when a service is not configured (see Environment Variables).
| Dependency | Used for | Required locally? |
|---|---|---|
| PostgreSQL (Supabase) | Primary datastore via Prisma | Yes |
| Upstash Redis | BullMQ queues + rate-limit counters | No — falls back to in-memory |
| Cloudflare R2 | Image/file storage (Sharp → R2) | No — upload paths inert without it |
| MSG91 | SMS (OTP + notifications) | No — SMS skipped, in-app still fires |
| Firebase Admin | OTP verification fallback | No |
| Meilisearch | Batch search index | No — falls back to Postgres trigram |
| OpenWeatherMap | Dashboard weather | No |
| Sentry | Error tracking / tracing | No — inert with empty DSN |
Next steps
- Prerequisites — exact tool versions
- Environment Variables — a walkthrough of
.env - Local Development — database, migrations, seeding
- Build, Test & Deploy — commands and CI/deploy notes
