The backend runs on Bun, connects to MongoDB + Redis, authenticates with
Auth0, and calls OpenAI/Anthropic based on
AI_PROVIDER. This guide walks
through the minimum setup to exercise /app/launch and /api/v1/auth/*.Requirements
1. Clone and install
Bun installs all workspaces declared inpackage.json, so the shared code undersrc/sharedstays in sync with the service packages.
2. Configure environment variables
Copy the sample file and fill in the required keys:src/shared/config/env.schema.ts):
Keep secrets in your local environment (never commit). The schema will throw a
descriptive error if anything critical is missing.
3. Start dependencies
- MongoDB / Redis: run them locally (Docker, Atlas, Upstash). Update
DATABASE_URLand the Redis section to point at the running instances. - External APIs: ensure Auth0, Exotel, Langfuse, Pinecone credentials are valid for the environment you are targeting.
4. Run the server
success: true. The terminal logs will list the
mounted routes, request IDs, and any failing upstream calls.
5. Exercise core flows
1
Create or link a user
Use the scripts in
scripts/ (create-test-user.ts, generate-test-token.ts)
to seed a MongoDB user tied to your Auth0 identity.2
Send OTP / app launch
Hit
POST /api/v1/auth/send-otp to verify the Exotel wiring, then call
GET /app/launch with the headers defined in /api-reference/endpoint/app-launch.3
Run the AI stack
Call
POST /api/v1/ai/chat with a valid Bearer token and confirm traces appear
in Langfuse.6. Run tests and checks
Next steps
- Follow the deeper workflow practices in
/development - Review
/api-reference/*for the launch and system health contracts - Read
APP_LAUNCH_IMPLEMENTATION.mdto understand how the device lookup + onboarding logic works before touching the service layer