# rocderik123-cmyk/gymflow architecture

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

- Interactive diagram: https://gitdiagram.com/rocderik123-cmyk/gymflow
- Repository: https://github.com/rocderik123-cmyk/gymflow

## Overview

GymFlow is a Django gym-management prototype. GymUsers register and confirm accounts, browse machine tutorials, follow trainer-assigned routines, and record progress; trainers create routines and review client progress, while GymEspacio users manage a Pro membership with simulated payment. The graph separates these domain capabilities from shared account, security, and data layers. README and sampled source support the main flows; several capabilities share core/views.py, and unsampled wiring is not inferred.

Main entry points: [`core/urls.py`](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/urls.py) (URL routing), [`core/admin.py`](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/admin.py) (Admin management), [`core/views.py`](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/views.py) (Registration & login), [`core/security.py`](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/security.py) (Security audit log)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accounts["Accounts &amp; access"]
  node_routes["URL routing<br/>[urls.py]"]
  node_account_views["Registration &amp; login<br/>[views.py]"]
  node_account_forms["Account forms<br/>[forms.py]"]
  node_user_data[("User profiles<br/>[models.py]")]
end

subgraph group_training["Training workflows"]
  node_tutorials["Machine tutorials<br/>[views.py]"]
  node_machine_data[("Machines &amp; exercises<br/>[models.py]")]
  node_routine_views["Routine assignment<br/>[views.py]"]
  node_routine_forms["Routine forms<br/>[forms.py]"]
  node_routine_data[("Routines &amp; items<br/>[models.py]")]
  node_notifications[("User notifications<br/>[models.py]")]
  node_progress_views["Progress tracking<br/>[views.py]"]
  node_progress_forms["Progress form<br/>[forms.py]"]
  node_progress_data[("Progress records<br/>[models.py]")]
  node_client_review["Trainer client review<br/>[views.py]"]
end

subgraph group_membership["GymEspacio Pro"]
  node_pro_views["Pro membership &amp; payment<br/>[views.py]"]
  node_subscription_data[("Subscriptions<br/>[models.py]")]
end

subgraph group_shared["Shared domain &amp; security"]
  node_video_validation["Video URL validation<br/>[validators.py]"]
  node_role_access["Role-based access<br/>[decorators.py]"]
  node_audit["Security audit log<br/>[security.py]"]
  node_audit_data[("Audit records<br/>[models.py]")]
  node_encrypted_fields["Encrypted profile fields<br/>[fields.py]"]
  node_templates["Page templates"]
  node_admin["Admin management<br/>[admin.py]"]
end

node_user(("GymFlow user"))
node_email["Email delivery"]

node_user -->|"requests pages"| node_routes
node_routes -->|"routes requests"| node_account_views
node_routes -->|"routes requests"| node_tutorials
node_routes -->|"routes requests"| node_routine_views
node_routes -->|"routes requests"| node_progress_views
node_routes -->|"routes requests"| node_client_review
node_routes -->|"routes requests"| node_pro_views
node_account_views -->|"validates with"| node_account_forms
node_account_views -->|"creates users"| node_user_data
node_account_views -->|"sends confirmation"| node_email
node_account_views -->|"records events"| node_audit
node_tutorials -->|"reads machines"| node_machine_data
node_tutorials -->|"uses embed URL"| node_video_validation
node_routine_views -->|"validates with"| node_routine_forms
node_routine_views -->|"creates and reads"| node_routine_data
node_routine_views -->|"creates notification"| node_notifications
node_routine_views -->|"records events"| node_audit
node_progress_views -->|"validates with"| node_progress_forms
node_progress_views -->|"checks assigned item"| node_routine_data
node_progress_views -->|"creates and reads"| node_progress_data
node_client_review -->|"reads records"| node_progress_data
node_client_review -->|"filters clients"| node_user_data
node_pro_views -->|"creates and updates"| node_subscription_data
node_pro_views -->|"records events"| node_audit
node_account_views -->|"renders pages"| node_templates
node_tutorials -->|"renders pages"| node_templates
node_routine_views -->|"renders pages"| node_templates
node_progress_views -->|"renders pages"| node_templates
node_pro_views -->|"renders pages"| node_templates
node_role_access -->|"records denials"| node_audit
node_audit -->|"creates records"| node_audit_data
node_user_data -->|"encrypts profile values"| node_encrypted_fields
node_progress_data -.->|"encrypts body weight"| node_encrypted_fields
node_machine_data -->|"validates video URLs"| node_video_validation
node_admin -->|"manages records"| node_user_data
node_admin -->|"manages records"| node_machine_data
node_admin -->|"manages routines"| node_routine_data
node_admin -->|"manages records"| node_subscription_data
node_admin -->|"manages records"| node_progress_data
node_admin -->|"views audit log"| node_audit_data

