Deployment Guide - Jashan-randhawa/AI-FitnessTracker1 GitHub Wiki
This guide covers deploying FitTrack AI to production cloud platforms.
- Create a free M0 cluster on MongoDB Atlas.
- Create a Database User with read and write credentials.
- In Network Access, add IP address
0.0.0.0/0to allow connections from cloud hosting platforms. - Copy your Connection String URI:
mongodb+srv://<username>:<password>@cluster0.mongodb.net/fittrack?retryWrites=true&w=majority
- Create a new Web Service on Render.
- Connect your GitHub repository.
- Configure the service:
-
Root Directory:
server -
Environment:
Node -
Node Version:
>=20.0.0 -
Build Command:
npm install -
Start Command:
node server.js
-
Root Directory:
- Add Environment Variables:
-
NODE_ENV:production -
PORT:10000 -
MONGODB_URI: Your MongoDB Atlas Connection String -
JWT_SECRET: A secure random secret (min 32 chars) -
OPENROUTER_API_KEY: Your OpenRouter API Key -
CLIENT_URL:https://ai-fitness-tracker1.vercel.app
-
- Deploy service. Note your public backend URL (e.g.
https://fittrack-api.onrender.com).
- Sign in to Vercel and click Add New > Project.
- Select
AI-FitnessTracker1. - Configure Project Settings:
-
Root Directory:
client -
Framework Preset:
Vite -
Build Command:
npm run build -
Output Directory:
dist
-
Root Directory:
- Add Environment Variable:
-
VITE_API_URL:https://fittrack-api.onrender.com(LegacyVITE_STRAPI_API_URLis also supported for backward compatibility).
-
- The repository includes
client/vercel.jsonfor client-side single page app routing:{ "rewrites": [{ "source": "/(.*)", "destination": "/" }] } - Click Deploy.
- Verify that the GitHub Actions CI workflow (
.github/workflows/ci.yml) completed cleanly. - Navigate to your deployed Vercel domain.
- Sign up a new user account.
- Verify that the dynamic goal rings render and the water tracker increments properly.
- Inspect the 90-Day Calendar Heatmap on Food Log and Activity Log.
- Test the AI Food Snap by uploading an image.
- Open AI Assistant and chat with FitBot.