Deployment

This guide covers deploying all parts of your stack: mobile app, web app, and backend.

Mobile App

We use EAS Build (Expo Application Services) for building and deploying your mobile app.

Prerequisites

  1. Install EAS CLI: npm install -g eas-cli
  2. Log in to your Expo account: eas login

Building

To build your app for production:

eas build --profile production

Submitting

To submit your app to the stores:

eas submit --profile production

Web App

The web app is a standard Next.js application that can be deployed to any hosting platform that supports Node.js or static exports.

Vercel is the easiest option for Next.js apps:

# Install Vercel CLI
npm install -g vercel

# Deploy
vercel deploy

Or connect your Git repository for automatic deployments.

Netlify

For Netlify deployment, add the Next.js plugin:

netlify.toml
[[plugins]]
package = "@netlify/plugin-nextjs"
SSR Required

Next.js App Router uses Server Components. Do not configure Netlify for static file serving or SPA-style redirects.

Docker

Build and run the web app in a container:

# Build the image
docker build -t my-app-web ./web

# Run the container
docker run -p 3000:3000 my-app-web

Node.js Hosting

For any Node.js hosting (Railway, Render, AWS, etc.):

cd web
bun run build
bun start

Production Environment Variables

Update environment variables for production:

web/.env.production
NEXT_PUBLIC_APP_URL=https://yourdomain.com
BACKEND_URL=https://api.yourdomain.com

Backend

The backend can be deployed to any Node.js hosting platform.

  • Railway - Simple Git-based deployments
  • Render - Free tier available
  • Heroku - Classic PaaS option
  • AWS/GCP/Azure - Enterprise-grade
  • Your own VPS - Full control

Configuration

Configure environment variables from .env.example:

DATABASE_URL="postgresql://user:password@host:5432/mydb"
REDIS_URL="redis://host:6379"
CORS_ORIGINS="https://yourdomain.com,https://www.yourdomain.com"
JWT_SECRET="your-production-secret"
CORS Configuration

Make sure CORS_ORIGINS includes all your frontend URLs (both web and any mobile deep link origins).