Skip to content

Running Locally

  • Node.js 20+
  • pnpm 11+ — install with npm i -g pnpm
  • PostgreSQL 15+ — running and accessible
  • Expo Go on your phone, or an Android/iOS simulator

From the monorepo root:

Terminal window
pnpm install

Copy the example file:

Terminal window
cp .env.example .env

Then edit .env. The required variables are:

VariableDescription
DATABASE_URLPostgreSQL connection string, e.g. postgresql://user:pass@localhost:5432/musubi
BETTER_AUTH_SECRETAny long random string — used to sign sessions
BETTER_AUTH_URLThe origin of the API server, e.g. http://localhost:3000. No trailing slash, no /api suffix.
API_SERVER_PORTPort the API listens on. Defaults to 3000
ENVIRONMENTSet to dev during development — enables CORS for localhost

SMTP variables (SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS, FROM_EMAIL) are only required if you want password reset emails to actually send. The app works without them in development.

Terminal window
pnpm db:migrate

This applies all pending Drizzle migrations to your PostgreSQL database.

From the monorepo root:

Terminal window
pnpm dev

Turborepo runs the API, the Expo client, and the docs site in parallel with an interactive TUI — each gets its own pane. Use --ui=stream for plain output.

To run a single piece in isolation:

Terminal window
cd apps/api && pnpm dev # API only → http://localhost:3000
cd apps/client && pnpm dev # Expo client only
cd packages/docs && pnpm dev # Docs site only → http://localhost:4321/docs

The Expo dev server will print a QR code. Scan it with Expo Go on your phone, or press i for an iOS simulator or a for Android.