Ensure apps/api/.dev.vars exists and contains DATABASE_URL. For bun db:* scripts, also set it in packages/db/.env.
Generate one: openssl rand -hex 32
Add your origin to TRUSTED_ORIGINS in apps/api/src/index.ts.
- The API CORS config includes your frontend origin
credentials: trueis set in the CORS config- The auth client
baseURLmatches the actual API URL
Use your LAN IP (192.168.x.x:8787) instead of localhost on physical devices.
Expected on first run if the drizzle/ folder is missing — it generates all tables from scratch.
Run bun install from the repo root to restore workspace symlinks.
You have module-level code accessing process.env or performing I/O. Move createDb() and createAuth() inside the request handler or tRPC context factory.