This document outlines the steps to build and deploy the Circle Backend.
- Environment: Node.js v16+, npm/yarn.
- Database: Access to a PostgreSQL instance (e.g., Supabase, Neon, RDS).
- Cache: Access to a Redis instance (e.g., Upstash, Redis Cloud).
- Storage: Cloudinary account.
The application is written in TypeScript and must be compiled to JavaScript before production use.
-
Install Production Dependencies
npm ci --only=production
-
Generate Prisma Client
npx prisma generate
-
Compile TypeScript
npm run build
This creates a
dist/folder containing the compiled JavaScript. -
Database Migration Apply pending migrations to the production database.
npm run migrate:prod
Use the compiled entry point:
npm run prodThis runs node dist/app.js.
The project includes a vercel.json file, suggesting Vercel support.
- Install Vercel CLI:
npm i -g vercel - Login:
vercel login - Deploy:
vercel
Ensure you add all Environment Variables in the Vercel dashboard.
For VPS deployments (DigitalOcean, EC2), use generic process managers like PM2.
npm install -g pm2
pm2 start dist/app.js --name "circle-backend"