# sdrot1951/gymmtz architecture

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

- Interactive diagram: https://gitdiagram.com/sdrot1951/gymmtz
- Repository: https://github.com/sdrot1951/gymmtz

## Overview

#### Purpose and solution shape
GymMTZ is a desktop gym-management system covering customers, memberships/access, point-of-sale, inventory, purchasing, cash operations, expenses, and staff. The Visual Studio solution is `GYMMTZ.sln`, organized into WinForms UI, business logic, data access, entity, and utility projects.

#### Application entry and UI shell
The Windows Forms process starts at `GYMMTZ/Program.cs`. Login and biometric-login forms establish user access before the main navigation shell at `GYMMTZ/FrmMenuPrincipal.cs`. Operational workflows are individual forms rather than a web/API interface.
- `GYMMTZ/FrmLogin.cs`
- `GYMMTZ/FrmLoginBiometrico.cs`
- `GYMMTZ/FrmMenuPrincipal.cs`

#### Layered execution boundary
UI forms invoke domain-specific BLL classes, which mediate operations and delegate persistence to paired DAO classes. Entity classes carry shared domain records across these layers. This is the primary control flow: WinForms event → BLL operation → DAO/database access → entity/result → UI rendering.
- `GymApp.BLL/GymApp.BLL.csproj`
- `GymApp.DAO/GymApp.DAO.csproj`
- `GymApp.Entities/GymApp.Entities.csproj`

#### Customer, membership, and facility access
Customer management, member profiles, membership catalog/renewal dates, payments toward balances, attendance checking, and biometric enrollment form one connected member-lifecycle area. Access checking is a material operational boundary because it can use both customer/member status and biometrics.
- `GYMMTZ/FrmClientes.cs`
- `GYMMTZ/FrmChecador.cs`
- `GymApp.BLL/ClienteBLL.cs`
- `GymApp.BLL/MembresiaBLL.cs`
- `GymApp.BLL/BiometriaBLL.cs`

#### Sales, refunds, and cash control
Retail sales and refunds affect cash operations and likely inventory. Cash closing and daily-close forms provide financial reconciliation boundaries; discounts have a dedicated authorization workflow.
- `GYMMTZ/FrmVenta.cs`
- `GYMMTZ/FrmDevolucion.cs`
- `GYMMTZ/FrmCorteCaja.cs`
- `GymApp.BLL/VentaBLL.cs`
- `GymApp.BLL/CajaBLL.cs`
- `GymApp.BLL/DevolucionesBLL.cs`

#### Inventory and procurement
Product catalog management, stock monitoring, purchases, and purchase orders comprise the supply-side workflow. Inventory operations are centralized behind `InventarioBLL`/`InventarioDAO`, separating stock persistence from UI screens.
- `GYMMTZ/FrmProductos.cs`
- `GYMMTZ/FrmMonitorInventario.cs`
- `GYMMTZ/FrmCompras.cs`
- `GYMMTZ/FrmOrdenCompra.cs`
- `GymApp.BLL/InventarioBLL.cs`
- `GymApp.DAO/InventarioDAO.cs`

#### Persistence, session, and infrastructure
Database connectivity is centralized in `GymApp.DAO/ConexionDB.cs`; all domain DAOs are the persistence boundary. Application configuration is supplied through the WinForms app configuration. Session/user context is held in a shared utility, creating cross-cutting authorization state for UI and business operations. Biometric capabilities imply integration with local biometric hardware/software through the biometric layer, though the specific vendor is not visible in the tree.
- `GymApp.DAO/ConexionDB.cs`
- `GYMMTZ/App.config`
- `GymApp.Utils/SesionGlobal.cs`
- `GymApp.Utils/AccesoDAO.cs`

