How dimitargeorgievski/gymmanagerapp works
GymManagerApp is a web application for fitness tracking and trainer-client management. Users register or sign in, then view and manage workouts, plans, food, and exercises; users can also find trainers, while trainers manage clients and assign plans or workouts. The frontend uses routed pages and state stores to make authenticated API requests to a NestJS backend, whose controllers delegate to domain services. The excerpts support several frontend-to-backend routes and controller-to-service calls; other API links and persistence details are not shown, so they are omitted.
Main entry points: App.tsx App routes · api.ts API client · ClientDetailPage.tsx Client management · usePlanStore.ts Plan state
Components 26
Web client
- App routes
client/src/App.tsx - Fitness dashboard
client/src/pages/HomePage/HomePage.tsx - API client
client/src/services/api.ts
Identity
- Sign in / register
client/src/pages/Login/Login.tsx - Token storage
client/src/services/tokenService.ts - Auth endpoints
server/src/auth/auth.controller.ts - Auth service
server/src/auth/auth.service.ts
Fitness management
- Fitness pages
client/src/pages/WorkoutPage/WorkoutPage.tsx - Create workout
client/src/pages/CreateWorkoutPage/CreateWorkoutPage.tsx - Workout state
client/src/store/useWorkoutStore.ts - Plan state
client/src/store/usePlanStore.ts - Workout endpoints
server/src/workout/workout.controller.ts - Workout service
server/src/workout/workout.service.ts - Plan endpoints
server/src/plans/plans.controller.ts - Plan service
server/src/plans/plans.service.ts - Exercise endpoints
server/src/exercises/exercises.controller.ts - Exercise service
server/src/exercises/exercises.service.ts - Food endpoints
server/src/food/food.controller.ts - Food service
server/src/food/food.service.ts
Trainer coaching
- Trainer discovery
client/src/pages/FindTrainerPage/FindTrainerPage.tsx - Trainer dashboard
client/src/pages/TrainerDashboardPage/TrainerDashboardPage.tsx - Client management
client/src/pages/ClientDetailPage/ClientDetailPage.tsx - Trainer state
client/src/store/useTrainerStore.ts - Trainer requests
server/src/trainer-requests/trainer-requests.controller.ts - Request service
server/src/trainer-requests/trainer-requests.service.ts
Other components
- User or trainer
Connections 29
- User or trainer → App routes: opens app
client/src/App.tsx - App routes → Sign in / register: routes auth
client/src/App.tsx - App routes → Fitness dashboard: routes dashboard
client/src/App.tsx - App routes → Fitness pages: routes fitness
client/src/App.tsx - App routes → Create workout: routes creation
client/src/App.tsx - App routes → Trainer discovery: routes coaching
client/src/App.tsx - App routes → Trainer dashboard: routes coaching
client/src/App.tsx - App routes → Client management: routes clients
client/src/App.tsx - Sign in / register → API client: requests auth
- API client → Token storage: reads tokens
client/src/services/api.ts - API client → Auth endpoints: refreshes token
client/src/services/api.ts - Auth endpoints → Auth service: delegates auth
server/src/auth/auth.controller.ts - Fitness dashboard → Workout state: loads workouts
client/src/pages/HomePage/HomePage.tsx - Fitness dashboard → Plan state: loads plans
client/src/pages/HomePage/HomePage.tsx - Create workout → Workout state: uses state
- Workout state → API client: requests workouts
client/src/store/useWorkoutStore.ts - Plan state → API client: requests plans
client/src/store/usePlanStore.ts - Trainer dashboard → Trainer state: loads coaching data
client/src/pages/TrainerDashboardPage/TrainerDashboardPage.tsx - Client management → Trainer state: manages client
client/src/pages/ClientDetailPage/ClientDetailPage.tsx - Client management → Plan state: loads client plan
client/src/pages/ClientDetailPage/ClientDetailPage.tsx - Client management → Workout state: loads client workouts
client/src/pages/ClientDetailPage/ClientDetailPage.tsx - Trainer state → API client: requests coaching
client/src/store/useTrainerStore.ts - Trainer state → Workout endpoints: requests assignments
client/src/store/useTrainerStore.ts - Plan state → Plan endpoints: requests plans
client/src/store/usePlanStore.ts - Workout endpoints → Workout service: delegates workouts
server/src/workout/workout.controller.ts - Plan endpoints → Plan service: delegates plans
server/src/plans/plans.controller.ts - Exercise endpoints → Exercise service: delegates exercises
server/src/exercises/exercises.controller.ts - Food endpoints → Food service: delegates food
server/src/food/food.controller.ts - Trainer requests → Request service: delegates requests
server/src/trainer-requests/trainer-requests.controller.ts