The API is a standard Node.js app. Every host needs the same three things:
| Command | |
|---|---|
| Install | pnpm install --frozen-lockfile |
| Build | pnpm --filter @sellzy/api build |
| Start | pnpm --filter @sellzy/api start |
Environment variables
Set these on the host (not in a committed file):
NODE_ENV=production
PORT=8000 # most hosts set this for you
MONGO_URI=mongodb+srv://... # Atlas, with /sellzy before the ?
JWT_SECRET=<a new 64-character random value>
SERVER_URL=https://api.yourstore.com
PRODUCTION_CLIENT_URL=https://yourstore.com
PRODUCTION_ADMIN_URL=https://admin.yourstore.com
Add your Stripe live keys and webhook secret, upload provider keys and SMTP settings too. Generate a secret with openssl rand -hex 32.
Render
- New → Web Service and pick your repository.
- Root Directory: leave empty (the monorepo root).
- Build Command:
corepack enable && pnpm install --frozen-lockfile && pnpm --filter @sellzy/api build - Start Command:
pnpm --filter @sellzy/api start - Add the environment variables and deploy.
Railway
- New project → Deploy from GitHub repo.
- In the service Settings, set the same build and start commands as Render.
- Add the variables, then Settings → Networking → Generate Domain.
A VPS with PM2 and Nginx
On an Ubuntu server with Node 22+:
corepack enable
git clone <your-repo> sellzy && cd sellzy
pnpm install --frozen-lockfile
pnpm --filter @sellzy/api build
# put the production values in apps/api/.env
npm install -g pm2
pm2 start "pnpm --filter @sellzy/api start" --name sellzy-api
pm2 save && pm2 startup
Then point Nginx at the API and add HTTPS with Certbot:
server {
server_name api.yourstore.com;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Vercel
apps/api/vercel.json is included, so the API can also run on Vercel as a serverless function. Import the repository with Root Directory apps/api and add the variables.
Note
Serverless functions start cold and have time limits. For a busy store, a long-running host (Render, Railway or a VPS) is the better fit.
Check it
Open https://api.yourstore.com/api/docs. If Swagger loads, the API is up.
