# dfrancoc256/biometrico-umg architecture

> Architecture diagram of the GitHub repository dfrancoc256/biometrico-umg, 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/dfrancoc256/biometrico-umg
- Repository: https://github.com/dfrancoc256/biometrico-umg

## Overview

#### Scope and Entry Points
ServiMedica is a desktop clinic-management application. The runnable application starts in C++ and loads a QML user interface:
- `Downloads/proyecto (2)/src/main.cpp`
- `Downloads/proyecto (2)/qml/Principal.qml`
- `Downloads/proyecto (2)/CMakeLists.txt`

#### Runtime and Presentation Layer
The application is a C++/Qt-style desktop program, evidenced by its CMake build and QML UI composition. `Principal.qml` is the UI shell; it composes navigation and page-level screens rather than exposing a browser/API frontend.
- `Downloads/proyecto (2)/qml/Principal.qml`
- `Downloads/proyecto (2)/qml/componentes/BarraLateral.qml`
- `Downloads/proyecto (2)/qml/componentes/EncabezadoPagina.qml`

#### Clinical Operations
`ServicioClinica` is the central application-service boundary for clinic workflows. QML pages represent the principal operational domains: patients, doctors, appointments, and clinical records. UI actions should flow from QML into this service rather than directly to storage.
- `Downloads/proyecto (2)/src/servicioclinica.h`
- `Downloads/proyecto (2)/src/servicioclinica.cpp`
- `Downloads/proyecto (2)/qml/paginas/Citas.qml`

#### Patient, Doctor, Appointment, and Record Modules
The UI divides core clinic data into dedicated pages. `Pacientes.qml`, `Medicos.qml`, `Citas.qml`, and `Expedientes.qml` are peer views under the same application shell; their shared data and validation rules belong in the clinic service/database boundary.
- `Downloads/proyecto (2)/qml/paginas/Pacientes.qml`
- `Downloads/proyecto (2)/qml/paginas/Medicos.qml`
- `Downloads/proyecto (2)/qml/paginas/Expedientes.qml`

#### Inventory Management
Inventory is separated into its own service, indicating distinct stock-oriented logic from clinical operations. Its QML page consumes this module alongside the clinic service, likely through application-level objects registered during startup.
- `Downloads/proyecto (2)/src/inventario/servicioinventario.h`
- `Downloads/proyecto (2)/src/inventario/servicioinventario.cpp`
- `Downloads/proyecto (2)/qml/paginas/Inventario.qml`

#### Persistence Boundary
Database connectivity is encapsulated behind a dedicated connection class, while the SQL schema is maintained as an external initialization artifact. This is the main infrastructure dependency; UI code should not embed SQL or connection details.
- `Downloads/proyecto (2)/src/conexionbasedatos.h`
- `Downloads/proyecto (2)/src/conexionbasedatos.cpp`
- `Downloads/proyecto (2)/base-datos/esquema.sql`

#### Dashboard and Shared UI
The summary page provides the aggregate operational view, while reusable QML components standardize layout, summary cards, states, and actions across modules.
- `Downloads/proyecto (2)/qml/paginas/Resumen.qml`
- `Downloads/proyecto (2)/qml/componentes/TarjetaResumen.qml`
- `Downloads/proyecto (2)/qml/componentes/EstadoVacio.qml`

