# siddhidanekar03/rv_gym_project architecture

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

- Interactive diagram: https://gitdiagram.com/siddhidanekar03/rv_gym_project
- Repository: https://github.com/siddhidanekar03/rv_gym_project

## Overview

RVFitness is a gym-management product with a public-facing site and member portal backed by a FastAPI service. A visitor enrolls or signs in through the React app and API client; authenticated members and staff use the same service for memberships, billing, attendance, workouts, profiles, and leaderboards. Owner and front-desk tools add branch operations and administration. The graph preserves those domain areas and the database/auth layers; several endpoint and UI relationships are documented by the source index rather than sampled implementation excerpts.

Main entry points: [`frontend/src/api.js`](https://github.com/siddhidanekar03/rv_gym_project/blob/main/frontend/src/api.js) (API client), [`backend/app/core/database.py`](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/core/database.py) (Relational database), [`backend/app/services/membership_service.py`](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/services/membership_service.py) (Membership service), [`backend/app/services/attendance_service.py`](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/services/attendance_service.py) (Attendance service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Website and portal"]
  node_frontend["Public site<br/>[App.jsx]"]
  node_enrollment_ui["Enrollment and sign-in<br/>[EnrollModal.jsx]"]
  node_member_ui["Member portal"]
  node_staff_ui["Owner and desk tools<br/>[GymOwnerPanel.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_leaderboard_ui["Leaderboard view<br/>[Leaderboard.jsx]"]
end

subgraph group_api["API and access"]
  node_api_runtime["API application<br/>[main.py]"]
  node_auth_routes["Authentication<br/>[auth.py]"]
  node_enrollment_routes["Enrollment<br/>[enrollment.py]"]
  node_attendance_routes["Attendance endpoints<br/>[attendance.py]"]
  node_billing_routes["Billing endpoints<br/>[billing.py]"]
  node_auth_core["Session and security<br/>[auth.py]"]
  node_rate_limit["Rate limiting<br/>[rate_limit.py]"]
end

subgraph group_operations["Gym operations"]
  node_membership_service["Membership service"]
  node_billing_service["Billing service<br/>[billing_service.py]"]
  node_attendance_service["Attendance service"]
  node_trainer_service["Trainer management<br/>[trainer_service.py]"]
  node_announcement_service["Announcements"]
end

subgraph group_fitness["Fitness engagement"]
  node_workouts["Workout tracking<br/>[workout_service.py]"]
  node_performance["Performance tracking"]
  node_leaderboard_service["Leaderboard service"]
end

subgraph group_data["Data foundation"]
  node_organization[("Organizations and branches<br/>[organization.py]")]
  node_user_model[("Users and roles<br/>[user.py]")]
  node_membership_model[("Plans and enrollments<br/>[membership.py]")]
  node_billing_model[("Invoices and payments<br/>[billing.py]")]
  node_attendance_model[("Attendance records<br/>[attendance.py]")]
  node_leaderboard_model[("Leaderboard ledger<br/>[leaderboard.py]")]
  node_database[("Relational database<br/>[database.py]")]
end

node_visitor(("Visitor or member"))
node_redis[("Redis service")]

node_visitor -->|"browses"| node_frontend
node_frontend -->|"requests session"| node_api_client
node_enrollment_ui -->|"submits enrollment"| node_api_client
node_member_ui -->|"loads portal data"| node_api_client
node_staff_ui -->|"manages gym"| node_api_client
node_leaderboard_ui -.->|"loads standings"| node_api_client
node_api_client -.->|"sends requests"| node_api_runtime
node_api_runtime -->|"routes API"| node_auth_routes
node_auth_routes -->|"creates sessions"| node_auth_core
node_auth_routes -->|"records attendance"| node_attendance_service
node_enrollment_routes -.->|"handles enrollment"| node_membership_service
node_enrollment_routes -->|"requests billing"| node_billing_service
node_attendance_routes -.->|"handles check-in"| node_attendance_service
node_billing_routes -.->|"handles billing"| node_billing_service
node_membership_service -->|"uses billing"| node_billing_service
node_attendance_service -->|"awards points"| node_leaderboard_service
node_workouts -->|"awards workout points"| node_leaderboard_service
node_leaderboard_service -->|"writes ledger"| node_leaderboard_model
node_leaderboard_service -->|"queries members"| node_user_model
node_membership_service -->|"reads and writes"| node_membership_model
node_billing_service -->|"reads and writes"| node_billing_model
node_attendance_service -->|"records check-ins"| node_attendance_model
node_attendance_service -->|"updates member"| node_user_model
node_membership_service -->|"checks branch"| node_organization
node_database -.->|"may back limiting"| node_redis
node_api_runtime -->|"applies limits"| node_rate_limit
node_rate_limit -.->|"uses optionally"| node_redis
node_auth_core -->|"loads account"| node_user_model
node_auth_core -->|"persists sessions"| node_database
node_membership_service -.->|"uses sessions"| node_database
node_announcement_service -.->|"uses sessions"| node_database
node_trainer_service -.->|"uses sessions"| node_database
node_performance -.->|"uses sessions"| node_database

click node_frontend "https://github.com/siddhidanekar03/rv_gym_project/blob/main/frontend/src/App.jsx"
click node_enrollment_ui "https://github.com/siddhidanekar03/rv_gym_project/blob/main/frontend/src/components/EnrollModal.jsx"
click node_member_ui "https://github.com/siddhidanekar03/rv_gym_project/blob/main/frontend/src/components/MemberDashboard.jsx"
click node_staff_ui "https://github.com/siddhidanekar03/rv_gym_project/blob/main/frontend/src/components/GymOwnerPanel.jsx"
click node_api_client "https://github.com/siddhidanekar03/rv_gym_project/blob/main/frontend/src/api.js"
click node_api_runtime "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/main.py"
click node_auth_routes "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/api/v1/endpoints/auth.py"
click node_enrollment_routes "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/api/v1/endpoints/enrollment.py"
click node_attendance_routes "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/api/v1/endpoints/attendance.py"
click node_billing_routes "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/api/v1/endpoints/billing.py"
click node_membership_service "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/services/membership_service.py"
click node_billing_service "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/services/billing_service.py"
click node_attendance_service "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/services/attendance_service.py"
click node_workouts "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/services/workout_service.py"
click node_performance "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/services/performance_service.py"
click node_leaderboard_service "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/services/leaderboard_service.py"
click node_leaderboard_ui "https://github.com/siddhidanekar03/rv_gym_project/blob/main/frontend/src/components/Leaderboard.jsx"
click node_trainer_service "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/services/trainer_service.py"
click node_announcement_service "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/services/announcement_service.py"
click node_organization "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/models/organization.py"
click node_user_model "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/models/user.py"
click node_membership_model "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/models/membership.py"
click node_billing_model "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/models/billing.py"
click node_attendance_model "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/models/attendance.py"
click node_leaderboard_model "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/models/leaderboard.py"
click node_database "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/core/database.py"
click node_auth_core "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/core/auth.py"
click node_rate_limit "https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/core/rate_limit.py"

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_frontend,node_enrollment_ui,node_member_ui,node_staff_ui,node_api_client,node_leaderboard_ui toneBlue
class node_api_runtime,node_auth_routes,node_enrollment_routes,node_attendance_routes,node_billing_routes,node_auth_core,node_rate_limit,node_redis toneAmber
class node_membership_service,node_billing_service,node_attendance_service,node_trainer_service,node_announcement_service toneMint
class node_workouts,node_performance,node_leaderboard_service toneRose
class node_organization,node_user_model,node_membership_model,node_billing_model,node_attendance_model,node_leaderboard_model,node_database,node_visitor toneIndigo
```

## Components

### Website and portal

- [Public site](https://github.com/siddhidanekar03/rv_gym_project/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Enrollment and sign-in](https://github.com/siddhidanekar03/rv_gym_project/blob/main/frontend/src/components/EnrollModal.jsx): `frontend/src/components/EnrollModal.jsx`
- [Member portal](https://github.com/siddhidanekar03/rv_gym_project/blob/main/frontend/src/components/MemberDashboard.jsx): `frontend/src/components/MemberDashboard.jsx`
- [Owner and desk tools](https://github.com/siddhidanekar03/rv_gym_project/blob/main/frontend/src/components/GymOwnerPanel.jsx): `frontend/src/components/GymOwnerPanel.jsx`
- [API client](https://github.com/siddhidanekar03/rv_gym_project/blob/main/frontend/src/api.js): `frontend/src/api.js`
- [Leaderboard view](https://github.com/siddhidanekar03/rv_gym_project/blob/main/frontend/src/components/Leaderboard.jsx): `frontend/src/components/Leaderboard.jsx`

### API and access

- [API application](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/api/v1/endpoints/auth.py): `backend/app/api/v1/endpoints/auth.py`
- [Enrollment](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/api/v1/endpoints/enrollment.py): `backend/app/api/v1/endpoints/enrollment.py`
- [Attendance endpoints](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/api/v1/endpoints/attendance.py): `backend/app/api/v1/endpoints/attendance.py`
- [Billing endpoints](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/api/v1/endpoints/billing.py): `backend/app/api/v1/endpoints/billing.py`
- [Session and security](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/core/auth.py): `backend/app/core/auth.py`
- [Rate limiting](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/core/rate_limit.py): `backend/app/core/rate_limit.py`

### Gym operations

- [Membership service](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/services/membership_service.py): `backend/app/services/membership_service.py`
- [Billing service](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/services/billing_service.py): `backend/app/services/billing_service.py`
- [Attendance service](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/services/attendance_service.py): `backend/app/services/attendance_service.py`
- [Trainer management](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/services/trainer_service.py): `backend/app/services/trainer_service.py`
- [Announcements](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/services/announcement_service.py): `backend/app/services/announcement_service.py`

### Fitness engagement

- [Workout tracking](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/services/workout_service.py): `backend/app/services/workout_service.py`
- [Performance tracking](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/services/performance_service.py): `backend/app/services/performance_service.py`
- [Leaderboard service](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/services/leaderboard_service.py): `backend/app/services/leaderboard_service.py`

### Data foundation

- [Organizations and branches](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/models/organization.py): `backend/app/models/organization.py`
- [Users and roles](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/models/user.py): `backend/app/models/user.py`
- [Plans and enrollments](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/models/membership.py): `backend/app/models/membership.py`
- [Invoices and payments](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/models/billing.py): `backend/app/models/billing.py`
- [Attendance records](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/models/attendance.py): `backend/app/models/attendance.py`
- [Leaderboard ledger](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/models/leaderboard.py): `backend/app/models/leaderboard.py`
- [Relational database](https://github.com/siddhidanekar03/rv_gym_project/blob/main/backend/app/core/database.py): `backend/app/core/database.py`

### Other components

- **Visitor or member**
- **Redis service**

## Connections

- Visitor or member → Public site: browses (evidence: `frontend/src/App.jsx`)
- Public site → API client: requests session (evidence: `frontend/src/App.jsx`)
- Enrollment and sign-in → API client: submits enrollment (evidence: `frontend/src/components/EnrollModal.jsx`)
- Member portal → API client: loads portal data (evidence: `frontend/src/components/MemberDashboard.jsx`)
- Owner and desk tools → API client: manages gym (evidence: `frontend/src/components/GymOwnerPanel.jsx`)
- Leaderboard view → API client: loads standings
- API client → API application: sends requests
- API application → Authentication: routes API (evidence: `backend/app/main.py`)
- Authentication → Session and security: creates sessions (evidence: `backend/app/api/v1/endpoints/auth.py`)
- Authentication → Attendance service: records attendance (evidence: `backend/app/api/v1/endpoints/auth.py`)
- Enrollment → Membership service: handles enrollment
- Enrollment → Billing service: requests billing (evidence: `backend/app/api/v1/endpoints/enrollment.py`)
- Attendance endpoints → Attendance service: handles check-in
- Billing endpoints → Billing service: handles billing
- Membership service → Billing service: uses billing (evidence: `backend/app/services/membership_service.py`)
- Attendance service → Leaderboard service: awards points (evidence: `backend/app/services/attendance_service.py`)
- Workout tracking → Leaderboard service: awards workout points (evidence: `backend/app/services/workout_service.py`)
- Leaderboard service → Leaderboard ledger: writes ledger (evidence: `backend/app/services/leaderboard_service.py`)
- Leaderboard service → Users and roles: queries members (evidence: `backend/app/services/leaderboard_service.py`)
- Membership service → Plans and enrollments: reads and writes (evidence: `backend/app/services/membership_service.py`)
- Billing service → Invoices and payments: reads and writes (evidence: `backend/app/services/billing_service.py`)
- Attendance service → Attendance records: records check-ins (evidence: `backend/app/services/attendance_service.py`)
- Attendance service → Users and roles: updates member (evidence: `backend/app/services/attendance_service.py`)
- Membership service → Organizations and branches: checks branch (evidence: `backend/app/services/membership_service.py`)
- Relational database → Redis service: may back limiting
- API application → Rate limiting: applies limits (evidence: `backend/app/main.py`)
- Rate limiting → Redis service: uses optionally (evidence: `backend/app/core/rate_limit.py`)
- Session and security → Users and roles: loads account (evidence: `backend/app/core/auth.py`)
- Session and security → Relational database: persists sessions (evidence: `backend/app/core/auth.py`)
- Membership service → Relational database: uses sessions
- Announcements → Relational database: uses sessions
- Trainer management → Relational database: uses sessions
- Performance tracking → Relational database: uses sessions
