# manish-yadav77/zuryo_fitness_app architecture

> Architecture diagram of the GitHub repository manish-yadav77/zuryo_fitness_app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/manish-yadav77/zuryo_fitness_app
- Repository: https://github.com/manish-yadav77/zuryo_fitness_app

## Overview

Zuryo is a residential fitness booking platform: customers create profiles, find and book trainers, pay or use package credits, then attend and review sessions; trainers manage availability and log workouts, while admins oversee bookings and pricing. The map combines documented capabilities with sampled route, controller, payment, session, and record code. Many service implementations and frontend API calls were not sampled, so their detailed wiring is omitted; README-described relationships are cited as such.

Main entry points: [`Backend/src/services/booking.service.ts`](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/services/booking.service.ts) (Booking and assignment), [`Frontend/src/routes/AppRoutes.tsx`](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Frontend/src/routes/AppRoutes.tsx) (Role-based web app), [`Backend/src/services/payment.service.ts`](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/services/payment.service.ts) (Payment and fulfillment), [`Backend/src/controllers/record.controller.ts`](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/controllers/record.controller.ts) (Workout records and feedback)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_web["Role-based web app<br/>[AppRoutes.tsx]"]
  node_booking_ui["Booking experience<br/>[BookPage.tsx]"]
  node_timer_ui["Live session timer"]
  node_record_ui["Workout log form"]
end

subgraph group_booking["Booking and commerce"]
  node_booking_routes["Booking routes<br/>[booking.routes.ts]"]
  node_booking_flow["Booking and assignment<br/>[booking.service.ts]"]
  node_availability["Trainer availability"]
  node_pricing["Dynamic pricing<br/>[pricing.service.ts]"]
  node_payment["Payment and fulfillment<br/>[payment.service.ts]"]
  node_packages["Package credits<br/>[package.service.ts]"]
  node_booking_store[("Booking and slot state<br/>[Booking.ts]")]
end

subgraph group_session["Sessions and fitness"]
  node_session_routes["Session routes"]
  node_session_logic["Authoritative session timer<br/>[session.service.ts]"]
  node_records["Workout records and feedback"]
  node_record_store[("Session records<br/>[SessionRecord.ts]")]
  node_ai["Recommendation engine<br/>[ai.service.ts]"]
end

subgraph group_identity["Identity and profiles"]
  node_auth["Authentication<br/>[auth.controller.ts]"]
  node_users[("User accounts<br/>[User.ts]")]
  node_assessment["Fitness assessment"]
  node_profiles[("Customer and trainer profiles<br/>[CustomerProfile.ts]")]
end

subgraph group_operations["Operations and data"]
  node_admin_ops["Admin oversight and pricing<br/>[AdminDashboard.tsx]"]
  node_notifications["Notifications"]
  node_api["REST API<br/>[app.ts]"]
end

node_customer(("Customer"))
node_trainer(("Trainer"))
node_admin(("Admin"))
node_nvidia["NVIDIA provider"]
node_gemini["Gemini provider"]
node_rules["Rules fallback"]
node_mongo[("MongoDB")]
node_razorpay["Razorpay"]

node_customer -->|"uses"| node_web
node_trainer -->|"uses"| node_web
node_admin -->|"uses"| node_web
node_web -->|"routes to"| node_booking_ui
node_customer -->|"books sessions"| node_booking_ui
node_booking_ui -.->|"requests booking"| node_booking_routes
node_booking_routes -.->|"dispatches"| node_booking_flow
node_booking_flow -.->|"checks availability"| node_availability
node_booking_flow -->|"calculates price"| node_pricing
node_booking_flow -->|"creates booking"| node_booking_store
node_booking_flow -.->|"initiates payment"| node_payment
node_payment -->|"creates orders"| node_razorpay
node_payment -->|"confirms booking"| node_booking_store
node_payment -->|"fulfills purchase"| node_packages
node_booking_flow -.->|"deducts credits"| node_packages
node_booking_routes -->|"routes session actions"| node_session_routes
node_session_routes -.->|"dispatches"| node_session_logic
node_session_logic -->|"updates timer state"| node_booking_store
node_session_logic -->|"sends updates"| node_notifications
node_web -->|"routes to"| node_timer_ui
node_timer_ui -->|"polls timer"| node_session_routes
node_trainer -->|"sets schedule"| node_availability
node_trainer -->|"logs workout"| node_record_ui
node_record_ui -.->|"submits record"| node_records
node_records -->|"writes records"| node_record_store
node_records -->|"checks booking"| node_booking_store
node_records -->|"requests recommendation"| node_ai
node_customer -->|"completes assessment"| node_assessment
node_assessment -.->|"stores profile"| node_profiles
node_ai -->|"tries first"| node_nvidia
node_ai -->|"falls back"| node_gemini
node_ai -->|"uses safety fallback"| node_rules
node_auth -->|"reads and writes"| node_users
node_web -.->|"authenticates"| node_auth
node_admin -->|"oversees platform"| node_admin_ops
node_admin_ops -->|"configures rates"| node_pricing
node_api -.->|"persists data"| node_mongo

