# noe-zm28/sca-automatico architecture

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

- Interactive diagram: https://gitdiagram.com/noe-zm28/sca-automatico
- Repository: https://github.com/noe-zm28/sca-automatico

## Overview

This is a Tkinter parking-management system with selectable cashier, entrance, and exit modes. Its user workflow covers vehicle entry, active-ticket lookup and tariff or promotion calculation, payment and exit, with related cashier operations for cuts, reprints, and reports. Separate screens manage pension customers and their payments, users, and system configuration. MariaDB-backed models provide operational and CRUD data; controllers handle configuration, pricing, printing, and email. The README documents these capabilities and JSON configuration, but sampled excerpts do not establish all screen-to-controller call paths, so uncertain wiring is omitted.

Main entry points: [`Models/Model.py`](https://github.com/noe-zm28/sca-automatico/blob/main/Models/Model.py) (Parking operations), [`Controllers/PrinterController.py`](https://github.com/noe-zm28/sca-automatico/blob/main/Controllers/PrinterController.py) (Ticket printing), [`Controllers/ConfigController.py`](https://github.com/noe-zm28/sca-automatico/blob/main/Controllers/ConfigController.py) (JSON configuration), [`main.py`](https://github.com/noe-zm28/sca-automatico/blob/main/main.py) (Mode launcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop workflows"]
  node_launcher["Mode launcher<br/>[main.py]"]
  node_login["System login<br/>[ViewLoginSystem.py]"]
  node_select["System selection"]
  node_cashier["Cashier UI<br/>[ViewCobro.py]"]
  node_entry["Entry UI<br/>[ViewEntrada.py]"]
  node_exit["Exit UI<br/>[ViewSalida.py]"]
  node_auto_entry["Automatic entry"]
  node_auto_exit["Automatic exit"]
  node_pension_ui["Pension screens"]
  node_user_ui["User screens"]
  node_config_ui["Configuration screens<br/>[ViewPanelConfig.py]"]
  node_paid_ui["Pension payments<br/>[ViewPaidPension.py]"]
end

subgraph group_ops["Parking operations"]
  node_tariffs["Tariff calculation<br/>[CobroController.py]"]
  node_tools["Shared utilities<br/>[Tools.py]"]
end

subgraph group_data["Data and configuration"]
  node_operations["Parking operations<br/>[Model.py]"]
  node_queries["Pension and user queries<br/>[Queries.py]"]
  node_database[("MariaDB<br/>[db_base.sql]")]
  node_config["JSON configuration"]
end

subgraph group_services["Output services"]
  node_printer["Ticket printing"]
  node_email["Email delivery<br/>[EmailController.py]"]
end

node_operator(("Operator"))
node_smtp["SMTP server"]

node_operator -->|"starts"| node_launcher
node_launcher -->|"reads mode"| node_config
node_launcher -->|"loads cashier"| node_login
node_launcher -->|"loads entry"| node_entry
node_launcher -->|"loads exit"| node_exit
node_operator -->|"uses"| node_cashier
node_operator -->|"uses"| node_entry
node_operator -->|"uses"| node_exit
node_operator -->|"manages"| node_pension_ui
node_operator -->|"manages"| node_user_ui
node_operator -->|"configures"| node_config_ui
node_operator -->|"reviews payments"| node_paid_ui
node_operator -->|"selects mode"| node_select
node_entry -->|"records entry"| node_operations
node_entry -.->|"prints ticket"| node_printer
node_exit -->|"reads vehicle"| node_operations
node_cashier -->|"queries and updates"| node_operations
node_cashier -->|"calculates charge"| node_tariffs
node_cashier -->|"prints receipts"| node_printer
node_cashier -.->|"sends reports"| node_email
node_tariffs -->|"reads rates"| node_config
node_auto_entry -->|"records entry"| node_operations
node_auto_entry -->|"prints ticket"| node_printer
node_auto_exit -.->|"records exit"| node_operations
node_pension_ui -->|"manages records"| node_queries
node_pension_ui -->|"prints QR"| node_printer
node_paid_ui -->|"reads payments"| node_queries
node_user_ui -.->|"manages users"| node_queries
node_config_ui -.->|"updates settings"| node_config
node_operations -->|"reads DB settings"| node_config
node_queries -->|"uses operations"| node_operations
node_operations -->|"reads and writes"| node_database
node_queries -->|"queries records"| node_database
node_printer -->|"reads printer settings"| node_config
node_printer -->|"records RFID"| node_operations
node_email -->|"sends mail"| node_smtp
node_email -->|"reads mail settings"| node_config
node_printer -->|"uses utilities"| node_tools
node_email -->|"uses utilities"| node_tools

click node_launcher "https://github.com/noe-zm28/sca-automatico/blob/main/main.py"
click node_login "https://github.com/noe-zm28/sca-automatico/blob/main/Views/ViewLoginSystem.py"
click node_select "https://github.com/noe-zm28/sca-automatico/blob/main/Views/ViewSelectSystem.py"
click node_cashier "https://github.com/noe-zm28/sca-automatico/blob/main/Views/ViewCobro.py"
click node_entry "https://github.com/noe-zm28/sca-automatico/blob/main/Views/ViewEntrada.py"
click node_exit "https://github.com/noe-zm28/sca-automatico/blob/main/Views/ViewSalida.py"
click node_auto_entry "https://github.com/noe-zm28/sca-automatico/blob/main/Review/ViewEntradaAutomatica.py"
click node_auto_exit "https://github.com/noe-zm28/sca-automatico/blob/main/Review/ViewSalidaAutomatica.py"
click node_pension_ui "https://github.com/noe-zm28/sca-automatico/blob/main/Views/ViewAgregarPensionado.py"
click node_user_ui "https://github.com/noe-zm28/sca-automatico/blob/main/Views/ViewCrudUsuariosTpv.py"
click node_config_ui "https://github.com/noe-zm28/sca-automatico/blob/main/Views/ViewPanelConfig.py"
click node_paid_ui "https://github.com/noe-zm28/sca-automatico/blob/main/Views/ViewPaidPension.py"
click node_tariffs "https://github.com/noe-zm28/sca-automatico/blob/main/Controllers/CobroController.py"
click node_operations "https://github.com/noe-zm28/sca-automatico/blob/main/Models/Model.py"
click node_queries "https://github.com/noe-zm28/sca-automatico/blob/main/Models/Queries.py"
click node_database "https://github.com/noe-zm28/sca-automatico/blob/main/DB/db_base.sql"
click node_config "https://github.com/noe-zm28/sca-automatico/blob/main/Controllers/ConfigController.py"
click node_printer "https://github.com/noe-zm28/sca-automatico/blob/main/Controllers/PrinterController.py"
click node_email "https://github.com/noe-zm28/sca-automatico/blob/main/Controllers/EmailController.py"
click node_tools "https://github.com/noe-zm28/sca-automatico/blob/main/Tools/Tools.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_launcher,node_login,node_select,node_cashier,node_entry,node_exit,node_auto_entry,node_auto_exit,node_pension_ui,node_user_ui,node_config_ui,node_paid_ui toneBlue
class node_tariffs,node_tools toneAmber
class node_operations,node_queries,node_database,node_config,node_smtp toneMint
class node_printer,node_email toneRose
class node_operator toneIndigo
```

## Components

### Desktop workflows

- [Mode launcher](https://github.com/noe-zm28/sca-automatico/blob/main/main.py): `main.py`
- [System login](https://github.com/noe-zm28/sca-automatico/blob/main/Views/ViewLoginSystem.py): `Views/ViewLoginSystem.py`
- [System selection](https://github.com/noe-zm28/sca-automatico/blob/main/Views/ViewSelectSystem.py): `Views/ViewSelectSystem.py`
- [Cashier UI](https://github.com/noe-zm28/sca-automatico/blob/main/Views/ViewCobro.py): `Views/ViewCobro.py`
- [Entry UI](https://github.com/noe-zm28/sca-automatico/blob/main/Views/ViewEntrada.py): `Views/ViewEntrada.py`
- [Exit UI](https://github.com/noe-zm28/sca-automatico/blob/main/Views/ViewSalida.py): `Views/ViewSalida.py`
- [Automatic entry](https://github.com/noe-zm28/sca-automatico/blob/main/Review/ViewEntradaAutomatica.py): `Review/ViewEntradaAutomatica.py`
- [Automatic exit](https://github.com/noe-zm28/sca-automatico/blob/main/Review/ViewSalidaAutomatica.py): `Review/ViewSalidaAutomatica.py`
- [Pension screens](https://github.com/noe-zm28/sca-automatico/blob/main/Views/ViewAgregarPensionado.py): `Views/ViewAgregarPensionado.py`
- [User screens](https://github.com/noe-zm28/sca-automatico/blob/main/Views/ViewCrudUsuariosTpv.py): `Views/ViewCrudUsuariosTpv.py`
- [Configuration screens](https://github.com/noe-zm28/sca-automatico/blob/main/Views/ViewPanelConfig.py): `Views/ViewPanelConfig.py`
- [Pension payments](https://github.com/noe-zm28/sca-automatico/blob/main/Views/ViewPaidPension.py): `Views/ViewPaidPension.py`

### Parking operations

- [Tariff calculation](https://github.com/noe-zm28/sca-automatico/blob/main/Controllers/CobroController.py): `Controllers/CobroController.py`
- [Shared utilities](https://github.com/noe-zm28/sca-automatico/blob/main/Tools/Tools.py): `Tools/Tools.py`

### Data and configuration

- [Parking operations](https://github.com/noe-zm28/sca-automatico/blob/main/Models/Model.py): `Models/Model.py`
- [Pension and user queries](https://github.com/noe-zm28/sca-automatico/blob/main/Models/Queries.py): `Models/Queries.py`
- [MariaDB](https://github.com/noe-zm28/sca-automatico/blob/main/DB/db_base.sql): `DB/db_base.sql`
- [JSON configuration](https://github.com/noe-zm28/sca-automatico/blob/main/Controllers/ConfigController.py): `Controllers/ConfigController.py`

### Output services

- [Ticket printing](https://github.com/noe-zm28/sca-automatico/blob/main/Controllers/PrinterController.py): `Controllers/PrinterController.py`
- [Email delivery](https://github.com/noe-zm28/sca-automatico/blob/main/Controllers/EmailController.py): `Controllers/EmailController.py`

### Other components

- **Operator**
- **SMTP server**

## Connections

- Operator → Mode launcher: starts
- Mode launcher → JSON configuration: reads mode
- Mode launcher → System login: loads cashier
- Mode launcher → Entry UI: loads entry
- Mode launcher → Exit UI: loads exit
- Operator → Cashier UI: uses
- Operator → Entry UI: uses
- Operator → Exit UI: uses
- Operator → Pension screens: manages
- Operator → User screens: manages
- Operator → Configuration screens: configures
- Operator → Pension payments: reviews payments
- Operator → System selection: selects mode
- Entry UI → Parking operations: records entry
- Entry UI → Ticket printing: prints ticket
- Exit UI → Parking operations: reads vehicle
- Cashier UI → Parking operations: queries and updates
- Cashier UI → Tariff calculation: calculates charge
- Cashier UI → Ticket printing: prints receipts
- Cashier UI → Email delivery: sends reports
- Tariff calculation → JSON configuration: reads rates
- Automatic entry → Parking operations: records entry
- Automatic entry → Ticket printing: prints ticket
- Automatic exit → Parking operations: records exit
- Pension screens → Pension and user queries: manages records
- Pension screens → Ticket printing: prints QR
- Pension payments → Pension and user queries: reads payments
- User screens → Pension and user queries: manages users
- Configuration screens → JSON configuration: updates settings
- Parking operations → JSON configuration: reads DB settings
- Pension and user queries → Parking operations: uses operations
- Parking operations → MariaDB: reads and writes
- Pension and user queries → MariaDB: queries records
- Ticket printing → JSON configuration: reads printer settings
- Ticket printing → Parking operations: records RFID
- Email delivery → SMTP server: sends mail
- Email delivery → JSON configuration: reads mail settings
- Ticket printing → Shared utilities: uses utilities
- Email delivery → Shared utilities: uses utilities
