# nicolasgomez97/gestion-consultorio-odontologico-passera-unc architecture

> Architecture diagram of the GitHub repository nicolasgomez97/gestion-consultorio-odontologico-passera-unc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc
- Repository: https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc

## Overview

#### Purpose and Entry Points
Desktop dental-clinic management system (“Gestion Consultorio Odontologico”). The application starts from `main.py`, which launches the UI application defined in `ui/app.py`. Persistent clinic data is stored locally in SQLite under `data/clinica.db`.

#### Application Shell and Navigation
`ui/app.py` is the central UI composition and navigation layer. It coordinates feature screens, shared styling, and reusable controls through:
- `ui/app.py`
- `ui/theme.py`
- `ui/widgets.py`

This is a local desktop UI architecture rather than a web service; feature modules own their screen-level interactions.

#### Persistence and Domain Model Boundary
`database.py` provides the database access/initialization boundary, while `models.py` defines the clinic domain entities and their persistence-facing representation. SQLite files, including WAL/SHM companions, indicate local transactional storage with write-ahead logging:
- `database.py`
- `models.py`
- `data/clinica.db`

UI screens should interact with clinic data through these shared model/database layers rather than directly coupling to SQLite files.

#### Identity and Access Management
Authentication and user administration are separated into dedicated UI flows:
- `ui/login_ui.py`
- `ui/usuarios_ui.py`
- `models.py`

Login gates access to the operational application; user management likely maintains staff accounts and roles/credentials in the same local database.

#### Core Clinical and Scheduling Workflows
The primary operational flow centers on patient records, practitioner records, appointments, and billable services:
- `ui/pacientes_ui.py`
- `ui/odontologos_ui.py`
- `ui/turnos_ui.py`
- `ui/prestaciones_ui.py`

Patients and dentists are master data. Appointment (`turnos`) workflows connect those entities over time, while services (`prestaciones`) capture care delivered or offered.

#### Dental Record Modules
Clinical charting is split into specialized odontological record views:
- `ui/odontograma_ui.py`
- `ui/periodontograma_ui.py`
- `ui/historial_ui.py`

These modules form the patient clinical-history boundary: odontograms capture tooth-level status, periodontograms capture periodontal assessment, and history consolidates longitudinal clinical information.

#### Reporting and Notifications
Operational reporting and outbound email are separate integration points:
- `ui/reportes_ui.py`
- `email_service.py`
- `data/email_config.json`

Reports consume locally persisted clinic data. `email_service.py` uses externally configured email settings from `data/email_config.json`, making SMTP/email delivery the main external-service dependency.

#### Runtime and Deployment Characteristics
The repository is a Python desktop application with local filesystem state. There is no indicated server, API, or cloud infrastructure. Runtime-critical assets are:
- `main.py`
- `database.py`
- `data/clinica.db`

The SQLite WAL/SHM files (`data/clinica.db-wal`, `data/clinica.db-shm`) are runtime database artifacts and should be treated as part of local database consistency, not independent application data sources.

