Architecture Overview
npm run dev:infra) starts Postgres, Azurite, and the Clerk emulator from dev/docker-compose.yml.
Quick Start
1
Start shared infrastructure
2
Migrate and seed the database
3
Start api-events
4
Start the Web App
In a new terminal:
5
Start the Mobile App
In another terminal:
Access Points
Environment Configuration
Full per-component variables live in Environment Setup. The essentials for the local stack:- Mobile (
.envat root):EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY,EXPO_PUBLIC_API_URL=http://localhost:4000. For a physical device, use your machine’s LAN IP (or the Expo tunnel). - Web (
web/.env.local):NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY,CLERK_SECRET_KEY,NEXT_PUBLIC_API_URL=/api-proxy/api/v1,BACKEND_API_URL=http://localhost:4000. - api-events:
DATABASE_URL(see migrate step above);npm run dev:emulatorwires Clerk to:4711.
Development Workflow
Making API Changes
Work inapi-events/src/. Encore hot-reloads on save when using npm run dev:emulator. After route contract changes, run npm run openapi:emit and npm run openapi:parity.
Making Web Changes
Changes auto-reload with Next.js hot reload. Regenerate the typed API client after OpenAPI changes:npm run generate:api-client (also runs on predev).
Making Mobile Changes
Changes auto-reload with Expo’s hot reload.Database Operations
View Database
Migrate & Seed
Reset Database
Troubleshooting
api-events can't connect to database
api-events can't connect to database
Ensure shared infra is running:
Web app can't reach API
Web app can't reach API
- Check api-events is running:
curl http://localhost:4000/health - Verify
BACKEND_API_URL=http://localhost:4000inweb/.env.local - Clear
.next/after changingNEXT_PUBLIC_*vars
Mobile app can't reach API
Mobile app can't reach API
- Use your computer’s IP instead of
localhost - Ensure phone/emulator is on same network
- Check firewall settings
Port already in use
Port already in use
Authentication issues
Authentication issues
Ensure all services use the same Clerk credentials (or the local emulator via
npm run dev:emulator launchers).Stopping All Services
-v to the docker compose down command above.