How vishal41643-stack/fitnation-ai works
FitNation AI is a fitness platform whose main user journey runs from profile and fitness assessment through workout planning and exercise tracking, with activity, nutrition, coaching, and community features around that journey. The React client sends requests through its API service to the Express application and domain routes; those routes use PostgreSQL and, for AI features, a provider abstraction. The README documents additional capabilities, including notifications, group podiums, and reward ledgers. Route-to-provider and route-to-database links are based on sampled imports and calls; unsampled feature wiring is not inferred.
Main entry points: app.js API Gateway · db.js Database Access · workouts.routes.js Workout Plans And Sessions · users.routes.js Profiles And Assessment
Components 25
Web Client
- React Application
apps/web/src/App.jsx - Fitness Screens
apps/web/src/pages - API Client
apps/web/src/services/api.js
Identity And Platform
- API Gateway
backend/src/app.js - Profiles And Assessment
backend/src/modules/users/users.routes.js - Authentication Context
backend/src/middleware/auth.js
Training And Health
- Workout Plans And Sessions
backend/src/modules/workouts/workouts.routes.js - Form Check API
backend/src/modules/exercise-form/formCheck.routes.js - Form Analysis Engine
backend/src/modules/exercise-form/engine.js - Pose Kinematics
backend/src/modules/exercise-form/kinematics.js - Activity Trends
backend/src/modules/activity/activity.routes.js - Nutrition Logs
backend/src/modules/nutrition/nutrition.routes.js - AI Coach And Food Parser
backend/src/modules/ai-coach/aiCoach.routes.js
Community And Rewards
- Challenge Progress
backend/src/modules/challenges/challenges.routes.js - Points And Achievements
backend/src/modules/gamification/gamification.routes.js - Leaderboards
backend/src/modules/leaderboard/leaderboard.routes.js - Community Groups
backend/src/modules/groups/groups.routes.js - Notifications
backend/src/modules/notifications/notifications.routes.js
Data And Providers
- Database Access
backend/src/config/db.js - PostgreSQL
- AI Provider Service
backend/src/services/ai/index.js - OpenAI Or Mock
backend/src/services/ai/AIProvider.js - Firebase Auth
- Firebase Messaging
Other components
- Athlete
Connections 35
- Athlete → React Application: uses
- React Application → Fitness Screens: renders
- Fitness Screens → API Client: requests data
- API Client → API Gateway: sends API requests
- API Gateway → Profiles And Assessment: mounts routes
- API Gateway → Workout Plans And Sessions: mounts routes
- API Gateway → Form Check API: mounts routes
- API Gateway → Activity Trends: mounts routes
- API Gateway → Nutrition Logs: mounts routes
- API Gateway → AI Coach And Food Parser: mounts routes
- API Gateway → Challenge Progress: mounts routes
- API Gateway → Points And Achievements: mounts routes
- API Gateway → Leaderboards: mounts routes
- API Gateway → Community Groups: mounts routes
- API Gateway → Notifications: mounts routes
- Profiles And Assessment → Authentication Context: authenticates
- Workout Plans And Sessions → Authentication Context: authenticates
- Form Check API → Form Analysis Engine: analyzes pose
- Form Analysis Engine → Pose Kinematics: calculates geometry
- Workout Plans And Sessions → AI Provider Service: generates plans
- AI Coach And Food Parser → AI Provider Service: requests AI
- AI Provider Service → OpenAI Or Mock: dispatches prompts
- Profiles And Assessment → Database Access: queries
- Workout Plans And Sessions → Database Access: queries
- Activity Trends → Database Access: queries
- Nutrition Logs → Database Access: queries
- AI Coach And Food Parser → Database Access: reads and writes
- Challenge Progress → Database Access: records progress
- Points And Achievements → Database Access: reads and awards
- Leaderboards → Database Access: queries rankings
- Community Groups → Database Access: manages membership
- Notifications → Database Access: stores tokens
- Database Access → PostgreSQL: reads and writes
- Authentication Context → Firebase Auth: verifies identity
- Notifications → Firebase Messaging: push integration