Prerequisites
- PostgreSQL database available
.envvalues configured for the features you will use
Steps
- Configure env vars: Environment Variables
- Choose ORM: Database ORM
- Provision a DB (optional): Neon Database
- Run migrations in
apps/api - Start the server with
pnpm dev
Tech Stack
Koa
Minimal Node.js server framework. Easy to understand and customize.
Prisma + Drizzle
Switchable ORM adapters for PostgreSQL (Prisma default, Drizzle optional).
PostgreSQL
Reliable, production-ready relational database.
tRPC
End-to-end typesafe APIs without code generation.
What’s Included
- Authentication API - Session management with Better Auth
- User Management - Profile storage and updates
- Payment Webhooks - Stripe webhook handlers
- Database Migrations - Prisma schema + migrations (or Drizzle tooling)
- Type Safety - Shared
AppRoutertypes for mobile + web
File Structure
Deployment Options
The backend can be deployed to various platforms:| Platform | Type | Best For |
|---|---|---|
| Railway | Container | Simple deploys, auto-scaling |
| Vercel | Serverless | Edge functions, fast cold starts |
| Fly.io | Container | Global distribution |
| AWS | Various | Enterprise, custom infra |
Troubleshooting
- Database connection errors: confirm
DATABASE_URL - Auth provider errors: verify provider env vars