# robson-m/system-gym architecture

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

- Interactive diagram: https://gitdiagram.com/robson-m/system-gym
- Repository: https://github.com/robson-m/system-gym

## Overview

This is a Rails gym-management application: its routes expose student, payment, plan, gym, account, settings, turnstile, and statistics workflows. The clearest sampled workflow is creating a student, recording an initial payment, and running a due-date check. Student and payment records are persisted through Active Record, with plans supporting both workflows. The map preserves documented route branches and sampled browser behavior; controller internals for several routes and views were not provided, so those connections are limited to route dispatch.

Main entry points: [`config/routes.rb`](https://github.com/robson-m/system-gym/blob/main/config/routes.rb) (Rails routes), [`app/controllers/students_controller.rb`](https://github.com/robson-m/system-gym/blob/main/app/controllers/students_controller.rb) (Student management), [`app/controllers/payments_controller.rb`](https://github.com/robson-m/system-gym/blob/main/app/controllers/payments_controller.rb) (Payment management), [`app/models/plan.rb`](https://github.com/robson-m/system-gym/blob/main/app/models/plan.rb) (Plan records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_routes["Rails routes<br/>[routes.rb]"]
end

subgraph group_operations["Gym operations"]
  node_students["Student management"]
  node_payments["Payment management"]
  node_plans["Plan management"]
  node_turnstiles["Turnstiles"]
  node_due_dates["Due-date check"]
end

subgraph group_accounts["Accounts and insights"]
  node_gyms["Gym settings<br/>[gyms_controller.rb]"]
  node_settings["Settings"]
  node_statistics["Statistics"]
  node_users["User administration"]
  node_registrations["Account registration"]
end

subgraph group_persistence["Domain records"]
  node_student_record["Student records<br/>[student.rb]"]
  node_payment_record["Payment records<br/>[payment.rb]"]
  node_plan_record["Plan records<br/>[plan.rb]"]
  node_gym_record["Gym records<br/>[gym.rb]"]
  node_user_record["User records<br/>[user.rb]"]
end

subgraph group_browser["Browser interactions"]
  node_filter_ui["Student list filters"]
  node_search_ui["Search submission"]
end

node_visitor(("Web user"))

node_visitor -->|"requests pages"| node_routes
node_routes -->|"routes root"| node_students
node_routes -->|"routes nested payments"| node_payments
node_routes -->|"routes plans"| node_plans
node_routes -->|"routes gyms"| node_gyms
node_routes -->|"routes settings"| node_settings
node_routes -->|"routes statistics"| node_statistics
node_routes -->|"routes turnstiles"| node_turnstiles
node_routes -->|"routes users"| node_users
node_routes -->|"routes registration"| node_registrations
node_students -->|"queries and saves"| node_student_record
node_students -->|"creates initial payment"| node_payment_record
node_students -->|"loads plans"| node_plan_record
node_students -->|"runs check"| node_due_dates
node_payments -->|"builds and updates"| node_payment_record
node_payments -->|"loads student"| node_student_record
node_payments -->|"loads plans"| node_plan_record
node_plans -->|"creates and updates"| node_plan_record

click node_routes "https://github.com/robson-m/system-gym/blob/main/config/routes.rb"
click node_students "https://github.com/robson-m/system-gym/blob/main/app/controllers/students_controller.rb"
click node_payments "https://github.com/robson-m/system-gym/blob/main/app/controllers/payments_controller.rb"
click node_plans "https://github.com/robson-m/system-gym/blob/main/app/controllers/plans_controller.rb"
click node_gyms "https://github.com/robson-m/system-gym/blob/main/app/controllers/gyms_controller.rb"
click node_settings "https://github.com/robson-m/system-gym/blob/main/app/controllers/settings_controller.rb"
click node_statistics "https://github.com/robson-m/system-gym/blob/main/app/controllers/statistics_controller.rb"
click node_turnstiles "https://github.com/robson-m/system-gym/blob/main/app/controllers/turnstiles_controller.rb"
click node_users "https://github.com/robson-m/system-gym/blob/main/app/controllers/users_controller.rb"
click node_registrations "https://github.com/robson-m/system-gym/blob/main/app/controllers/users/registrations_controller.rb"
click node_student_record "https://github.com/robson-m/system-gym/blob/main/app/models/student.rb"
click node_payment_record "https://github.com/robson-m/system-gym/blob/main/app/models/payment.rb"
click node_plan_record "https://github.com/robson-m/system-gym/blob/main/app/models/plan.rb"
click node_gym_record "https://github.com/robson-m/system-gym/blob/main/app/models/gym.rb"
click node_user_record "https://github.com/robson-m/system-gym/blob/main/app/models/user.rb"
click node_due_dates "https://github.com/robson-m/system-gym/blob/main/app/jobs/check_due_dates_job.rb"
click node_filter_ui "https://github.com/robson-m/system-gym/blob/main/app/javascript/controllers/filter_controller.js"
click node_search_ui "https://github.com/robson-m/system-gym/blob/main/app/javascript/controllers/search_controller.js"

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_routes,node_visitor toneBlue
class node_students,node_payments,node_plans,node_turnstiles,node_due_dates toneAmber
class node_gyms,node_settings,node_statistics,node_users,node_registrations toneMint
class node_student_record,node_payment_record,node_plan_record,node_gym_record,node_user_record toneRose
class node_filter_ui,node_search_ui toneIndigo
```

## Components

### Web entry

- [Rails routes](https://github.com/robson-m/system-gym/blob/main/config/routes.rb): `config/routes.rb`

### Gym operations

- [Student management](https://github.com/robson-m/system-gym/blob/main/app/controllers/students_controller.rb): `app/controllers/students_controller.rb`
- [Payment management](https://github.com/robson-m/system-gym/blob/main/app/controllers/payments_controller.rb): `app/controllers/payments_controller.rb`
- [Plan management](https://github.com/robson-m/system-gym/blob/main/app/controllers/plans_controller.rb): `app/controllers/plans_controller.rb`
- [Turnstiles](https://github.com/robson-m/system-gym/blob/main/app/controllers/turnstiles_controller.rb): `app/controllers/turnstiles_controller.rb`
- [Due-date check](https://github.com/robson-m/system-gym/blob/main/app/jobs/check_due_dates_job.rb): `app/jobs/check_due_dates_job.rb`

### Accounts and insights

- [Gym settings](https://github.com/robson-m/system-gym/blob/main/app/controllers/gyms_controller.rb): `app/controllers/gyms_controller.rb`
- [Settings](https://github.com/robson-m/system-gym/blob/main/app/controllers/settings_controller.rb): `app/controllers/settings_controller.rb`
- [Statistics](https://github.com/robson-m/system-gym/blob/main/app/controllers/statistics_controller.rb): `app/controllers/statistics_controller.rb`
- [User administration](https://github.com/robson-m/system-gym/blob/main/app/controllers/users_controller.rb): `app/controllers/users_controller.rb`
- [Account registration](https://github.com/robson-m/system-gym/blob/main/app/controllers/users/registrations_controller.rb): `app/controllers/users/registrations_controller.rb`

### Domain records

- [Student records](https://github.com/robson-m/system-gym/blob/main/app/models/student.rb): `app/models/student.rb`
- [Payment records](https://github.com/robson-m/system-gym/blob/main/app/models/payment.rb): `app/models/payment.rb`
- [Plan records](https://github.com/robson-m/system-gym/blob/main/app/models/plan.rb): `app/models/plan.rb`
- [Gym records](https://github.com/robson-m/system-gym/blob/main/app/models/gym.rb): `app/models/gym.rb`
- [User records](https://github.com/robson-m/system-gym/blob/main/app/models/user.rb): `app/models/user.rb`

### Browser interactions

- [Student list filters](https://github.com/robson-m/system-gym/blob/main/app/javascript/controllers/filter_controller.js): `app/javascript/controllers/filter_controller.js`
- [Search submission](https://github.com/robson-m/system-gym/blob/main/app/javascript/controllers/search_controller.js): `app/javascript/controllers/search_controller.js`

### Other components

- **Web user**

## Connections

- Web user → Rails routes: requests pages
- Rails routes → Student management: routes root (evidence: `config/routes.rb`)
- Rails routes → Payment management: routes nested payments (evidence: `config/routes.rb`)
- Rails routes → Plan management: routes plans (evidence: `config/routes.rb`)
- Rails routes → Gym settings: routes gyms (evidence: `config/routes.rb`)
- Rails routes → Settings: routes settings (evidence: `config/routes.rb`)
- Rails routes → Statistics: routes statistics (evidence: `config/routes.rb`)
- Rails routes → Turnstiles: routes turnstiles (evidence: `config/routes.rb`)
- Rails routes → User administration: routes users (evidence: `config/routes.rb`)
- Rails routes → Account registration: routes registration (evidence: `config/routes.rb`)
- Student management → Student records: queries and saves (evidence: `app/controllers/students_controller.rb`)
- Student management → Payment records: creates initial payment (evidence: `app/controllers/students_controller.rb`)
- Student management → Plan records: loads plans (evidence: `app/controllers/students_controller.rb`)
- Student management → Due-date check: runs check (evidence: `app/controllers/students_controller.rb`)
- Payment management → Payment records: builds and updates (evidence: `app/controllers/payments_controller.rb`)
- Payment management → Student records: loads student (evidence: `app/controllers/payments_controller.rb`)
- Payment management → Plan records: loads plans (evidence: `app/controllers/payments_controller.rb`)
- Plan management → Plan records: creates and updates (evidence: `app/controllers/plans_controller.rb`)