Main entry points: [`Downloads/proyecto (2)/qml/Principal.qml`](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/Principal.qml) (Principal shell), [`Downloads/proyecto (2)/src/servicioclinica.cpp`](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/src/servicioclinica.cpp) (Clinic service), [`Downloads/proyecto (2)/src/main.cpp`](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/src/main.cpp) (Qt application entry), [`Downloads/proyecto (2)/qml/paginas/Resumen.qml`](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/paginas/Resumen.qml) (Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Desktop Runtime"]
  node_cmake["CMake build<br/>[CMakeLists.txt]"]
  node_main["Qt application entry<br/>C++ entry point<br/>[main.cpp]"]
end

subgraph group_ui["QML Presentation"]
  node_shell["Principal shell<br/>QML shell<br/>[Principal.qml]"]
  node_navigation["Sidebar navigation<br/>QML component<br/>[BarraLateral.qml]"]
  node_page_header["Page header<br/>QML component"]
  node_dashboard["Dashboard<br/>QML page<br/>[Resumen.qml]"]
  node_patients["Patients<br/>QML page<br/>[Pacientes.qml]"]
  node_doctors["Doctors<br/>QML page<br/>[Medicos.qml]"]
  node_appointments["Appointments<br/>QML page<br/>[Citas.qml]"]
  node_records["Clinical records<br/>QML page<br/>[Expedientes.qml]"]
  node_inventory_page["Inventory<br/>QML page<br/>[Inventario.qml]"]
  node_summary_card["Summary card<br/>QML component<br/>[TarjetaResumen.qml]"]
  node_empty_state["Empty state<br/>QML component<br/>[EstadoVacio.qml]"]
end

subgraph group_services["Application Services"]
  node_clinic_service{{"Clinic service<br/>application service"}}
  node_inventory_service{{"Inventory service<br/>application service"}}
end

subgraph group_persistence["Persistence"]
  node_db_connection[("Database connection<br/>infrastructure adapter")]
  node_schema["SQL schema<br/>database schema<br/>[esquema.sql]"]
end

node_cmake -->|"builds"| node_main
node_main -->|"loads"| node_shell
node_main -->|"registers"| node_clinic_service
node_main -->|"registers"| node_inventory_service
node_shell -->|"composes"| node_navigation
node_shell -->|"composes"| node_page_header
node_shell -->|"hosts"| node_dashboard
node_shell -->|"hosts"| node_patients
node_shell -->|"hosts"| node_doctors
node_shell -->|"hosts"| node_appointments
node_shell -->|"hosts"| node_records
node_shell -->|"hosts"| node_inventory_page
node_dashboard -->|"uses"| node_summary_card
node_dashboard -->|"reads summaries"| node_clinic_service
node_patients -->|"clinical actions"| node_clinic_service
node_doctors -->|"clinical actions"| node_clinic_service
node_appointments -->|"schedules"| node_clinic_service
node_records -->|"manages records"| node_clinic_service
node_inventory_page -->|"stock actions"| node_inventory_service
node_clinic_service -->|"persists through"| node_db_connection
node_inventory_service -->|"persists through"| node_db_connection
node_db_connection -->|"uses schema"| node_schema

click node_cmake "https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/CMakeLists.txt"
click node_main "https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/src/main.cpp"
click node_shell "https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/Principal.qml"
click node_navigation "https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/componentes/BarraLateral.qml"
click node_page_header "https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/componentes/EncabezadoPagina.qml"
click node_dashboard "https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/paginas/Resumen.qml"
click node_patients "https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/paginas/Pacientes.qml"
click node_doctors "https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/paginas/Medicos.qml"
click node_appointments "https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/paginas/Citas.qml"
click node_records "https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/paginas/Expedientes.qml"
click node_inventory_page "https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/paginas/Inventario.qml"
click node_summary_card "https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/componentes/TarjetaResumen.qml"
click node_empty_state "https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/componentes/EstadoVacio.qml"
click node_clinic_service "https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/src/servicioclinica.cpp"
click node_inventory_service "https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/src/inventario/servicioinventario.cpp"
click node_db_connection "https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/src/conexionbasedatos.cpp"
click node_schema "https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/base-datos/esquema.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_cmake,node_main toneBlue
class node_shell,node_navigation,node_page_header,node_dashboard,node_patients,node_doctors,node_appointments,node_records,node_inventory_page,node_summary_card,node_empty_state toneAmber
class node_clinic_service,node_inventory_service toneMint
class node_db_connection,node_schema toneRose
```

## Components

### Desktop Runtime

- [CMake build](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/CMakeLists.txt): build · `Downloads/proyecto (2)/CMakeLists.txt`
- [Qt application entry](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/src/main.cpp): C++ entry point · Initializes application objects and loads QML. · `Downloads/proyecto (2)/src/main.cpp`

### QML Presentation

- [Principal shell](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/Principal.qml): QML shell · `Downloads/proyecto (2)/qml/Principal.qml`
- [Sidebar navigation](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/componentes/BarraLateral.qml): QML component · `Downloads/proyecto (2)/qml/componentes/BarraLateral.qml`
- [Page header](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/componentes/EncabezadoPagina.qml): QML component · `Downloads/proyecto (2)/qml/componentes/EncabezadoPagina.qml`
- [Dashboard](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/paginas/Resumen.qml): QML page · Aggregate operational summary. · `Downloads/proyecto (2)/qml/paginas/Resumen.qml`
- [Patients](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/paginas/Pacientes.qml): QML page · `Downloads/proyecto (2)/qml/paginas/Pacientes.qml`
- [Doctors](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/paginas/Medicos.qml): QML page · `Downloads/proyecto (2)/qml/paginas/Medicos.qml`
- [Appointments](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/paginas/Citas.qml): QML page · `Downloads/proyecto (2)/qml/paginas/Citas.qml`
- [Clinical records](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/paginas/Expedientes.qml): QML page · `Downloads/proyecto (2)/qml/paginas/Expedientes.qml`
- [Inventory](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/paginas/Inventario.qml): QML page · `Downloads/proyecto (2)/qml/paginas/Inventario.qml`
- [Summary card](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/componentes/TarjetaResumen.qml): QML component · `Downloads/proyecto (2)/qml/componentes/TarjetaResumen.qml`
- [Empty state](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/qml/componentes/EstadoVacio.qml): QML component · `Downloads/proyecto (2)/qml/componentes/EstadoVacio.qml`

### Application Services

- [Clinic service](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/src/servicioclinica.cpp): application service · Central workflow, validation, and shared clinical-data boundary. · `Downloads/proyecto (2)/src/servicioclinica.cpp`
- [Inventory service](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/src/inventario/servicioinventario.cpp): application service · Stock-oriented inventory logic. · `Downloads/proyecto (2)/src/inventario/servicioinventario.cpp`

### Persistence

- [Database connection](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/src/conexionbasedatos.cpp): infrastructure adapter · Encapsulates database connectivity. · `Downloads/proyecto (2)/src/conexionbasedatos.cpp`
- [SQL schema](https://github.com/dfrancoc256/biometrico-umg/blob/main/Downloads/proyecto%20(2)/base-datos/esquema.sql): database schema · Database initialization artifact. · `Downloads/proyecto (2)/base-datos/esquema.sql`

## Connections

- CMake build → Qt application entry: builds
- Qt application entry → Principal shell: loads
- Qt application entry → Clinic service: registers
- Qt application entry → Inventory service: registers
- Principal shell → Sidebar navigation: composes
- Principal shell → Page header: composes
- Principal shell → Dashboard: hosts
- Principal shell → Patients: hosts
- Principal shell → Doctors: hosts
- Principal shell → Appointments: hosts
- Principal shell → Clinical records: hosts
- Principal shell → Inventory: hosts
- Dashboard → Summary card: uses
- Dashboard → Clinic service: reads summaries
- Patients → Clinic service: clinical actions
- Doctors → Clinic service: clinical actions
- Appointments → Clinic service: schedules
- Clinical records → Clinic service: manages records
- Inventory → Inventory service: stock actions
- Clinic service → Database connection: persists through
- Inventory service → Database connection: persists through
- Database connection → SQL schema: uses schema
