How navysaiteja/apexfit- works
ApexFit is a fitness-tracking and coaching application. A user logs in, records workouts, nutrition and body progress, then views personalized analytics and AI-generated recommendations through the frontend and API. The graph retains the product’s main domain branches—coaching, meal planning and food scanning, subscriptions, and progress—alongside the shared persistence and retrieval layer. Edges are limited to routes and calls evidenced by the provided excerpts or SOURCE INDEX; unsampled controllers and frontend pages are represented without guessed connections.
Main entry points: routes API route groups · coach.controller.ts Coach endpoints · rag.service.ts Fitness context retrieval · strength.ts Strength metrics
Components 26
User experience
- Web application
apexfit/frontend/src/App.tsx - Fitness data hook
apexfit/frontend/src/hooks/useApexData.ts - Coach chat hook
apexfit/frontend/src/hooks/useCoachChat.ts - API client
apexfit/frontend/src/services/api.ts
API and identity
- API route groups
apexfit/backend/src/routes - Authentication
apexfit/backend/src/middleware/authenticate.ts - Request validation
apexfit/backend/src/middleware/validate.ts - Account access
apexfit/backend/src/controllers/auth.controller.ts - Subscriptions
apexfit/backend/src/controllers/subscription.controller.ts
Fitness tracking
- Workout logging
apexfit/backend/src/controllers/workout.controller.ts - Progress analytics
apexfit/backend/src/controllers/progress.controller.ts - Nutrition tracking
apexfit/backend/src/controllers/nutrition.controller.ts - Strength metrics
apexfit/backend/src/utils/strength.ts
AI coaching
- Coach endpoints
apexfit/backend/src/controllers/coach.controller.ts - AI generation
apexfit/backend/src/services/anthropic.service.ts - Daily briefing
apexfit/backend/src/services/dailyBriefing.service.ts - Workout recommendations
apexfit/backend/src/services/workoutRecommendation.service.ts - Meal planning
apexfit/backend/src/services/mealPlan.service.ts - Plateau analysis
apexfit/backend/src/services/plateauAnalysis.service.ts - Fitness context retrieval
apexfit/backend/src/services/rag.service.ts - Food photo analysis
apexfit/backend/src/services/vision.service.ts
Persistence and integrations
- Application database
apexfit/backend/src/config/prisma.ts - Vector embeddings
apexfit/backend/src/config/embeddings.ts - Redis cache
apexfit/backend/src/config/redis.ts - USDA food data
apexfit/backend/src/config/usda.ts
Other components
- Fitness user
Connections 34
- Fitness user → Web application: uses
- Web application → Fitness data hook: loads data
apexfit/frontend/src/App.tsx - Web application → Coach chat hook: offers chat
- Fitness data hook → API client: requests data
- Coach chat hook → API client: sends messages
- API client → API route groups: calls API
- API route groups → Authentication: authenticates
apexfit/backend/src/routes/coach.routes.ts - API route groups → Request validation: validates
apexfit/backend/src/routes/coach.routes.ts - API route groups → Account access: dispatches
apexfit/backend/src/routes/auth.routes.ts - API route groups → Workout logging: dispatches
apexfit/backend/src/routes/workout.routes.ts - API route groups → Progress analytics: dispatches
apexfit/backend/src/routes/progress.routes.ts - API route groups → Nutrition tracking: dispatches
apexfit/backend/src/routes/nutrition.routes.ts - API route groups → Coach endpoints: dispatches
apexfit/backend/src/routes/coach.routes.ts - API route groups → Subscriptions: dispatches
apexfit/backend/src/routes/subscription.routes.ts - Workout logging → Strength metrics: logs sets
apexfit/backend/src/controllers/workout.controller.ts - Workout logging → Fitness context retrieval: refreshes profile
apexfit/backend/src/controllers/workout.controller.ts - Progress analytics → Strength metrics: computes metrics
apexfit/backend/src/controllers/progress.controller.ts - Progress analytics → Plateau analysis: analyzes stalls
apexfit/backend/src/controllers/progress.controller.ts - Nutrition tracking → Food photo analysis: analyzes photos
apexfit/backend/src/controllers/nutrition.controller.ts - Nutrition tracking → Meal planning: requests plans
apexfit/backend/src/controllers/nutrition.controller.ts - Nutrition tracking → Fitness context retrieval: retrieves context
apexfit/backend/src/controllers/nutrition.controller.ts - Coach endpoints → AI generation: generates responses
apexfit/backend/src/controllers/coach.controller.ts - Coach endpoints → Strength metrics: builds fitness context
apexfit/backend/src/controllers/coach.controller.ts - Coach endpoints → Daily briefing: gets briefing
apexfit/backend/src/controllers/coach.controller.ts - Coach endpoints → Workout recommendations: requests workouts
apexfit/backend/src/controllers/coach.controller.ts - Coach endpoints → Fitness context retrieval: retrieves context
apexfit/backend/src/controllers/coach.controller.ts - Fitness context retrieval → Vector embeddings: searches and stores
apexfit/backend/src/services/rag.service.ts - Fitness context retrieval → Strength metrics: summarizes lifts
apexfit/backend/src/services/rag.service.ts - Fitness context retrieval → Plateau analysis: analyzes causes
apexfit/backend/src/services/rag.service.ts - Fitness context retrieval → Application database: reads profile
apexfit/backend/src/services/rag.service.ts - Vector embeddings → Application database: stores vectors
apexfit/backend/src/config/embeddings.ts - Strength metrics → Application database: reads and writes logs
apexfit/backend/src/utils/strength.ts - Meal planning → USDA food data: uses food data
apexfit/backend/src/services/mealPlan.service.ts - Coach endpoints → Redis cache: caches reports
apexfit/backend/src/controllers/coach.controller.ts