Main entry points: [`ui/app.py`](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/app.py) (Application Shell), [`models.py`](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/models.py) (Domain Models), [`ui/reportes_ui.py`](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/reportes_ui.py) (Reports), [`ui/login_ui.py`](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/login_ui.py) (Login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop UI"]
  node_app["Application Shell<br/>UI composition<br/>[app.py]"]
  node_theme["Theme<br/>UI styling<br/>[theme.py]"]
  node_widgets["Shared Widgets<br/>UI controls<br/>[widgets.py]"]
  node_login["Login<br/>access screen<br/>[login_ui.py]"]
  node_users["User Management<br/>admin screen<br/>[usuarios_ui.py]"]
  node_patients["Patients<br/>master-data screen<br/>[pacientes_ui.py]"]
  node_dentists["Dentists<br/>master-data screen<br/>[odontologos_ui.py]"]
  node_appointments["Appointments<br/>scheduling screen<br/>[turnos_ui.py]"]
  node_services["Services<br/>care screen<br/>[prestaciones_ui.py]"]
  node_reports["Reports<br/>reporting screen<br/>[reportes_ui.py]"]
end

subgraph group_clinical["Clinical Records"]
  node_odontogram["Odontogram<br/>clinical chart screen<br/>[odontograma_ui.py]"]
  node_periodontogram["Periodontogram<br/>clinical chart screen"]
  node_history["Clinical History<br/>clinical chart screen<br/>[historial_ui.py]"]
end

subgraph group_storage["Local Persistence"]
  node_database["Database Access<br/>SQLite boundary<br/>[database.py]"]
  node_sqlite[("Clinic Database<br/>SQLite database<br/>[clinica.db]")]
end

node_main(("Application Entry<br/>Python entry point<br/>[main.py]"))
node_models{{"Domain Models<br/>domain and persistence models<br/>[models.py]"}}
node_email["Email Service<br/>SMTP integration<br/>[email_service.py]"]
node_email_config["Email Configuration<br/>SMTP settings<br/>[email_config.json]"]

node_main -->|"launches"| node_app
node_app -->|"uses"| node_theme
node_app -->|"uses"| node_widgets
node_app -->|"shows"| node_login
node_app -->|"navigates to"| node_users
node_app -->|"navigates to"| node_patients
node_app -->|"navigates to"| node_dentists
node_app -->|"navigates to"| node_appointments
node_app -->|"navigates to"| node_services
node_app -->|"navigates to"| node_odontogram
node_app -->|"navigates to"| node_periodontogram
node_app -->|"navigates to"| node_history
node_app -->|"navigates to"| node_reports
node_login -->|"authenticates through"| node_models
node_users -->|"manages"| node_models
node_patients -->|"manages"| node_models
node_dentists -->|"manages"| node_models
node_appointments -->|"uses"| node_models
node_services -->|"uses"| node_models
node_odontogram -->|"records"| node_models
node_periodontogram -->|"records"| node_models
node_history -->|"reads and records"| node_models
node_reports -->|"reads"| node_models
node_models -->|"persists through"| node_database
node_database -->|"reads and writes"| node_sqlite
node_reports -.->|"sends via"| node_email
node_email -->|"loads settings"| node_email_config

click node_main "https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/main.py"
click node_app "https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/app.py"
click node_theme "https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/theme.py"
click node_widgets "https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/widgets.py"
click node_login "https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/login_ui.py"
click node_users "https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/usuarios_ui.py"
click node_patients "https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/pacientes_ui.py"
click node_dentists "https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/odontologos_ui.py"
click node_appointments "https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/turnos_ui.py"
click node_services "https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/prestaciones_ui.py"
click node_odontogram "https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/odontograma_ui.py"
click node_periodontogram "https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/periodontograma_ui.py"
click node_history "https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/historial_ui.py"
click node_reports "https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/reportes_ui.py"
click node_models "https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/models.py"
click node_database "https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/database.py"
click node_sqlite "https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/data/clinica.db"
click node_email "https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/email_service.py"
click node_email_config "https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/data/email_config.json"

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_app,node_theme,node_widgets,node_login,node_users,node_patients,node_dentists,node_appointments,node_services,node_reports toneBlue
class node_odontogram,node_periodontogram,node_history toneAmber
class node_database,node_sqlite toneMint
class node_main,node_models,node_email,node_email_config toneNeutral
```

## Components

### Desktop UI

Screen modules compose the local clinic application.

- [Application Shell](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/app.py): UI composition · Coordinates navigation, screens, styling, and controls. · `ui/app.py`
- [Theme](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/theme.py): UI styling · `ui/theme.py`
- [Shared Widgets](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/widgets.py): UI controls · `ui/widgets.py`
- [Login](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/login_ui.py): access screen · Gates access to operational screens. · `ui/login_ui.py`
- [User Management](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/usuarios_ui.py): admin screen · Maintains staff accounts and credentials. · `ui/usuarios_ui.py`
- [Patients](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/pacientes_ui.py): master-data screen · `ui/pacientes_ui.py`
- [Dentists](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/odontologos_ui.py): master-data screen · `ui/odontologos_ui.py`
- [Appointments](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/turnos_ui.py): scheduling screen · Connects patients and dentists over time. · `ui/turnos_ui.py`
- [Services](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/prestaciones_ui.py): care screen · Captures billable or delivered care. · `ui/prestaciones_ui.py`
- [Reports](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/reportes_ui.py): reporting screen · Produces operational reporting from clinic data. · `ui/reportes_ui.py`

### Clinical Records

Specialized patient charting views.

- [Odontogram](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/odontograma_ui.py): clinical chart screen · Captures tooth-level status. · `ui/odontograma_ui.py`
- [Periodontogram](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/periodontograma_ui.py): clinical chart screen · Captures periodontal assessments. · `ui/periodontograma_ui.py`
- [Clinical History](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/ui/historial_ui.py): clinical chart screen · Consolidates longitudinal patient information. · `ui/historial_ui.py`

### Local Persistence

SQLite-backed clinic state.

- [Database Access](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/database.py): SQLite boundary · Initializes and accesses local clinic storage. · `database.py`
- [Clinic Database](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/data/clinica.db): SQLite database · Local transactional storage with WAL support. · `data/clinica.db`

### Other components

- [Application Entry](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/main.py): Python entry point · Launches the desktop application. · `main.py`
- [Domain Models](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/models.py): domain and persistence models · Defines clinic entities and persistence-facing representations. · `models.py`
- [Email Service](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/email_service.py): SMTP integration · Delivers outbound email using local configuration. · `email_service.py`
- [Email Configuration](https://github.com/nicolasgomez97/gestion-consultorio-odontologico-passera-unc/blob/main/data/email_config.json): SMTP settings · `data/email_config.json`

## Connections

- Application Entry → Application Shell: launches
- Application Shell → Theme: uses
- Application Shell → Shared Widgets: uses
- Application Shell → Login: shows
- Application Shell → User Management: navigates to
- Application Shell → Patients: navigates to
- Application Shell → Dentists: navigates to
- Application Shell → Appointments: navigates to
- Application Shell → Services: navigates to
- Application Shell → Odontogram: navigates to
- Application Shell → Periodontogram: navigates to
- Application Shell → Clinical History: navigates to
- Application Shell → Reports: navigates to
- Login → Domain Models: authenticates through
- User Management → Domain Models: manages
- Patients → Domain Models: manages
- Dentists → Domain Models: manages
- Appointments → Domain Models: uses
- Services → Domain Models: uses
- Odontogram → Domain Models: records
- Periodontogram → Domain Models: records
- Clinical History → Domain Models: reads and records
- Reports → Domain Models: reads
- Domain Models → Database Access: persists through
- Database Access → Clinic Database: reads and writes
- Reports → Email Service: sends via
- Email Service → Email Configuration: loads settings