click node_routes "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/urls.py"
click node_account_views "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/views.py"
click node_account_forms "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/forms.py"
click node_user_data "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/models.py"
click node_tutorials "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/views.py"
click node_machine_data "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/models.py"
click node_video_validation "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/validators.py"
click node_routine_views "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/views.py"
click node_routine_forms "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/forms.py"
click node_routine_data "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/models.py"
click node_notifications "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/models.py"
click node_progress_views "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/views.py"
click node_progress_forms "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/forms.py"
click node_progress_data "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/models.py"
click node_client_review "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/views.py"
click node_pro_views "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/views.py"
click node_subscription_data "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/models.py"
click node_role_access "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/decorators.py"
click node_audit "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/security.py"
click node_audit_data "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/models.py"
click node_encrypted_fields "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/fields.py"
click node_templates "https://github.com/rocderik123-cmyk/gymflow/tree/main/templates"
click node_admin "https://github.com/rocderik123-cmyk/gymflow/blob/main/core/admin.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_routes,node_account_views,node_account_forms,node_user_data,node_user toneBlue
class node_tutorials,node_machine_data,node_routine_views,node_routine_forms,node_routine_data,node_notifications,node_progress_views,node_progress_forms,node_progress_data,node_client_review toneAmber
class node_pro_views,node_subscription_data toneMint
class node_video_validation,node_role_access,node_audit,node_audit_data,node_encrypted_fields,node_templates,node_admin toneRose
class node_email toneIndigo
```

## Components

### Accounts & access

- [URL routing](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/urls.py): `core/urls.py`
- [Registration & login](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/views.py): `core/views.py`
- [Account forms](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/forms.py): `core/forms.py`
- [User profiles](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/models.py): `core/models.py`

### Training workflows

- [Machine tutorials](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/views.py): `core/views.py`
- [Machines & exercises](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/models.py): `core/models.py`
- [Routine assignment](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/views.py): `core/views.py`
- [Routine forms](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/forms.py): `core/forms.py`
- [Routines & items](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/models.py): `core/models.py`
- [User notifications](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/models.py): `core/models.py`
- [Progress tracking](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/views.py): `core/views.py`
- [Progress form](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/forms.py): `core/forms.py`
- [Progress records](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/models.py): `core/models.py`
- [Trainer client review](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/views.py): `core/views.py`

### GymEspacio Pro

- [Pro membership & payment](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/views.py): `core/views.py`
- [Subscriptions](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/models.py): `core/models.py`

### Shared domain & security

- [Video URL validation](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/validators.py): `core/validators.py`
- [Role-based access](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/decorators.py): `core/decorators.py`
- [Security audit log](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/security.py): `core/security.py`
- [Audit records](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/models.py): `core/models.py`
- [Encrypted profile fields](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/fields.py): `core/fields.py`
- [Page templates](https://github.com/rocderik123-cmyk/gymflow/tree/main/templates): `templates`
- [Admin management](https://github.com/rocderik123-cmyk/gymflow/blob/main/core/admin.py): `core/admin.py`

### Other components

- **GymFlow user**
- **Email delivery**

## Connections

- GymFlow user → URL routing: requests pages (evidence: `README.md`)
- URL routing → Registration & login: routes requests (evidence: `core/urls.py`)
- URL routing → Machine tutorials: routes requests (evidence: `core/urls.py`)
- URL routing → Routine assignment: routes requests (evidence: `core/urls.py`)
- URL routing → Progress tracking: routes requests (evidence: `core/urls.py`)
- URL routing → Trainer client review: routes requests (evidence: `core/urls.py`)
- URL routing → Pro membership & payment: routes requests (evidence: `core/urls.py`)
- Registration & login → Account forms: validates with (evidence: `core/views.py`)
- Registration & login → User profiles: creates users (evidence: `core/views.py`)
- Registration & login → Email delivery: sends confirmation (evidence: `core/views.py`)
- Registration & login → Security audit log: records events (evidence: `core/views.py`)
- Machine tutorials → Machines & exercises: reads machines (evidence: `core/views.py`)
- Machine tutorials → Video URL validation: uses embed URL
- Routine assignment → Routine forms: validates with (evidence: `core/views.py`)
- Routine assignment → Routines & items: creates and reads (evidence: `core/views.py`)
- Routine assignment → User notifications: creates notification (evidence: `core/views.py`)
- Routine assignment → Security audit log: records events (evidence: `core/views.py`)
- Progress tracking → Progress form: validates with (evidence: `core/views.py`)
- Progress tracking → Routines & items: checks assigned item (evidence: `core/views.py`)
- Progress tracking → Progress records: creates and reads (evidence: `core/views.py`)
- Trainer client review → Progress records: reads records (evidence: `core/views.py`)
- Trainer client review → User profiles: filters clients (evidence: `core/views.py`)
- Pro membership & payment → Subscriptions: creates and updates (evidence: `core/views.py`)
- Pro membership & payment → Security audit log: records events (evidence: `core/views.py`)
- Registration & login → Page templates: renders pages (evidence: `core/views.py`)
- Machine tutorials → Page templates: renders pages (evidence: `core/views.py`)
- Routine assignment → Page templates: renders pages (evidence: `core/views.py`)
- Progress tracking → Page templates: renders pages (evidence: `core/views.py`)
- Pro membership & payment → Page templates: renders pages (evidence: `core/views.py`)
- Role-based access → Security audit log: records denials (evidence: `core/decorators.py`)
- Security audit log → Audit records: creates records (evidence: `core/security.py`)
- User profiles → Encrypted profile fields: encrypts profile values (evidence: `core/models.py`)
- Progress records → Encrypted profile fields: encrypts body weight (evidence: `core/models.py`)
- Machines & exercises → Video URL validation: validates video URLs (evidence: `core/models.py`)
- Admin management → User profiles: manages records (evidence: `core/admin.py`)
- Admin management → Machines & exercises: manages records (evidence: `core/admin.py`)
- Admin management → Routines & items: manages routines (evidence: `core/admin.py`)
- Admin management → Subscriptions: manages records (evidence: `core/admin.py`)
- Admin management → Progress records: manages records (evidence: `core/admin.py`)
- Admin management → Audit records: views audit log (evidence: `core/admin.py`)
