Deployment
Deploy The Care Nexus to Vercel (frontend) and Render (backend) for production.
Updated June 2026 7 min read
The Care Nexus production deployment uses a split-hosting model: the Next.js frontend deploys to Vercel's global edge network for fast international delivery, and the Express.js backend deploys to Render or Railway for persistent Node.js hosting with always-on WebSocket support. MongoDB Atlas and Upstash Redis are fully managed cloud services that require no server configuration.
Frontend — Vercel
Setup
- Connect your GitHub repository to Vercel
- Set the root directory to
client/ - Framework preset: Next.js (auto-detected)
- Add production environment variables in Vercel dashboard
Required Environment Variables (Vercel)
Vercel Environment Variables
NEXT_PUBLIC_API_URL=https://your-api.onrender.com/api NEXT_PUBLIC_SOCKET_URL=https://your-api.onrender.com GOOGLE_CLIENT_ID=your_production_client_id GOOGLE_CLIENT_SECRET=your_production_client_secret NEXTAUTH_URL=https://your-app.vercel.app NEXTAUTH_SECRET=your_production_nextauth_secret
Backend — Render
Setup
- Create a new Web Service on Render
- Connect your GitHub repository
- Root directory:
api/ - Build command:
npm install - Start command:
node index.js - Add all production environment variables
Required Environment Variables (Render)
Render Environment Variables
NODE_ENV=production PORT=5000 MONGO_URI=mongodb+srv://... FRONTEND_URL=https://your-app.vercel.app # ... all other api/.env variables
Post-Deployment Checklist
| Check | How to Verify |
|---|---|
| Frontend loads | Open https://your-app.vercel.app — landing page renders |
| Backend health | GET https://your-api.onrender.com/api/health → { status: 'ok' } |
| Auth works | Register → login → session persists |
| Socket.IO works | Chat message appears instantly |
| Google OAuth | Login redirects correctly and returns |
| File upload | Cloudinary image URL appears |
| AI features | Gemini responds in chat |
CORS update required
After deploying, update backend CORS to allow only your production frontend domain and redeploy the API server.