Druta is a mobile-first running app. The backend currently lives in druta/apps/web (auth + API routes) and is consumed by the Expo mobile app in druta/apps/mobile.
cd druta/apps/web && bun installcd ../mobile && npm install
cp druta/apps/web/.env.example druta/apps/web/.envcp druta/apps/mobile/.env.example druta/apps/mobile/.env
Required backend envs in druta/apps/web/.env:
DATABASE_URL=postgresql://...AUTH_SECRET=<random secret>AUTH_URL=<backend origin>
Required mobile envs in druta/apps/mobile/.env:
EXPO_PUBLIC_BASE_URL=<backend origin>EXPO_PUBLIC_PROXY_BASE_URL=<backend origin>EXPO_PUBLIC_HOST=<backend host without https://>
cd druta/apps/webbun run db:migrate
cd druta/apps/webbun run dev --host 0.0.0.0 --port 3000
cd druta/apps/mobilenpm run start:phone
This starts Expo in tunnel mode and prevents stale LAN Metro sessions that frequently break physical phone launches.
cd druta/apps/webbun run buildbun run start
Health endpoint:
GET /api/healthz
- Create Neon production DB/project (or a dedicated production branch).
- Create a Railway project and a service targeting
druta/apps/web.
- Root directory:
druta/apps/web - Build command:
bun install && bun run build - Start command:
bun run start
DATABASE_URL=<Neon pooled URL with sslmode=require>AUTH_SECRET=<secure random secret>AUTH_URL=https://<your-railway-domain>ALLOW_DEV_AUTH=false
- Run:
bun run db:migrate - Confirm migration table contains
0001_initial_schema.sql.
Update druta/apps/mobile/.env:
EXPO_PUBLIC_BASE_URL=https://<your-railway-domain>EXPO_PUBLIC_PROXY_BASE_URL=https://<your-railway-domain>EXPO_PUBLIC_HOST=<your-railway-domain>
Restart Expo after env updates.
Use these only when backend is local and the phone needs internet-reachable access:
cd druta/apps/web && bun run ngrok:start-freecd druta/apps/web && bun run ngrok:sync-env- Restart backend if
.envchanges stopped dev server. cd druta/apps/web && bun run ngrok:doctor
Run end-to-end smoke check (signup -> run save -> territory read -> challenge race):
- Start backend with dev auth enabled:
cd druta/apps/web && ALLOW_DEV_AUTH=true bun run dev --host 127.0.0.1 --port 3001 - In another terminal:
cd druta/apps/web && SMOKE_BASE_URL=http://127.0.0.1:3001 bun run smoke:e2e