FitPilot is a modern, professional-grade metabolic tracking and biomechanical training assistant. It combines a FastAPI MongoDB Atlas backend with a React Native Expo TypeScript mobile application.
- Framework: React Native with Expo (v57.0.0)
- Language: TypeScript
- Navigation: React Navigation (Native Stack + Bottom Tabs)
- Sensory Tracking: Expo Sensors (Pedometer integration for motion tracking)
- Biomechanical AI: Client-side WASM/WebGL MediaPipe Pose tracking
- Framework: FastAPI
- ASGI Server: Uvicorn
- Async MongoDB Client: Motor
- AI Engine: Google Gemini 2.5 Flash API (via raw HTTPS/HTTPX requests)
- Security: Cryptographic password hashing (Bcrypt) & JWT session tokens (PyJWT)
- Engine: MongoDB Atlas (Async Document Store)
- Step Tracker: Accesses the native hardware pedometer. Tracks live step counts alongside calculated walk distance (km) and active calorie expenditure. Falls back to a mock step simulator on emulators/web.
- AI Adaptation Engine: Analyzes your logged meals and physical exercises for today, calculates metabolic targets based on body weight guidelines, and outputs macro and calorie guidance saved directly to your profile.
- Real-Time Performance Indicators: Dynamic grid highlighting active calorie burn, logged calories consumed, exercise exertion rate, and macronutrient balance (Protein/Carbs/Fat).
- Natural Language Input: Type what you ate in plain text (e.g., "I had 2 cups of masoor dal and 4 boiled eggs for lunch").
- Gemini NLP Parsing: Translates plain text into ICMR standard portions, computes macro distributions, and auto-saves the logged meals straight into MongoDB.
- Persisted History: Loads previous chat conversation sessions on startup and supports clearing logs from the database via a trash icon.
- Custom List Formatting: Renders markdown details, bold labels, and bulleted ingredients into structured text bubbles.
- Quick Logging: Save training sets, reps, and resistance weights.
- MET Calculations: Computes calorie burn and exertion intensity ratings dynamically based on exercise MET indexes:
- Squat: 5.0 MET
- Bicep Curl: 3.5 MET
- Workout History: Displays a timeline of exercises logged during the day.
- Latency-Free Detection: Processes camera frames locally on the client using WebGL-accelerated MediaPipe (avoiding round-trip network delays).
- Form Analysis & Audio-Visual Feedback:
- Squats: Checks depth and checks back rounding.
- Bicep Curls: Checks elbow placement and leans.
- Skeletal Color Cues: Skeletal overlays render in green when form is correct and turn red during errors.
Based on activity duration, metabolic index (MET), and user body weight:
Measures mechanical load adjusted against body weight:
Calculated on user profile body weight:
-
Target Protein:
$1.6\text{g} \times \text{Weight (kg)}$ -
Target Carbohydrates:
$3.0\text{g} \times \text{Weight (kg)}$ -
Target Lipids (Fat):
$1.0\text{g} \times \text{Weight (kg)}$ -
Calorie Allowance:
$2000\text{ kcal} + \text{Workout Calories Burned}$
Ensure you have:
- A MongoDB Atlas Connection URI.
- A Gemini API key from Google AI Studio.
Create a .env file in the backend/ directory:
SECRET_KEY=your_jwt_secret_signing_key
MONGODB_URL=mongodb+srv://<username>:<password>@cluster.mongodb.net/fitpilot
GEMINI_API_KEY=AIzaSy...cd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload --host 127.0.0.1 --port 8000cd mobile
npm install
npx expo start- Press w to run on web browser.
- Scan QR code to launch in Expo Go on Android/iOS.
