# naiw991uen-collab/gymmanagmentsystem architecture

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

- Interactive diagram: https://gitdiagram.com/naiw991uen-collab/gymmanagmentsystem
- Repository: https://github.com/naiw991uen-collab/gymmanagmentsystem

## Overview

Gym Management System is an ASP.NET Core MVC application for gym staff to manage members and health records, plans and memberships, trainers, sessions, bookings, and attendance. Staff actions enter through MVC controllers, invoke business services, and persist through repositories and a Unit of Work to the database. The documented live-dashboard path refreshes analytics and broadcasts statistics through SignalR after changes. The README supports the layer and realtime links; sampled source confirms repository-to-context behavior. Other unsampled subsystem links are based on README descriptions, not direct source inspection.

Main entry points: [`GymManagmentSystem.MVC/Hubs/Class/DashboardNotifier .cs`](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Hubs/Class/DashboardNotifier%20.cs) (Dashboard notifier), [`GymManagmentSystem.DAL/Repositories/Classes/UnitOfWork.cs`](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.DAL/Repositories/Classes/UnitOfWork.cs) (Unit of Work), [`GymManagmentSystem.MVC/Controllers/MembersController.cs`](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Controllers/MembersController.cs) (Member management), [`GymManagmentSystem.MVC/Controllers/TrainersController.cs`](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Controllers/TrainersController.cs) (Trainer management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Presentation"]
  node_members_ui["Member management"]
  node_plans_ui["Plan management<br/>[PlansController.cs]"]
  node_membership_ui["Membership management"]
  node_trainers_ui["Trainer management"]
  node_sessions_ui["Session management"]
  node_booking_ui["Schedule and booking"]
  node_account_ui["Authentication"]
end

subgraph group_operations["Business operations"]
  node_members["Member service<br/>[MemberService.cs]"]
  node_plans["Plan service<br/>[PlanService.cs]"]
  node_memberships["Membership service"]
  node_trainers["Trainer service<br/>[TrainerService.cs]"]
  node_sessions["Session service<br/>[SessionService.cs]"]
  node_bookings["Booking service<br/>[BookingService.cs]"]
  node_attachments["Photo uploads"]
  node_results["Result handling<br/>[Result.cs]"]
end

subgraph group_persistence["Data access"]
  node_uow["Unit of Work<br/>[UnitOfWork.cs]"]
  node_repositories["Repositories<br/>[Repository.cs]"]
  node_session_repo["Session repository"]
  node_context["Gym data context<br/>[GymDbContext.cs]"]
end

subgraph group_dashboard["Live dashboard"]
  node_analytics["Analytics service<br/>[AnalyticService.cs]"]
  node_notifier["Dashboard notifier"]
  node_hub["Dashboard hub<br/>[DashboardHub .cs]"]
end

node_staff(("Gym staff"))
node_dashboards(("Open dashboards"))
node_database[("SQL Server")]

node_staff -->|"manages members"| node_members_ui
node_staff -->|"manages plans"| node_plans_ui
node_staff -->|"manages memberships"| node_membership_ui
node_staff -->|"manages trainers"| node_trainers_ui
node_staff -->|"schedules sessions"| node_sessions_ui
node_staff -->|"books sessions"| node_booking_ui
node_staff -->|"signs in"| node_account_ui
node_members_ui -->|"invokes"| node_members
node_plans_ui -->|"invokes"| node_plans
node_membership_ui -->|"invokes"| node_memberships
node_trainers_ui -->|"invokes"| node_trainers
node_sessions_ui -->|"invokes"| node_sessions
node_booking_ui -->|"invokes"| node_bookings
node_members -->|"uploads photos"| node_attachments
node_members -->|"persists via"| node_uow
node_trainers -->|"persists via"| node_uow
node_sessions -->|"persists via"| node_uow
node_bookings -->|"persists via"| node_uow
node_uow -->|"dispatches to"| node_repositories
node_repositories -->|"queries and updates"| node_context
node_session_repo -->|"queries sessions"| node_context
node_context -->|"reads and writes"| node_database
node_members_ui -->|"notifies changes"| node_notifier
node_sessions_ui -->|"notifies changes"| node_notifier
node_trainers_ui -->|"notifies changes"| node_notifier
node_booking_ui -->|"notifies changes"| node_notifier
node_notifier -->|"loads statistics"| node_analytics
node_notifier -->|"broadcasts through"| node_hub
node_hub -->|"pushes updates"| node_dashboards

click node_members_ui "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Controllers/MembersController.cs"
click node_plans_ui "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Controllers/PlansController.cs"
click node_membership_ui "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Controllers/MembershipsController.cs"
click node_trainers_ui "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Controllers/TrainersController.cs"
click node_sessions_ui "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Controllers/SessionsController.cs"
click node_booking_ui "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Controllers/ScheduleController.cs"
click node_account_ui "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Controllers/AccountController.cs"
click node_members "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.BLL/Services/Members/Classes/MemberService.cs"
click node_plans "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.BLL/Services/Plans/Classes/PlanService.cs"
click node_memberships "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.BLL/Services/MemberShips/Classes/MemberShipService.cs"
click node_trainers "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.BLL/Services/Trainers/Classes/TrainerService.cs"
click node_sessions "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.BLL/Services/Sessions/Classes/SessionService.cs"
click node_bookings "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.BLL/Services/Booking/Classes/BookingService.cs"
click node_attachments "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.BLL/Services/Attachment/Classes/AttachmentService.cs"
click node_results "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.BLL/Common/Result.cs"
click node_analytics "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.BLL/Services/Analytics/Classes/AnalyticService.cs"
click node_notifier "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Hubs/Class/DashboardNotifier%20.cs"
click node_hub "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Hubs/DashboardHub%20.cs"
click node_uow "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.DAL/Repositories/Classes/UnitOfWork.cs"
click node_repositories "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.DAL/Repositories/Classes/Repository.cs"
click node_session_repo "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.DAL/Repositories/Classes/SessionRepository.cs"
click node_context "https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.DAL/Contexts/GymDbContext.cs"

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_members_ui,node_plans_ui,node_membership_ui,node_trainers_ui,node_sessions_ui,node_booking_ui,node_account_ui toneBlue
class node_members,node_plans,node_memberships,node_trainers,node_sessions,node_bookings,node_attachments,node_results,node_database toneAmber
class node_uow,node_repositories,node_session_repo,node_context toneMint
class node_analytics,node_notifier,node_hub toneRose
class node_staff,node_dashboards toneIndigo
```

## Components

### Presentation

- [Member management](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Controllers/MembersController.cs): `GymManagmentSystem.MVC/Controllers/MembersController.cs`
- [Plan management](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Controllers/PlansController.cs): `GymManagmentSystem.MVC/Controllers/PlansController.cs`
- [Membership management](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Controllers/MembershipsController.cs): `GymManagmentSystem.MVC/Controllers/MembershipsController.cs`
- [Trainer management](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Controllers/TrainersController.cs): `GymManagmentSystem.MVC/Controllers/TrainersController.cs`
- [Session management](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Controllers/SessionsController.cs): `GymManagmentSystem.MVC/Controllers/SessionsController.cs`
- [Schedule and booking](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Controllers/ScheduleController.cs): `GymManagmentSystem.MVC/Controllers/ScheduleController.cs`
- [Authentication](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Controllers/AccountController.cs): `GymManagmentSystem.MVC/Controllers/AccountController.cs`

### Business operations

- [Member service](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.BLL/Services/Members/Classes/MemberService.cs): `GymManagmentSystem.BLL/Services/Members/Classes/MemberService.cs`
- [Plan service](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.BLL/Services/Plans/Classes/PlanService.cs): `GymManagmentSystem.BLL/Services/Plans/Classes/PlanService.cs`
- [Membership service](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.BLL/Services/MemberShips/Classes/MemberShipService.cs): `GymManagmentSystem.BLL/Services/MemberShips/Classes/MemberShipService.cs`
- [Trainer service](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.BLL/Services/Trainers/Classes/TrainerService.cs): `GymManagmentSystem.BLL/Services/Trainers/Classes/TrainerService.cs`
- [Session service](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.BLL/Services/Sessions/Classes/SessionService.cs): `GymManagmentSystem.BLL/Services/Sessions/Classes/SessionService.cs`
- [Booking service](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.BLL/Services/Booking/Classes/BookingService.cs): `GymManagmentSystem.BLL/Services/Booking/Classes/BookingService.cs`
- [Photo uploads](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.BLL/Services/Attachment/Classes/AttachmentService.cs): `GymManagmentSystem.BLL/Services/Attachment/Classes/AttachmentService.cs`
- [Result handling](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.BLL/Common/Result.cs): `GymManagmentSystem.BLL/Common/Result.cs`

### Data access

- [Unit of Work](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.DAL/Repositories/Classes/UnitOfWork.cs): `GymManagmentSystem.DAL/Repositories/Classes/UnitOfWork.cs`
- [Repositories](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.DAL/Repositories/Classes/Repository.cs): `GymManagmentSystem.DAL/Repositories/Classes/Repository.cs`
- [Session repository](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.DAL/Repositories/Classes/SessionRepository.cs): `GymManagmentSystem.DAL/Repositories/Classes/SessionRepository.cs`
- [Gym data context](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.DAL/Contexts/GymDbContext.cs): `GymManagmentSystem.DAL/Contexts/GymDbContext.cs`

### Live dashboard

- [Analytics service](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.BLL/Services/Analytics/Classes/AnalyticService.cs): `GymManagmentSystem.BLL/Services/Analytics/Classes/AnalyticService.cs`
- [Dashboard notifier](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Hubs/Class/DashboardNotifier%20.cs): `GymManagmentSystem.MVC/Hubs/Class/DashboardNotifier .cs`
- [Dashboard hub](https://github.com/naiw991uen-collab/gymmanagmentsystem/blob/master/GymManagmentSystem.MVC/Hubs/DashboardHub%20.cs): `GymManagmentSystem.MVC/Hubs/DashboardHub .cs`

### Other components

- **Gym staff**
- **Open dashboards**
- **SQL Server**

## Connections

- Gym staff → Member management: manages members
- Gym staff → Plan management: manages plans
- Gym staff → Membership management: manages memberships
- Gym staff → Trainer management: manages trainers
- Gym staff → Session management: schedules sessions
- Gym staff → Schedule and booking: books sessions
- Gym staff → Authentication: signs in
- Member management → Member service: invokes
- Plan management → Plan service: invokes
- Membership management → Membership service: invokes
- Trainer management → Trainer service: invokes
- Session management → Session service: invokes
- Schedule and booking → Booking service: invokes
- Member service → Photo uploads: uploads photos (evidence: `GymManagmentSystem.BLL/Services/Members/Classes/MemberService.cs`)
- Member service → Unit of Work: persists via (evidence: `GymManagmentSystem.BLL/Services/Members/Classes/MemberService.cs`)
- Trainer service → Unit of Work: persists via (evidence: `GymManagmentSystem.BLL/Services/Trainers/Classes/TrainerService.cs`)
- Session service → Unit of Work: persists via (evidence: `GymManagmentSystem.BLL/Services/Sessions/Classes/SessionService.cs`)
- Booking service → Unit of Work: persists via (evidence: `GymManagmentSystem.BLL/Services/Booking/Classes/BookingService.cs`)
- Unit of Work → Repositories: dispatches to (evidence: `GymManagmentSystem.DAL/Extentions/DependencyEnjection/DataAccessServiceCollectionExtensions.cs`)
- Repositories → Gym data context: queries and updates (evidence: `GymManagmentSystem.DAL/Repositories/Classes/Repository.cs`)
- Session repository → Gym data context: queries sessions (evidence: `GymManagmentSystem.DAL/Repositories/Classes/SessionRepository.cs`)
- Gym data context → SQL Server: reads and writes
- Member management → Dashboard notifier: notifies changes (evidence: `GymManagmentSystem.MVC/Controllers/MembersController.cs`)
- Session management → Dashboard notifier: notifies changes (evidence: `GymManagmentSystem.MVC/Controllers/SessionsController.cs`)
- Trainer management → Dashboard notifier: notifies changes (evidence: `GymManagmentSystem.MVC/Controllers/TrainersController.cs`)
- Schedule and booking → Dashboard notifier: notifies changes (evidence: `GymManagmentSystem.MVC/Controllers/ScheduleController.cs`)
- Dashboard notifier → Analytics service: loads statistics
- Dashboard notifier → Dashboard hub: broadcasts through
- Dashboard hub → Open dashboards: pushes updates
