Local Setup
Prerequisites
| Tool | Version | Notes |
|---|---|---|
| Node.js | 20+ | Use nvm or fnm |
| pnpm | 9+ | npm i -g pnpm |
| Docker | 24+ | For Postgres via Testcontainers |
| Expo CLI | latest | pnpm add -g expo-cli |
| iOS Simulator | Xcode 15+ | macOS only |
1. Clone & Install
bash
git clone [email protected]:regulus-app/regulus.git
cd regulus
pnpm install2. Environment Variables
Copy the example env file and fill in values:
bash
cp apps/api/.env.example apps/api/.env
cp apps/admin/.env.example apps/admin/.env
cp apps/mobile/.env.example apps/mobile/.envMinimum required vars for local dev:
env
# apps/api/.env
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/regulus
JWT_SECRET=local-dev-secret-change-in-prod
ANTHROPIC_API_KEY=sk-ant-... # optional — scripted fallback used without it
RESEND_API_KEY=re_... # optional — emails go to server logs without it
CENTRIFUGO_API_URL=http://localhost:8000
CENTRIFUGO_API_KEY=centrifugo-local-keySee Environment Variables for the complete list.
3. Start Postgres
bash
docker run -d \
--name regulus-pg \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=regulus \
-p 5432:5432 \
postgres:164. Run Migrations & Seed
bash
pnpm db:migrate # applies all 49 migrations
pnpm db:seed # seeds interest catalog + feature flags + admin user5. Start Development Servers
bash
pnpm dev # starts all apps in parallel via TurborepoOr individually:
bash
pnpm api dev # NestJS API on :3000
pnpm admin dev # Next.js admin on :3001
pnpm mobile dev # Expo Metro bundler on :80816. Verify
- API health:
curl http://localhost:3000/health→{"status":"ok"} - Admin: open
http://localhost:3001and log in with the seeded admin user - Mobile: press
iin the Expo terminal to open iOS Simulator
Common Issues
Prisma client not generated: run pnpm db:migrate — it regenerates the client automatically.
Module not found @regulus/*: run pnpm install from the repo root to link workspace packages.
Centrifugo not running: real-time features (typing indicators, live notifications) will fail. Start Centrifugo via Docker or skip for feature development.