# selwintejada/gym-management-system architecture

> Architecture diagram of the GitHub repository selwintejada/gym-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/selwintejada/gym-management-system
- Repository: https://github.com/selwintejada/gym-management-system

## Overview

This is a PHP gym-management application for staff and owners. Its main workflow is managing members and memberships, recording check-ins and personal-training activity, processing payments and expenses, then reviewing reports and analytics. The graph also shows shared authentication/configuration and the database layer. The README is empty; several capabilities are represented by their paths and navigation, but their internal calls were not sampled, so uncertain relationships are omitted or marked unverified.

Main entry points: [`config/database.php`](https://github.com/selwintejada/gym-management-system/blob/main/config/database.php) (Application database), [`config/config.php`](https://github.com/selwintejada/gym-management-system/blob/main/config/config.php) (Application config), [`dashboard.php`](https://github.com/selwintejada/gym-management-system/blob/main/dashboard.php) (Dashboard), [`members/view.php`](https://github.com/selwintejada/gym-management-system/blob/main/members/view.php) (Member records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Access and shared runtime"]
  node_dashboard["Dashboard<br/>[dashboard.php]"]
  node_app_config["Application config<br/>[config.php]"]
  node_auth["Authentication<br/>[auth.php]"]
  node_shared_ui["Shared navigation<br/>[sidebar.php]"]
  node_database[("Application database<br/>[database.php]")]
end

subgraph group_members["Members and attendance"]
  node_member_records["Member records<br/>[view.php]"]
  node_membership["Membership plans<br/>[renew.php]"]
  node_attendance_checkin["Check-in<br/>[checkin.php]"]
  node_attendance_history["Attendance history<br/>[index.php]"]
  node_walkins["Walk-in customers<br/>[add.php]"]
end

subgraph group_services["Training services"]
  node_trainers["Trainer management<br/>[view.php]"]
  node_pt_sessions["PT sessions<br/>[sessions.php]"]
end

subgraph group_finance["Finance operations"]
  node_payments["Payments<br/>[create.php]"]
  node_expenses["Expenses<br/>[edit.php]"]
  node_daily_closing["Daily closing<br/>[close.php]"]
end

subgraph group_insights["Reporting and administration"]
  node_report_generation["Report generation<br/>[generate.php]"]
  node_revenue_report["Revenue reporting<br/>[revenue.php]"]
  node_analytics["Analytics<br/>[index.php]"]
  node_audit_logs["Audit logs<br/>[index.php]"]
  node_settings["System settings<br/>[index.php]"]
end

node_staff_user(("Staff or owner"))

node_staff_user -->|"opens"| node_dashboard
node_staff_user -->|"navigates"| node_member_records
node_staff_user -->|"navigates"| node_attendance_checkin
node_staff_user -->|"navigates"| node_trainers
node_staff_user -->|"navigates"| node_pt_sessions
node_staff_user -->|"navigates"| node_expenses
node_staff_user -->|"navigates"| node_analytics
node_dashboard -->|"loads"| node_app_config
node_app_config -->|"loads"| node_database
node_app_config -->|"loads"| node_auth
node_member_records -->|"queries"| node_database
node_attendance_checkin -->|"records check-ins"| node_database
node_attendance_history -->|"reads attendance"| node_database
node_analytics -->|"queries metrics"| node_database
node_expenses -->|"queries expenses"| node_database
node_payments -->|"queries payments"| node_database
node_membership -.->|"updates memberships"| node_database
node_walkins -.->|"records walk-ins"| node_database
node_trainers -.->|"manages trainers"| node_database
node_pt_sessions -.->|"manages sessions"| node_database
node_daily_closing -.->|"closes daily totals"| node_database
node_report_generation -.->|"queries report data"| node_database
node_revenue_report -.->|"queries revenue"| node_database
node_audit_logs -.->|"reads audit records"| node_database
node_settings -.->|"manages settings"| node_database

click node_dashboard "https://github.com/selwintejada/gym-management-system/blob/main/dashboard.php"
click node_app_config "https://github.com/selwintejada/gym-management-system/blob/main/config/config.php"
click node_auth "https://github.com/selwintejada/gym-management-system/blob/main/includes/auth.php"
click node_shared_ui "https://github.com/selwintejada/gym-management-system/blob/main/includes/sidebar.php"
click node_member_records "https://github.com/selwintejada/gym-management-system/blob/main/members/view.php"
click node_membership "https://github.com/selwintejada/gym-management-system/blob/main/membership/renew.php"
click node_attendance_checkin "https://github.com/selwintejada/gym-management-system/blob/main/attendance/checkin.php"
click node_attendance_history "https://github.com/selwintejada/gym-management-system/blob/main/attendance/index.php"
click node_walkins "https://github.com/selwintejada/gym-management-system/blob/main/walkins/add.php"
click node_trainers "https://github.com/selwintejada/gym-management-system/blob/main/trainers/view.php"
click node_pt_sessions "https://github.com/selwintejada/gym-management-system/blob/main/pt/sessions.php"
click node_payments "https://github.com/selwintejada/gym-management-system/blob/main/payments/create.php"
click node_expenses "https://github.com/selwintejada/gym-management-system/blob/main/expenses/edit.php"
click node_daily_closing "https://github.com/selwintejada/gym-management-system/blob/main/daily-closing/close.php"
click node_report_generation "https://github.com/selwintejada/gym-management-system/blob/main/reports/generate.php"
click node_revenue_report "https://github.com/selwintejada/gym-management-system/blob/main/reports/revenue.php"
click node_analytics "https://github.com/selwintejada/gym-management-system/blob/main/analytics/index.php"
click node_audit_logs "https://github.com/selwintejada/gym-management-system/blob/main/audit/index.php"
click node_settings "https://github.com/selwintejada/gym-management-system/blob/main/settings/index.php"
click node_database "https://github.com/selwintejada/gym-management-system/blob/main/config/database.php"

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_dashboard,node_app_config,node_auth,node_shared_ui,node_database toneBlue
class node_member_records,node_membership,node_attendance_checkin,node_attendance_history,node_walkins toneAmber
class node_trainers,node_pt_sessions toneMint
class node_payments,node_expenses,node_daily_closing toneRose
class node_report_generation,node_revenue_report,node_analytics,node_audit_logs,node_settings,node_staff_user toneIndigo
```

## Components

### Access and shared runtime

- [Dashboard](https://github.com/selwintejada/gym-management-system/blob/main/dashboard.php): `dashboard.php`
- [Application config](https://github.com/selwintejada/gym-management-system/blob/main/config/config.php): `config/config.php`
- [Authentication](https://github.com/selwintejada/gym-management-system/blob/main/includes/auth.php): `includes/auth.php`
- [Shared navigation](https://github.com/selwintejada/gym-management-system/blob/main/includes/sidebar.php): `includes/sidebar.php`
- [Application database](https://github.com/selwintejada/gym-management-system/blob/main/config/database.php): `config/database.php`

### Members and attendance

- [Member records](https://github.com/selwintejada/gym-management-system/blob/main/members/view.php): `members/view.php`
- [Membership plans](https://github.com/selwintejada/gym-management-system/blob/main/membership/renew.php): `membership/renew.php`
- [Check-in](https://github.com/selwintejada/gym-management-system/blob/main/attendance/checkin.php): `attendance/checkin.php`
- [Attendance history](https://github.com/selwintejada/gym-management-system/blob/main/attendance/index.php): `attendance/index.php`
- [Walk-in customers](https://github.com/selwintejada/gym-management-system/blob/main/walkins/add.php): `walkins/add.php`

### Training services

- [Trainer management](https://github.com/selwintejada/gym-management-system/blob/main/trainers/view.php): `trainers/view.php`
- [PT sessions](https://github.com/selwintejada/gym-management-system/blob/main/pt/sessions.php): `pt/sessions.php`

### Finance operations

- [Payments](https://github.com/selwintejada/gym-management-system/blob/main/payments/create.php): `payments/create.php`
- [Expenses](https://github.com/selwintejada/gym-management-system/blob/main/expenses/edit.php): `expenses/edit.php`
- [Daily closing](https://github.com/selwintejada/gym-management-system/blob/main/daily-closing/close.php): `daily-closing/close.php`

### Reporting and administration

- [Report generation](https://github.com/selwintejada/gym-management-system/blob/main/reports/generate.php): `reports/generate.php`
- [Revenue reporting](https://github.com/selwintejada/gym-management-system/blob/main/reports/revenue.php): `reports/revenue.php`
- [Analytics](https://github.com/selwintejada/gym-management-system/blob/main/analytics/index.php): `analytics/index.php`
- [Audit logs](https://github.com/selwintejada/gym-management-system/blob/main/audit/index.php): `audit/index.php`
- [System settings](https://github.com/selwintejada/gym-management-system/blob/main/settings/index.php): `settings/index.php`

### Other components

- **Staff or owner**

## Connections

- Staff or owner → Dashboard: opens
- Staff or owner → Member records: navigates
- Staff or owner → Check-in: navigates
- Staff or owner → Trainer management: navigates
- Staff or owner → PT sessions: navigates
- Staff or owner → Expenses: navigates
- Staff or owner → Analytics: navigates
- Dashboard → Application config: loads (evidence: `dashboard.php`)
- Application config → Application database: loads (evidence: `config/config.php`)
- Application config → Authentication: loads (evidence: `config/config.php`)
- Member records → Application database: queries
- Check-in → Application database: records check-ins (evidence: `attendance/checkin.php`)
- Attendance history → Application database: reads attendance (evidence: `attendance/index.php`)
- Analytics → Application database: queries metrics (evidence: `analytics/index.php`)
- Expenses → Application database: queries expenses
- Payments → Application database: queries payments
- Membership plans → Application database: updates memberships
- Walk-in customers → Application database: records walk-ins
- Trainer management → Application database: manages trainers
- PT sessions → Application database: manages sessions
- Daily closing → Application database: closes daily totals
- Report generation → Application database: queries report data
- Revenue reporting → Application database: queries revenue
- Audit logs → Application database: reads audit records
- System settings → Application database: manages settings
