Skip to main content
The Launch backend is a lightweight Node server designed for mobile-first products: authentication, payments, uploads, and a type-safe API surface for the app.

Prerequisites

  • PostgreSQL database available
  • .env values configured for the features you will use

Steps

  1. Configure env vars: Environment Variables
  2. Choose ORM: Database ORM
  3. Provision a DB (optional): Neon Database
  4. Run migrations in apps/api
  5. 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 AppRouter types for mobile + web

File Structure

apps/api/
├── src/
│   ├── routers/           # tRPC routers (chat, stripe, upload, user)
│   ├── routes/            # REST endpoints (auth, webhooks, ai streaming)
│   ├── services/          # Business logic (auth, AI, payments)
│   ├── lib/               # ORM adapters, S3, Stripe clients
│   ├── config/            # Env/config
│   ├── app.ts             # Koa app wiring
│   └── index.ts           # Server entry point
├── prisma/                # schema.prisma + migrations
└── package.json

Deployment Options

The backend can be deployed to various platforms:
PlatformTypeBest For
RailwayContainerSimple deploys, auto-scaling
VercelServerlessEdge functions, fast cold starts
Fly.ioContainerGlobal distribution
AWSVariousEnterprise, custom infra

Troubleshooting

  • Database connection errors: confirm DATABASE_URL
  • Auth provider errors: verify provider env vars

Next Steps