Main entry points: [`GymApp.BLL/ClienteBLL.cs`](https://github.com/sdrot1951/gymmtz/blob/main/GymApp.BLL/ClienteBLL.cs) (Member lifecycle), [`GYMMTZ/FrmLogin.cs`](https://github.com/sdrot1951/gymmtz/blob/main/GYMMTZ/FrmLogin.cs) (Login & biometric login), [`GYMMTZ/FrmMenuPrincipal.cs`](https://github.com/sdrot1951/gymmtz/blob/main/GYMMTZ/FrmMenuPrincipal.cs) (Main navigation shell), [`GymApp.BLL/VentaBLL.cs`](https://github.com/sdrot1951/gymmtz/blob/main/GymApp.BLL/VentaBLL.cs) (Sales & cash operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["WinForms UI"]
  node_entry(("Application entry<br/>WinForms startup<br/>[Program.cs]"))
  node_authentication["Login &amp; biometric login<br/>access forms<br/>[FrmLogin.cs]"]
  node_menu["Main navigation shell<br/>WinForms shell"]
  node_member_ui["Member &amp; access workflows<br/>WinForms forms<br/>[FrmClientes.cs]"]
  node_sales_ui["Sales, refunds &amp; close<br/>WinForms forms<br/>[FrmVenta.cs]"]
  node_inventory_ui["Inventory &amp; purchasing<br/>WinForms forms<br/>[FrmProductos.cs]"]
end

subgraph group_business["Business layer"]
  node_member_bll["Member lifecycle<br/>BLL services<br/>[ClienteBLL.cs]"]
  node_sales_bll["Sales &amp; cash operations<br/>BLL services<br/>[VentaBLL.cs]"]
  node_inventory_bll["Inventory operations<br/>BLL service<br/>[InventarioBLL.cs]"]
  node_entities["Domain entities<br/>shared records"]
end

subgraph group_persistence["Persistence"]
  node_domain_daos["Domain DAOs<br/>persistence services<br/>[GymApp.DAO.csproj]"]
  node_inventory_dao["Inventory DAO<br/>stock persistence<br/>[InventarioDAO.cs]"]
  node_db_connection["Database connection<br/>connection provider<br/>[ConexionDB.cs]"]
  node_database[("Operational database")]
end

subgraph group_crosscutting["Cross-cutting"]
  node_session["Session &amp; authorization<br/>shared utility<br/>[SesionGlobal.cs]"]
  node_app_config["Application configuration<br/>[App.config]"]
  node_biometric_device{{"Biometric hardware/software<br/>local integration"}}
end

node_entry -->|"starts"| node_authentication
node_authentication -->|"grants access to"| node_menu
node_menu -->|"opens"| node_member_ui
node_menu -->|"opens"| node_sales_ui
node_menu -->|"opens"| node_inventory_ui
node_authentication -->|"establishes"| node_session
node_member_ui -->|"invokes"| node_member_bll
node_sales_ui -->|"invokes"| node_sales_bll
node_inventory_ui -->|"invokes"| node_inventory_bll
node_member_bll -->|"persists through"| node_domain_daos
node_sales_bll -->|"persists through"| node_domain_daos
node_inventory_bll -->|"manages stock through"| node_inventory_dao
node_member_bll -->|"uses"| node_entities
node_sales_bll -->|"uses"| node_entities
node_inventory_bll -->|"uses"| node_entities
node_domain_daos -->|"uses"| node_db_connection
node_inventory_dao -->|"uses"| node_db_connection
node_db_connection -->|"connects to"| node_database
node_app_config -.->|"supplies settings"| node_db_connection
node_session -.->|"authorizes operations"| node_member_bll
node_session -.->|"authorizes operations"| node_sales_bll
node_member_bll -->|"enrolls and checks"| node_biometric_device
node_authentication -->|"supports biometric login"| node_biometric_device

click node_entry "https://github.com/sdrot1951/gymmtz/blob/main/GYMMTZ/Program.cs"
click node_authentication "https://github.com/sdrot1951/gymmtz/blob/main/GYMMTZ/FrmLogin.cs"
click node_menu "https://github.com/sdrot1951/gymmtz/blob/main/GYMMTZ/FrmMenuPrincipal.cs"
click node_member_ui "https://github.com/sdrot1951/gymmtz/blob/main/GYMMTZ/FrmClientes.cs"
click node_sales_ui "https://github.com/sdrot1951/gymmtz/blob/main/GYMMTZ/FrmVenta.cs"
click node_inventory_ui "https://github.com/sdrot1951/gymmtz/blob/main/GYMMTZ/FrmProductos.cs"
click node_member_bll "https://github.com/sdrot1951/gymmtz/blob/main/GymApp.BLL/ClienteBLL.cs"
click node_sales_bll "https://github.com/sdrot1951/gymmtz/blob/main/GymApp.BLL/VentaBLL.cs"
click node_inventory_bll "https://github.com/sdrot1951/gymmtz/blob/main/GymApp.BLL/InventarioBLL.cs"
click node_entities "https://github.com/sdrot1951/gymmtz/blob/main/GymApp.Entities/GymApp.Entities.csproj"
click node_domain_daos "https://github.com/sdrot1951/gymmtz/blob/main/GymApp.DAO/GymApp.DAO.csproj"
click node_inventory_dao "https://github.com/sdrot1951/gymmtz/blob/main/GymApp.DAO/InventarioDAO.cs"
click node_db_connection "https://github.com/sdrot1951/gymmtz/blob/main/GymApp.DAO/ConexionDB.cs"
click node_session "https://github.com/sdrot1951/gymmtz/blob/main/GymApp.Utils/SesionGlobal.cs"
click node_app_config "https://github.com/sdrot1951/gymmtz/blob/main/GYMMTZ/App.config"

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_entry,node_authentication,node_menu,node_member_ui,node_sales_ui,node_inventory_ui toneBlue
class node_member_bll,node_sales_bll,node_inventory_bll,node_entities toneAmber
class node_domain_daos,node_inventory_dao,node_db_connection,node_database toneMint
class node_session,node_app_config,node_biometric_device toneRose
```

## Components

### WinForms UI

Desktop forms and navigation.

- [Application entry](https://github.com/sdrot1951/gymmtz/blob/main/GYMMTZ/Program.cs): WinForms startup · `GYMMTZ/Program.cs`
- [Login & biometric login](https://github.com/sdrot1951/gymmtz/blob/main/GYMMTZ/FrmLogin.cs): access forms · `GYMMTZ/FrmLogin.cs`
- [Main navigation shell](https://github.com/sdrot1951/gymmtz/blob/main/GYMMTZ/FrmMenuPrincipal.cs): WinForms shell · `GYMMTZ/FrmMenuPrincipal.cs`
- [Member & access workflows](https://github.com/sdrot1951/gymmtz/blob/main/GYMMTZ/FrmClientes.cs): WinForms forms · Customer management and attendance checking. · `GYMMTZ/FrmClientes.cs`
- [Sales, refunds & close](https://github.com/sdrot1951/gymmtz/blob/main/GYMMTZ/FrmVenta.cs): WinForms forms · POS, returns, and cash-close workflows. · `GYMMTZ/FrmVenta.cs`
- [Inventory & purchasing](https://github.com/sdrot1951/gymmtz/blob/main/GYMMTZ/FrmProductos.cs): WinForms forms · Products, stock monitoring, purchases, and orders. · `GYMMTZ/FrmProductos.cs`

### Business layer

Domain operations and rules.

- [Member lifecycle](https://github.com/sdrot1951/gymmtz/blob/main/GymApp.BLL/ClienteBLL.cs): BLL services · Customers, memberships, and biometrics. · `GymApp.BLL/ClienteBLL.cs`
- [Sales & cash operations](https://github.com/sdrot1951/gymmtz/blob/main/GymApp.BLL/VentaBLL.cs): BLL services · Sales, refunds, and cash control. · `GymApp.BLL/VentaBLL.cs`
- [Inventory operations](https://github.com/sdrot1951/gymmtz/blob/main/GymApp.BLL/InventarioBLL.cs): BLL service · `GymApp.BLL/InventarioBLL.cs`
- [Domain entities](https://github.com/sdrot1951/gymmtz/blob/main/GymApp.Entities/GymApp.Entities.csproj): shared records · Records exchanged between UI, BLL, and DAOs. · `GymApp.Entities/GymApp.Entities.csproj`

### Persistence

DAO and database boundary.

- [Domain DAOs](https://github.com/sdrot1951/gymmtz/blob/main/GymApp.DAO/GymApp.DAO.csproj): persistence services · Paired data access implementations for business domains. · `GymApp.DAO/GymApp.DAO.csproj`
- [Inventory DAO](https://github.com/sdrot1951/gymmtz/blob/main/GymApp.DAO/InventarioDAO.cs): stock persistence · `GymApp.DAO/InventarioDAO.cs`
- [Database connection](https://github.com/sdrot1951/gymmtz/blob/main/GymApp.DAO/ConexionDB.cs): connection provider · `GymApp.DAO/ConexionDB.cs`
- **Operational database**: database

### Cross-cutting

Session, configuration, and device integration.

- [Session & authorization](https://github.com/sdrot1951/gymmtz/blob/main/GymApp.Utils/SesionGlobal.cs): shared utility · Holds current user context and access state. · `GymApp.Utils/SesionGlobal.cs`
- [Application configuration](https://github.com/sdrot1951/gymmtz/blob/main/GYMMTZ/App.config): configuration · `GYMMTZ/App.config`
- **Biometric hardware/software**: local integration · Vendor-specific integration is not visible.

## Connections

- Application entry → Login & biometric login: starts
- Login & biometric login → Main navigation shell: grants access to
- Main navigation shell → Member & access workflows: opens
- Main navigation shell → Sales, refunds & close: opens
- Main navigation shell → Inventory & purchasing: opens
- Login & biometric login → Session & authorization: establishes
- Member & access workflows → Member lifecycle: invokes
- Sales, refunds & close → Sales & cash operations: invokes
- Inventory & purchasing → Inventory operations: invokes
- Member lifecycle → Domain DAOs: persists through
- Sales & cash operations → Domain DAOs: persists through
- Inventory operations → Inventory DAO: manages stock through
- Member lifecycle → Domain entities: uses
- Sales & cash operations → Domain entities: uses
- Inventory operations → Domain entities: uses
- Domain DAOs → Database connection: uses
- Inventory DAO → Database connection: uses
- Database connection → Operational database: connects to
- Application configuration → Database connection: supplies settings
- Session & authorization → Member lifecycle: authorizes operations
- Session & authorization → Sales & cash operations: authorizes operations
- Member lifecycle → Biometric hardware/software: enrolls and checks
- Login & biometric login → Biometric hardware/software: supports biometric login