click node_web "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Frontend/src/routes/AppRoutes.tsx"
click node_booking_ui "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Frontend/src/pages/customer/BookPage.tsx"
click node_timer_ui "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Frontend/src/components/session/SessionTimerCard.tsx"
click node_record_ui "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Frontend/src/components/records/SessionRecordForm.tsx"
click node_booking_routes "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/routes/booking.routes.ts"
click node_booking_flow "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/services/booking.service.ts"
click node_availability "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/services/availability.service.ts"
click node_pricing "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/services/pricing.service.ts"
click node_payment "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/services/payment.service.ts"
click node_packages "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/services/package.service.ts"
click node_booking_store "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/models/Booking.ts"
click node_session_routes "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/controllers/session.controller.ts"
click node_session_logic "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/services/session.service.ts"
click node_records "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/controllers/record.controller.ts"
click node_record_store "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/models/SessionRecord.ts"
click node_ai "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/services/ai.service.ts"
click node_auth "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/controllers/auth.controller.ts"
click node_users "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/models/User.ts"
click node_assessment "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/controllers/assessment.controller.ts"
click node_profiles "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/models/CustomerProfile.ts"
click node_admin_ops "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Frontend/src/pages/admin/AdminDashboard.tsx"
click node_notifications "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/services/notification.service.ts"
click node_api "https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/app.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web,node_booking_ui,node_timer_ui,node_record_ui toneBlue
class node_booking_routes,node_booking_flow,node_availability,node_pricing,node_payment,node_packages,node_booking_store,node_mongo toneAmber
class node_session_routes,node_session_logic,node_records,node_record_store,node_ai toneMint
class node_auth,node_users,node_assessment,node_profiles toneRose
class node_admin_ops,node_notifications,node_api,node_customer,node_trainer,node_admin,node_nvidia,node_gemini,node_rules,node_razorpay toneIndigo
```

## Components

### Web application

- [Role-based web app](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Frontend/src/routes/AppRoutes.tsx): `Frontend/src/routes/AppRoutes.tsx`
- [Booking experience](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Frontend/src/pages/customer/BookPage.tsx): `Frontend/src/pages/customer/BookPage.tsx`
- [Live session timer](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Frontend/src/components/session/SessionTimerCard.tsx): `Frontend/src/components/session/SessionTimerCard.tsx`
- [Workout log form](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Frontend/src/components/records/SessionRecordForm.tsx): `Frontend/src/components/records/SessionRecordForm.tsx`

### Booking and commerce

- [Booking routes](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/routes/booking.routes.ts): `Backend/src/routes/booking.routes.ts`
- [Booking and assignment](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/services/booking.service.ts): `Backend/src/services/booking.service.ts`
- [Trainer availability](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/services/availability.service.ts): `Backend/src/services/availability.service.ts`
- [Dynamic pricing](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/services/pricing.service.ts): `Backend/src/services/pricing.service.ts`
- [Payment and fulfillment](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/services/payment.service.ts): `Backend/src/services/payment.service.ts`
- [Package credits](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/services/package.service.ts): `Backend/src/services/package.service.ts`
- [Booking and slot state](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/models/Booking.ts): `Backend/src/models/Booking.ts`

### Sessions and fitness

- [Session routes](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/controllers/session.controller.ts): `Backend/src/controllers/session.controller.ts`
- [Authoritative session timer](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/services/session.service.ts): `Backend/src/services/session.service.ts`
- [Workout records and feedback](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/controllers/record.controller.ts): `Backend/src/controllers/record.controller.ts`
- [Session records](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/models/SessionRecord.ts): `Backend/src/models/SessionRecord.ts`
- [Recommendation engine](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/services/ai.service.ts): `Backend/src/services/ai.service.ts`

### Identity and profiles

- [Authentication](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/controllers/auth.controller.ts): `Backend/src/controllers/auth.controller.ts`
- [User accounts](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/models/User.ts): `Backend/src/models/User.ts`
- [Fitness assessment](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/controllers/assessment.controller.ts): `Backend/src/controllers/assessment.controller.ts`
- [Customer and trainer profiles](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/models/CustomerProfile.ts): `Backend/src/models/CustomerProfile.ts`

### Operations and data

- [Admin oversight and pricing](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Frontend/src/pages/admin/AdminDashboard.tsx): `Frontend/src/pages/admin/AdminDashboard.tsx`
- [Notifications](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/services/notification.service.ts): `Backend/src/services/notification.service.ts`
- [REST API](https://github.com/manish-yadav77/zuryo_fitness_app/blob/main/Backend/src/app.ts): `Backend/src/app.ts`

### Other components

- **Customer**
- **Trainer**
- **Admin**
- **NVIDIA provider**
- **Gemini provider**
- **Rules fallback**
- **MongoDB**
- **Razorpay**

## Connections

- Customer → Role-based web app: uses
- Trainer → Role-based web app: uses
- Admin → Role-based web app: uses
- Role-based web app → Booking experience: routes to (evidence: `Frontend/src/routes/AppRoutes.tsx`)
- Customer → Booking experience: books sessions
- Booking experience → Booking routes: requests booking
- Booking routes → Booking and assignment: dispatches
- Booking and assignment → Trainer availability: checks availability
- Booking and assignment → Dynamic pricing: calculates price
- Booking and assignment → Booking and slot state: creates booking
- Booking and assignment → Payment and fulfillment: initiates payment
- Payment and fulfillment → Razorpay: creates orders (evidence: `Backend/src/services/payment.service.ts`)
- Payment and fulfillment → Booking and slot state: confirms booking (evidence: `Backend/src/services/payment.service.ts`)
- Payment and fulfillment → Package credits: fulfills purchase (evidence: `Backend/src/services/payment.service.ts`)
- Booking and assignment → Package credits: deducts credits
- Booking routes → Session routes: routes session actions (evidence: `Backend/src/routes/booking.routes.ts`)
- Session routes → Authoritative session timer: dispatches
- Authoritative session timer → Booking and slot state: updates timer state (evidence: `Backend/src/services/session.service.ts`)
- Authoritative session timer → Notifications: sends updates (evidence: `Backend/src/services/session.service.ts`)
- Role-based web app → Live session timer: routes to (evidence: `Frontend/src/routes/AppRoutes.tsx`)
- Live session timer → Session routes: polls timer
- Trainer → Trainer availability: sets schedule
- Trainer → Workout log form: logs workout
- Workout log form → Workout records and feedback: submits record
- Workout records and feedback → Session records: writes records (evidence: `Backend/src/controllers/record.controller.ts`)
- Workout records and feedback → Booking and slot state: checks booking (evidence: `Backend/src/controllers/record.controller.ts`)
- Workout records and feedback → Recommendation engine: requests recommendation (evidence: `Backend/src/controllers/record.controller.ts`)
- Customer → Fitness assessment: completes assessment
- Fitness assessment → Customer and trainer profiles: stores profile
- Recommendation engine → NVIDIA provider: tries first
- Recommendation engine → Gemini provider: falls back
- Recommendation engine → Rules fallback: uses safety fallback
- Authentication → User accounts: reads and writes (evidence: `Backend/src/controllers/auth.controller.ts`)
- Role-based web app → Authentication: authenticates
- Admin → Admin oversight and pricing: oversees platform
- Admin oversight and pricing → Dynamic pricing: configures rates
- REST API → MongoDB: persists data
