- Frontend:
https://fit-life-ai-1eqx.vercel.app - Backend API:
https://shinzobolte-fitlife-ai.hf.space
FitLife is a full-stack fitness product with three core surfaces:
- Fuel Scan - upload a nutrition label photo and get extracted nutrition data, scoring, and profile-aware recommendations.
- Form Coach - upload a workout clip and receive rep counting, movement scoring, and coaching cues powered by YOLO pose checkpoints.
- FitLife Coach - ask nutrition and recovery questions through a profile-aware AI assistant.
This repo is deployed with:
Vercelfor the Next.js frontendHugging Face Spaces (Docker)for the Flask backend
| Layer | Technology |
|---|---|
| Frontend | Next.js 15, React 19, Tailwind CSS 4, TypeScript |
| Backend API | Flask, SQLAlchemy, PyJWT, Flask-Login |
| AI / ML | YOLOv8 pose, Groq vision/text models, RAG retrieval |
| Async Tasks | Celery + Redis (optional) |
| Database | SQLite (dev), PostgreSQL / Neon (prod) |
| Deployment | Vercel (frontend) + Hugging Face Spaces (backend) |
fitlife/
|-- frontend/ # Next.js frontend
|-- gateway/ # Flask API gateway
|-- services/
| |-- muscle_ai_service/ # Workout analysis service
| |-- nutri_ai_service/ # Nutrition / RAG service
| `-- shared/database/ # Shared SQLAlchemy models
|-- data/
| `-- nutri-ai/ # Knowledge base JSON files
|-- model/
| `-- models/ # Tracked YOLO workout checkpoints
|-- docs/ # Resume + deployment docs
`-- web/ # Legacy Jinja templates / static output
- Python 3.11+
- Node.js 18+
- Groq API key for nutrition OCR / chat features
git clone https://github.com/shinzoxD/FitLife-AI.git
cd FitLife-AIpython -m venv .venv
# Windows
.\.venv\Scripts\Activate.ps1
# macOS / Linux
source .venv/bin/activate
pip install -r requirements.txt
copy env.example .envEdit .env and set at least:
SECRET_KEYJWT_SECRET_KEYGROQ_API_KEYDATABASE_URLfor PostgreSQL in production
cd frontend
npm install
copy .env.example .env.local
cd ..Set this in frontend/.env.local:
NEXT_PUBLIC_API_URL=http://localhost:5000Open two terminals:
# Terminal 1
python gateway/app.py
# Terminal 2
cd frontend && npm run devThe workout checkpoints are tracked in:
model/models
Current checkpoints:
best.ptsumo_best.ptsquats_best.ptbest_romanian.ptzercher_best.ptfront_squats_best.pt
The workout service auto-resolves these from:
services/muscle_ai_service/config/settings.py
To inspect embedded validation metrics:
G:\fitlife\.venv\Scripts\python.exe scripts\evaluate_muscle_models.pyTo run a fresh validation pass once you have the dataset YAML:
G:\fitlife\.venv\Scripts\python.exe scripts\evaluate_muscle_models.py --data path\to\config.yamlAll API routes are prefixed with /api/v1/.
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| POST | /auth/register |
- | Create account |
| POST | /auth/login |
- | Get JWT tokens |
| POST | /auth/refresh |
- | Refresh access token |
| GET | /user |
JWT | Get user profile |
| PUT | /user/settings |
JWT | Update profile |
| GET | /user/scans |
JWT | Scan history |
| GET | /user/workouts |
JWT | Workout history |
| GET | /dashboard/stats |
JWT | Dashboard statistics |
| POST | /nutri-ai/upload |
Optional | Upload nutrition label |
| POST | /nutri-ai/analyze |
Optional | Analyze extracted nutrition data |
| POST | /muscle-ai/upload |
Optional | Upload workout video |
| GET | /muscle-ai/task/:id |
- | Poll async task status |
| POST | /ana/chat |
Optional | Chat with FitLife Coach |
Use env.example as the base. The important ones are:
| Variable | Required | Description |
|---|---|---|
SECRET_KEY |
Yes | Flask session secret |
JWT_SECRET_KEY |
Yes | JWT signing secret |
DATABASE_URL |
Production | PostgreSQL connection string (Neon works well) |
GROQ_API_KEY |
For nutrition/chat | Groq API key |
FRONTEND_URL |
In production | Public Vercel frontend URL |
NEXT_PUBLIC_API_URL |
Frontend | Public backend URL |
Use a Docker Space and point it at this repo.
The root Dockerfile is now prepared for Spaces:
- installs the full backend + workout-model dependencies
- copies the tracked YOLO checkpoints from
model/models - serves the Flask gateway on port
7860
Space variables to set:
SECRET_KEYJWT_SECRET_KEYDATABASE_URL=postgresql://...GROQ_API_KEYFRONTEND_URL=https://your-vercel-app.vercel.appGOOGLE_CLIENT_ID(optional)GOOGLE_CLIENT_SECRET(optional)
Use the template in docs/HUGGINGFACE_SPACE_README.md for the Space repo README.md metadata.
- Import the GitHub repo into Vercel
- Keep the existing root directory from
vercel.json:frontend
- Set:
NEXT_PUBLIC_API_URL=https://shinzobolte-fitlife-ai.hf.space
- After Vercel gives you the frontend URL, set
FRONTEND_URLin the Hugging Face Space to that exact URL - Redeploy the Space once after updating
FRONTEND_URL
Notes:
- Hugging Face free Spaces can sleep when idle
- The backend is public at the
.hf.spaceURL, which is required for the Vercel frontend to call it directly - For durable user accounts and settings, use PostgreSQL instead of the default SQLite fallback
This repo now includes:
ci.ymlfor frontend build, gateway smoke tests, and workout model loadingcd.ymlfor production deployment frommain
For the Vercel deployment job:
VERCEL_TOKENVERCEL_ORG_IDVERCEL_PROJECT_ID
For the Hugging Face Space deployment job:
HF_TOKENHF_SPACE_REPO
Example HF_SPACE_REPO value:
shinzobolte/fitlife-ai
- Pull requests and pushes run
CI - A successful
CIrun onmaintriggersCD CDdeploys the frontend to VercelCDsyncs a Space-ready backend bundle to your Hugging Face Space repo
If you use the GitHub Actions Vercel deploy, disable duplicate auto-deploy behavior in Vercel if you do not want both Git integration and Actions creating separate production deployments.
Use docs/RESUME_PROJECT.md for resume bullets, a portfolio summary, and interview talking points.
- Ultralytics YOLOv8 for pose estimation
- Groq for nutrition OCR and text inference
- Harvard Medical School nutrition research used in the knowledge base
This project is licensed under the MIT License.