# sant1jmnz/proyect-berea architecture

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

- Interactive diagram: https://gitdiagram.com/sant1jmnz/proyect-berea
- Repository: https://github.com/sant1jmnz/proyect-berea

## Overview

Dermalia combines a Qt terminal for patients, a Qt reception/management app, and a web booking site, backed by MySQL with local fallback in the desktop apps. The principal workflow is choosing protocols, finding an available time, confirming a booking with an optional simulated deposit, then looking up or cancelling the appointment. Management adds patient, professional, protocol, schedule, and business-record capabilities. The README also describes reminders, price search, AI assistance, coupons, and gift cards; some are documented capabilities whose implementation links are not shown in the excerpts.

Main entry points: [`frontend/gestion`](https://github.com/sant1jmnz/proyect-berea/tree/main/frontend/gestion) (Management pages), [`frontend/cliente/ventanacliente.cpp`](https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/cliente/ventanacliente.cpp) (Patient terminal), [`frontend/gestion/ventanagestion.cpp`](https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/gestion/ventanagestion.cpp) (Management app), [`web/src/js/paginas/reservar.js`](https://github.com/sant1jmnz/proyect-berea/blob/main/web/src/js/paginas/reservar.js) (Web booking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_booking["Booking channels"]
  node_terminal["Patient terminal<br/>[ventanacliente.cpp]"]
end

subgraph group_shared["Shared services"]
  node_protocol_data["Protocol catalogue<br/>[protocolos.js]"]
  node_db_connection["Database connection<br/>[basedatos.cpp]"]
  node_repository["Stored procedure repository<br/>[repositorio.cpp]"]
  node_mysql[("MySQL database")]
  node_connection_state["Connection and fallback<br/>[conexionapp.cpp]"]
  node_local_store[("Local JSON store<br/>[almacenlocal.cpp]")]
  node_reminders["Appointment reminders<br/>[recordatorios.cpp]"]
end

subgraph group_management["Reception management"]
  node_management_app["Management app<br/>[ventanagestion.cpp]"]
  node_management_pages["Management pages"]
  node_coupons_cards["Coupons and gift cards<br/>[paginacupones.cpp]"]
  node_patient_records["Patient records"]
  node_professional_records["Professional schedules"]
  node_protocol_records["Protocol management"]
  node_business_records["Reports and evaluations<br/>[paginareportes.h]"]
end

subgraph group_web["Web experience"]
  node_web_booking["Web booking<br/>[reservar.js]"]
  node_web_api["Booking API client<br/>[api.js]"]
  node_web_server["Web API server<br/>[servidor.js]"]
  node_web_reservations["Local reservations<br/>[reservas.js]"]
  node_price_search["Price and protocol search<br/>[protocolos.js]"]
  node_ai_assistant["Institute information assistant"]
end

node_patient(("Patient"))
node_reception(("Reception staff"))

node_patient -->|"uses"| node_terminal
node_patient -->|"books through"| node_web_booking
node_reception -->|"records bookings"| node_management_app
node_terminal -->|"queries and saves"| node_repository
node_terminal -->|"connects through"| node_connection_state
node_terminal -->|"uses offline"| node_local_store
node_management_app -->|"creates"| node_management_pages
node_management_app -->|"uses"| node_repository
node_management_app -->|"connects through"| node_connection_state
node_management_app -.->|"uses offline"| node_local_store
node_management_pages -.->|"includes"| node_patient_records
node_management_pages -.->|"includes"| node_professional_records
node_management_pages -.->|"includes"| node_protocol_records
node_management_pages -.->|"includes"| node_coupons_cards
node_management_pages -.->|"includes"| node_business_records
node_web_booking -->|"requests availability"| node_web_api
node_web_booking -->|"submits booking"| node_web_api
node_web_booking -->|"saves fallback"| node_web_reservations
node_web_booking -->|"reads protocols"| node_protocol_data
node_web_api -.->|"calls"| node_web_server
node_repository -->|"executes procedures through"| node_db_connection
node_db_connection -->|"connects and queries"| node_mysql
node_connection_state -->|"manages connection"| node_db_connection
node_terminal -.->|"uses"| node_reminders
node_patient -->|"searches"| node_price_search
node_patient -->|"asks"| node_ai_assistant

click node_terminal "https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/cliente/ventanacliente.cpp"
click node_management_app "https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/gestion/ventanagestion.cpp"
click node_management_pages "https://github.com/sant1jmnz/proyect-berea/tree/main/frontend/gestion"
click node_web_booking "https://github.com/sant1jmnz/proyect-berea/blob/main/web/src/js/paginas/reservar.js"
click node_web_api "https://github.com/sant1jmnz/proyect-berea/blob/main/web/src/datos/api.js"
click node_web_server "https://github.com/sant1jmnz/proyect-berea/blob/main/web/api/servidor.js"
click node_protocol_data "https://github.com/sant1jmnz/proyect-berea/blob/main/web/src/datos/protocolos.js"
click node_web_reservations "https://github.com/sant1jmnz/proyect-berea/blob/main/web/src/datos/reservas.js"
click node_db_connection "https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/comun/basedatos.cpp"
click node_repository "https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/comun/repositorio.cpp"
click node_connection_state "https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/comun/conexionapp.cpp"
click node_local_store "https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/gestion/almacenlocal.cpp"
click node_reminders "https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/comun/recordatorios.cpp"
click node_price_search "https://github.com/sant1jmnz/proyect-berea/blob/main/web/src/js/paginas/protocolos.js"
click node_coupons_cards "https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/gestion/paginacupones.cpp"
click node_patient_records "https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/gestion/paginapacientes.cpp"
click node_professional_records "https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/gestion/paginaprofesionales.cpp"
click node_protocol_records "https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/gestion/paginaprotocolos.cpp"
click node_business_records "https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/gestion/paginareportes.h"

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_terminal toneBlue
class node_protocol_data,node_db_connection,node_repository,node_mysql,node_connection_state,node_local_store,node_reminders toneAmber
class node_management_app,node_management_pages,node_coupons_cards,node_patient_records,node_professional_records,node_protocol_records,node_business_records toneMint
class node_web_booking,node_web_api,node_web_server,node_web_reservations,node_price_search,node_ai_assistant toneRose
class node_patient,node_reception toneIndigo
```

## Components

### Booking channels

- [Patient terminal](https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/cliente/ventanacliente.cpp): `frontend/cliente/ventanacliente.cpp`

### Shared services

- [Protocol catalogue](https://github.com/sant1jmnz/proyect-berea/blob/main/web/src/datos/protocolos.js): `web/src/datos/protocolos.js`
- [Database connection](https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/comun/basedatos.cpp): `frontend/comun/basedatos.cpp`
- [Stored procedure repository](https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/comun/repositorio.cpp): `frontend/comun/repositorio.cpp`
- **MySQL database**
- [Connection and fallback](https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/comun/conexionapp.cpp): `frontend/comun/conexionapp.cpp`
- [Local JSON store](https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/gestion/almacenlocal.cpp): `frontend/gestion/almacenlocal.cpp`
- [Appointment reminders](https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/comun/recordatorios.cpp): `frontend/comun/recordatorios.cpp`

### Reception management

- [Management app](https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/gestion/ventanagestion.cpp): `frontend/gestion/ventanagestion.cpp`
- [Management pages](https://github.com/sant1jmnz/proyect-berea/tree/main/frontend/gestion): `frontend/gestion`
- [Coupons and gift cards](https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/gestion/paginacupones.cpp): `frontend/gestion/paginacupones.cpp`
- [Patient records](https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/gestion/paginapacientes.cpp): `frontend/gestion/paginapacientes.cpp`
- [Professional schedules](https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/gestion/paginaprofesionales.cpp): `frontend/gestion/paginaprofesionales.cpp`
- [Protocol management](https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/gestion/paginaprotocolos.cpp): `frontend/gestion/paginaprotocolos.cpp`
- [Reports and evaluations](https://github.com/sant1jmnz/proyect-berea/blob/main/frontend/gestion/paginareportes.h): `frontend/gestion/paginareportes.h`

### Web experience

- [Web booking](https://github.com/sant1jmnz/proyect-berea/blob/main/web/src/js/paginas/reservar.js): `web/src/js/paginas/reservar.js`
- [Booking API client](https://github.com/sant1jmnz/proyect-berea/blob/main/web/src/datos/api.js): `web/src/datos/api.js`
- [Web API server](https://github.com/sant1jmnz/proyect-berea/blob/main/web/api/servidor.js): `web/api/servidor.js`
- [Local reservations](https://github.com/sant1jmnz/proyect-berea/blob/main/web/src/datos/reservas.js): `web/src/datos/reservas.js`
- [Price and protocol search](https://github.com/sant1jmnz/proyect-berea/blob/main/web/src/js/paginas/protocolos.js): `web/src/js/paginas/protocolos.js`
- **Institute information assistant**

### Other components

- **Patient**
- **Reception staff**

## Connections

- Patient → Patient terminal: uses
- Patient → Web booking: books through
- Reception staff → Management app: records bookings
- Patient terminal → Stored procedure repository: queries and saves
- Patient terminal → Connection and fallback: connects through (evidence: `frontend/cliente/ventanacliente.cpp`)
- Patient terminal → Local JSON store: uses offline
- Management app → Management pages: creates (evidence: `frontend/gestion/ventanagestion.cpp`)
- Management app → Stored procedure repository: uses (evidence: `frontend/gestion/ventanagestion.cpp`)
- Management app → Connection and fallback: connects through (evidence: `frontend/gestion/ventanagestion.cpp`)
- Management app → Local JSON store: uses offline
- Management pages → Patient records: includes
- Management pages → Professional schedules: includes (evidence: `frontend/gestion/paginaprofesionales.cpp`)
- Management pages → Protocol management: includes
- Management pages → Coupons and gift cards: includes
- Management pages → Reports and evaluations: includes (evidence: `frontend/gestion/ventanagestion.cpp`)
- Web booking → Booking API client: requests availability (evidence: `web/src/js/paginas/reservar.js`)
- Web booking → Booking API client: submits booking (evidence: `web/src/js/paginas/reservar.js`)
- Web booking → Local reservations: saves fallback (evidence: `web/src/js/paginas/reservar.js`)
- Web booking → Protocol catalogue: reads protocols (evidence: `web/src/js/paginas/reservar.js`)
- Booking API client → Web API server: calls
- Stored procedure repository → Database connection: executes procedures through
- Database connection → MySQL database: connects and queries
- Connection and fallback → Database connection: manages connection
- Patient terminal → Appointment reminders: uses
- Patient → Price and protocol search: searches
- Patient → Institute information assistant: asks
