Skip to content

Local Setup

Prerequisites

ToolVersionNotes
Node.js20+Use nvm or fnm
pnpm9+npm i -g pnpm
Docker24+For Postgres via Testcontainers
Expo CLIlatestpnpm add -g expo-cli
iOS SimulatorXcode 15+macOS only

1. Clone & Install

bash
git clone [email protected]:regulus-app/regulus.git
cd regulus
pnpm install

2. 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/.env

Minimum 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-key

See 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:16

4. Run Migrations & Seed

bash
pnpm db:migrate   # applies all 49 migrations
pnpm db:seed      # seeds interest catalog + feature flags + admin user

5. Start Development Servers

bash
pnpm dev          # starts all apps in parallel via Turborepo

Or individually:

bash
pnpm api dev      # NestJS API on :3000
pnpm admin dev    # Next.js admin on :3001
pnpm mobile dev   # Expo Metro bundler on :8081

6. Verify

  • API health: curl http://localhost:3000/health{"status":"ok"}
  • Admin: open http://localhost:3001 and log in with the seeded admin user
  • Mobile: press i in 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.

Regulus — invite-only social-knowledge platform