BroncoFit is an end-to-end fitness companion that pairs a modern Vite + React frontend with a FastAPI backend to deliver AI-assisted coaching, nutrition logging, and performance analytics.
- Secure authentication backed by JWTs
- Progress dashboards with charts, PR tracking, and nutrition analytics
- AI-powered coach for chat guidance and structured workout suggestions
- Workout and meal logging tied to MongoDB for persistence
- Responsive, mobile-friendly UI built with React 19 and Recharts
- Frontend: React 19, Vite, Recharts, Vitest, Testing Library
- Backend: FastAPI, Motor (MongoDB), Pydantic, jose, bcrypt, Google Gemini API
- Tooling: ESLint, pytest, GitHub Actions CI
- Node.js 18+
- npm 9+
- Python 3.11+
- MongoDB 6/7 (local or Atlas)
- Google Gemini API key (for AI coach features)
cd api- Create and activate a virtual environment
- Windows:
python -m venv venv && .\venv\Scripts\activate - macOS/Linux:
python3 -m venv venv && source venv/bin/activate
- Windows:
- Install dependencies:
pip install -r requirements.txt - Create
api/.envwith the following keys:MONGODB_URI=mongodb://localhost:27017/broncofit DATABASE_NAME=broncofit JWT_SECRET_KEY=replace-with-strong-secret JWT_ALGORITHM=HS256 ACCESS_TOKEN_EXPIRE_MINUTES=1440 GEMINI_API_KEY=replace-with-google-gemini-key
- Start the API:
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000 - Docs are available at
http://localhost:8000/docs
- From the repo root run
npm install - Start the dev server:
npm run dev - Vite serves the app at
http://localhost:5173
- Run the FastAPI server (step above)
- Run the Vite dev server
- Update
src/services/api.jsif your API base URL differs from/api
| Area | Command |
|---|---|
| Frontend | npm test (single run) |
npm run test:watch |
|
npm run test:coverage |
|
| Lint | npm run lint |
| Backend | cd api && pytest tests -v |
- Build frontend assets:
npm run build(outputs todist/, ignored by git) - Serve the compiled frontend behind nginx or any static file host
- Run the API with multiple workers:
uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4 - Example systemd service is documented in
api/README.md
POST /api/auth/register,POST /api/auth/login,GET /api/auth/meGET/PUT /api/profile,POST /api/profile/initializeGET/POST /api/measurements,GET /api/measurements/latestPOST /api/calculations/tdee|bmiGET/POST /api/workouts,GET /api/workouts/latestGET/POST /api/nutritionPOST /api/ai-coach/chatand/ai-coach/suggest-workout
- Frontend build errors: remove
node_modules, reinstall, and rerunnpm run dev - Backend connection issues: verify MongoDB is reachable and credentials are correct
- CORS errors: update the allowed origins list in
api/app/main.py - AI coach failures: ensure
GEMINI_API_KEYis set and has quota
BroncoFit is released under the Apache License. See LICENSE for details.