# pesterian/mti-database architecture

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

- Interactive diagram: https://gitdiagram.com/pesterian/mti-database
- Repository: https://github.com/pesterian/mti-database

## Overview

Repair Management is a Tkinter desktop application for maintaining customer, device, repair-shop, supplier, module, repair, and payment records in SQL Server. The user opens a section from the main menu; its configured window uses shared CRUD forms for listing, validating, and saving records. Device, repair, and payment choices are selected through database-backed forms, while supplier and repair sections also manage module associations. The excerpts show the shared UI-to-database boundary; entity modules are represented by their documented configuration and entry-point roles.

Main entry points: [`main.py`](https://github.com/pesterian/mti-database/blob/main/main.py) (Main menu), [`ui_common.py`](https://github.com/pesterian/mti-database/blob/main/ui_common.py) (CRUD windows), [`database.py`](https://github.com/pesterian/mti-database/blob/main/database.py) (Database helpers), [`suppliers.py`](https://github.com/pesterian/mti-database/blob/main/suppliers.py) (Module suppliers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop interface"]
  node_menu["Main menu<br/>[main.py]"]
end

subgraph group_records["Management sections"]
  node_customers["Customers<br/>[customers.py]"]
  node_devices["Devices<br/>[devices.py]"]
  node_shops["Repair shops<br/>[repair_shops.py]"]
  node_suppliers["Module suppliers<br/>[suppliers.py]"]
  node_modules["Modules<br/>[modules.py]"]
  node_repairs["Repairs<br/>[repairs.py]"]
  node_payments["Payments<br/>[payments.py]"]
end

subgraph group_shared["Shared workflows"]
  node_crud["CRUD windows<br/>[ui_common.py]"]
  node_forms["Forms and validation<br/>[ui_common.py]"]
  node_associations["Module associations<br/>[ui_common.py]"]
end

subgraph group_persistence["Persistence"]
  node_db_helpers["Database helpers<br/>[database.py]"]
  node_sqlserver[("SQL Server")]
  node_schema["Database schema"]
end

node_user(("User"))

node_user -->|"opens"| node_menu
node_menu -->|"opens section"| node_customers
node_menu -->|"opens section"| node_devices
node_menu -->|"opens section"| node_shops
node_menu -->|"opens section"| node_suppliers
node_menu -->|"opens section"| node_modules
node_menu -->|"opens section"| node_repairs
node_menu -->|"opens section"| node_payments
node_customers -->|"configures"| node_crud
node_devices -->|"configures"| node_crud
node_shops -->|"configures"| node_crud
node_suppliers -->|"configures"| node_crud
node_modules -->|"configures"| node_crud
node_repairs -->|"configures"| node_crud
node_payments -->|"configures"| node_crud
node_crud -->|"opens"| node_forms
node_suppliers -->|"enables"| node_associations
node_repairs -->|"enables"| node_associations
node_crud -->|"loads records"| node_db_helpers
node_forms -->|"reads and saves"| node_db_helpers
node_associations -->|"reads and updates"| node_db_helpers
node_db_helpers -->|"connects"| node_sqlserver
node_schema -->|"creates tables"| node_sqlserver

click node_menu "https://github.com/pesterian/mti-database/blob/main/main.py"
click node_customers "https://github.com/pesterian/mti-database/blob/main/customers.py"
click node_devices "https://github.com/pesterian/mti-database/blob/main/devices.py"
click node_shops "https://github.com/pesterian/mti-database/blob/main/repair_shops.py"
click node_suppliers "https://github.com/pesterian/mti-database/blob/main/suppliers.py"
click node_modules "https://github.com/pesterian/mti-database/blob/main/modules.py"
click node_repairs "https://github.com/pesterian/mti-database/blob/main/repairs.py"
click node_payments "https://github.com/pesterian/mti-database/blob/main/payments.py"
click node_crud "https://github.com/pesterian/mti-database/blob/main/ui_common.py"
click node_forms "https://github.com/pesterian/mti-database/blob/main/ui_common.py"
click node_associations "https://github.com/pesterian/mti-database/blob/main/ui_common.py"
click node_db_helpers "https://github.com/pesterian/mti-database/blob/main/database.py"
click node_schema "https://github.com/pesterian/mti-database/blob/main/sql/create_database.sql"

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_menu,node_user toneBlue
class node_customers,node_devices,node_shops,node_suppliers,node_modules,node_repairs,node_payments toneAmber
class node_crud,node_forms,node_associations toneMint
class node_db_helpers,node_sqlserver,node_schema toneRose
```

## Components

### Desktop interface

- [Main menu](https://github.com/pesterian/mti-database/blob/main/main.py): `main.py`

### Management sections

- [Customers](https://github.com/pesterian/mti-database/blob/main/customers.py): `customers.py`
- [Devices](https://github.com/pesterian/mti-database/blob/main/devices.py): `devices.py`
- [Repair shops](https://github.com/pesterian/mti-database/blob/main/repair_shops.py): `repair_shops.py`
- [Module suppliers](https://github.com/pesterian/mti-database/blob/main/suppliers.py): `suppliers.py`
- [Modules](https://github.com/pesterian/mti-database/blob/main/modules.py): `modules.py`
- [Repairs](https://github.com/pesterian/mti-database/blob/main/repairs.py): `repairs.py`
- [Payments](https://github.com/pesterian/mti-database/blob/main/payments.py): `payments.py`

### Shared workflows

- [CRUD windows](https://github.com/pesterian/mti-database/blob/main/ui_common.py): `ui_common.py`
- [Forms and validation](https://github.com/pesterian/mti-database/blob/main/ui_common.py): `ui_common.py`
- [Module associations](https://github.com/pesterian/mti-database/blob/main/ui_common.py): `ui_common.py`

### Persistence

- [Database helpers](https://github.com/pesterian/mti-database/blob/main/database.py): `database.py`
- **SQL Server**
- [Database schema](https://github.com/pesterian/mti-database/blob/main/sql/create_database.sql): `sql/create_database.sql`

### Other components

- **User**

## Connections

- User → Main menu: opens (evidence: `main.py`)
- Main menu → Customers: opens section (evidence: `main.py`)
- Main menu → Devices: opens section (evidence: `main.py`)
- Main menu → Repair shops: opens section (evidence: `main.py`)
- Main menu → Module suppliers: opens section (evidence: `main.py`)
- Main menu → Modules: opens section (evidence: `main.py`)
- Main menu → Repairs: opens section (evidence: `main.py`)
- Main menu → Payments: opens section (evidence: `main.py`)
- Customers → CRUD windows: configures (evidence: `customers.py`)
- Devices → CRUD windows: configures (evidence: `devices.py`)
- Repair shops → CRUD windows: configures (evidence: `repair_shops.py`)
- Module suppliers → CRUD windows: configures (evidence: `suppliers.py`)
- Modules → CRUD windows: configures (evidence: `modules.py`)
- Repairs → CRUD windows: configures (evidence: `repairs.py`)
- Payments → CRUD windows: configures (evidence: `payments.py`)
- CRUD windows → Forms and validation: opens (evidence: `ui_common.py`)
- Module suppliers → Module associations: enables (evidence: `suppliers.py`)
- Repairs → Module associations: enables (evidence: `repairs.py`)
- CRUD windows → Database helpers: loads records (evidence: `ui_common.py`)
- Forms and validation → Database helpers: reads and saves (evidence: `ui_common.py`)
- Module associations → Database helpers: reads and updates (evidence: `ui_common.py`)
- Database helpers → SQL Server: connects (evidence: `README.md`)
- Database schema → SQL Server: creates tables (evidence: `README.md`)
