How callmejarod/jafit works
JaFit is a cross-platform fitness app with an Expo client and FastAPI backend. The principal supported flow is account registration/login and token-based identity: the API validates credentials, issues JWTs, and the client checks a stored token against the current-user endpoint. Authenticated API routes also support fitness profiles and calorie targets, meals and nutrition summaries, and workout records. The README lists AI coaching as planned; no implementation appears in the tree. Edges reflect shown calls, imports, or documented capabilities; client login-screen wiring and several unsampled route details are not inferred.
Main entry points: users.py User endpoints · main.py FastAPI application · mongodb.py MongoDB collections · profiles.py Fitness profiles
Components 20
Mobile client
- Login screen
frontend/app/login.tsx - Home screen
frontend/app/(tabs)/index.tsx - Client auth state
frontend/context/AuthContext.tsx
API routing
- FastAPI application
backend/app/main.py
Identity and profiles
- User endpoints
backend/app/routes/users.py - JWT authentication
backend/app/services/auth.py - Password security
backend/app/services/security.py - User and login models
backend/app/models/user.py - Login request model
backend/app/models/login.py
Fitness tracking
- Fitness profiles
backend/app/routes/profiles.py - Fitness profile model
backend/app/models/fitnessProfile.py - Calorie and macro estimates
backend/app/services/calorie_calculator.py - Meal tracking and summary
backend/app/routes/meals.py - Meal and food models
backend/app/models/meal.py - Workout tracking
backend/app/routes/workouts.py - Workout model
backend/app/models/workout.py - Fitness dashboard data
backend/app/routes/dashboard.py - AI fitness coach planned
Persistence
- MongoDB collections
backend/app/database/mongodb.py
Other components
- App user
Connections 22
- App user → Login screen: starts sign-in
- Login screen → User endpoints: signs in
- Client auth state → User endpoints: checks token
frontend/context/AuthContext.tsx - FastAPI application → User endpoints: mounts router
backend/app/main.py - FastAPI application → Workout tracking: mounts router
backend/app/main.py - FastAPI application → Meal tracking and summary: mounts router
backend/app/main.py - FastAPI application → Fitness profiles: mounts router
backend/app/main.py - FastAPI application → Fitness dashboard data: mounts router
backend/app/main.py - User endpoints → User and login models: validates user
backend/app/routes/users.py - User endpoints → Login request model: uses login model
backend/app/routes/users.py - User endpoints → Password security: hashes passwords
backend/app/routes/users.py - User endpoints → JWT authentication: issues tokens
backend/app/routes/users.py - User endpoints → MongoDB collections: reads and writes users
backend/app/routes/users.py - Fitness profiles → Fitness profile model: validates profile
backend/app/routes/profiles.py - Fitness profiles → Calorie and macro estimates: calculates targets
backend/app/routes/profiles.py - Fitness profiles → MongoDB collections: reads and writes profiles
backend/app/routes/profiles.py - Meal tracking and summary → Meal and food models: validates meals
backend/app/routes/meals.py - Meal tracking and summary → MongoDB collections: reads and writes meals
backend/app/routes/meals.py - Workout tracking → Workout model: validates workouts
backend/app/routes/workouts.py - Workout tracking → MongoDB collections: reads and writes workouts
backend/app/routes/workouts.py - Fitness dashboard data → MongoDB collections: reads fitness data
backend/app/routes/dashboard.py - Fitness dashboard data → Calorie and macro estimates: calculates calories
backend/app/routes/dashboard.py