A Node.js backend API built with Express, TypeScript, and Supabase.
- Install dependencies:
npm install- Copy environment variables:
cp .env.example .env-
Fill in your environment variables in
.env -
Start the development server:
npm run devThe server will run at http://localhost:5000
- Docker installed and running
- docker-compose installed
- Test with Docker Compose (includes Redis):
npm run docker:test- Or manually with Docker Compose:
npm run docker:compose- Test with standalone Docker container:
npm run docker:build
npm run docker:runnpm run docker:build- Build Docker imagenpm run docker:run- Run Docker containernpm run docker:test- Run comprehensive Docker testnpm run docker:compose- Start with docker-compose (includes Redis)npm run docker:compose:down- Stop docker-compose services
Make sure your .env file contains all necessary variables:
SUPABASE_URLSUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEYSUPABASE_S3_ACCESS_KEYSUPABASE_S3_SECRET_KEYSUPABASE_S3_ENDPOINTJWT_SECRETREFRESH_SECRETFRONTEND_URL(optional, defaults to http://localhost:3000)
- Vercel CLI installed:
npm i -g vercel - Vercel account
- Deploy with automated script:
npm run deploy:vercel- Or manually:
vercel login
vercel --prod- Install Vercel CLI (if not already installed):
npm i -g vercel- Login to Vercel:
vercel login- Deploy to Vercel:
vercel- Set Environment Variables: After deployment, you'll need to set your environment variables in the Vercel dashboard:
- Go to your project in the Vercel dashboard
- Navigate to Settings > Environment Variables
- Add all the variables from your
.envfile:SUPABASE_URLSUPABASE_ANON_KEYSUPABASE_SERVICE_ROLE_KEYSUPABASE_S3_ACCESS_KEYSUPABASE_S3_SECRET_KEYSUPABASE_S3_ENDPOINTJWT_SECRETREFRESH_SECRETFRONTEND_URL(your frontend URL)
- Redeploy with environment variables:
vercel --prodYour API will be available at:
- Production:
https://your-project-name.vercel.app - Preview:
https://your-project-name-git-branch.vercel.app
Make sure to set these in your Vercel dashboard:
NODE_ENV=productionFRONTEND_URL(your frontend domain)
GET /- Health checkPOST /api/auth/*- Authentication routesPOST /api/message/*- Message routesPOST /api/profile/*- Profile routes
npm run build- Build TypeScript to JavaScriptnpm start- Start production servernpm run dev- Start development server
Dockerfile- Development Docker configurationDockerfile.prod- Production Docker configuration with multi-stage builddocker-compose.yml- Local development with Redis.dockerignore- Files excluded from Docker builds
- Make sure Docker is running
- Check if ports 5000 and 6379 are available
- Verify your
.envfile exists and has all required variables
- Ensure you're logged in to Vercel CLI
- Check that all environment variables are set in Vercel dashboard
- Verify the build process works locally before deploying
- Run
npm run buildto check for TypeScript errors - Ensure all dependencies are installed with
npm install