# valeaza710/tp_integrador_dao architecture

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

- Interactive diagram: https://gitdiagram.com/valeaza710/tp_integrador_dao
- Repository: https://github.com/valeaza710/tp_integrador_dao

## Overview

This is a Spanish-language medical-practice management web application. The principal workflow is patients booking appointments against doctors’ schedules; the backend manages appointment slots and persists records in SQLite. Other documented capabilities include patient/doctor administration, clinical histories and prescriptions, and reporting. The graph follows the sampled appointment flow and README capabilities; several subsystem links rely on the SOURCE INDEX, while frontend-to-API wiring is not shown in the excerpts.

Main entry points: [`main.py`](https://github.com/valeaza710/tp_integrador_dao/blob/main/main.py) (Application entry), [`backend/data_base/connection.py`](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/data_base/connection.py) (SQLite database), [`backend/services/agenda_turno_service.py`](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/services/agenda_turno_service.py) (Appointment workflow), [`backend/services/receta_service.py`](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/services/receta_service.py) (Clinical records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_booking_ui["Appointment booking<br/>[agendarCita.js]"]
  node_admin_ui["Administration UI"]
  node_history_ui["Clinical history UI"]
  node_reports_ui["Reports UI<br/>[reportes.js]"]
  node_web_routes["Page routes"]
end

subgraph group_api["API workflows"]
  node_app["Application entry<br/>[main.py]"]
  node_appointment_api["Appointment endpoints"]
  node_patient_api["Patient endpoints"]
  node_doctor_api["Doctor endpoints<br/>[medico_routers.py]"]
  node_prescription_api["Prescription endpoints<br/>[receta_routers.py]"]
  node_reports_api["Report endpoints"]
end

subgraph group_care["Clinical operations"]
  node_appointment_service["Appointment workflow"]
  node_schedule_service["Doctor schedules"]
  node_patient_service["Patient management"]
  node_prescription_service["Clinical records<br/>[receta_service.py]"]
  node_report_service["Report generation"]
  node_doctor_service["Doctor management<br/>[medico_service.py]"]
end

subgraph group_data["Persistence"]
  node_appointment_repo["Appointment records"]
  node_schedule_repo["Schedule records"]
  node_patient_repo["Patient records"]
  node_prescription_repo["Prescription records"]
  node_history_repo["Clinical history records"]
  node_report_repo["Report queries"]
  node_db[("SQLite database<br/>[connection.py]")]
end

node_user(("Patient or staff"))

node_user -->|"books appointment"| node_booking_ui
node_booking_ui -.->|"submits booking"| node_appointment_api
node_user -->|"manages records"| node_admin_ui
node_user -->|"views history"| node_history_ui
node_user -->|"views reports"| node_reports_ui
node_app -->|"registers pages"| node_web_routes
node_app -->|"registers routes"| node_appointment_api
node_app -->|"registers routes"| node_patient_api
node_app -->|"registers routes"| node_doctor_api
node_app -->|"registers routes"| node_prescription_api
node_app -->|"registers routes"| node_reports_api
node_appointment_api -->|"calls service"| node_appointment_service
node_patient_api -->|"calls service"| node_patient_service
node_doctor_api -->|"calls service"| node_doctor_service
node_prescription_api -->|"calls service"| node_prescription_service
node_reports_api -->|"calls service"| node_report_service
node_appointment_service -->|"reads and writes"| node_appointment_repo
node_appointment_service -->|"looks up patient"| node_patient_repo
node_schedule_service -->|"checks appointments"| node_appointment_repo
node_schedule_service -->|"manages schedules"| node_schedule_repo
node_patient_service -->|"manages patients"| node_patient_repo
node_prescription_service -->|"saves prescriptions"| node_prescription_repo
node_prescription_service -->|"uses history"| node_history_repo
node_report_service -->|"requests reports"| node_report_repo
node_appointment_repo -->|"queries SQLite"| node_db
node_schedule_repo -->|"queries SQLite"| node_db
node_patient_repo -->|"queries SQLite"| node_db
node_prescription_repo -.->|"queries SQLite"| node_db
node_history_repo -.->|"queries SQLite"| node_db
node_report_repo -.->|"queries SQLite"| node_db

click node_booking_ui "https://github.com/valeaza710/tp_integrador_dao/blob/main/frontend/static/js/agendarCita.js"
click node_admin_ui "https://github.com/valeaza710/tp_integrador_dao/blob/main/frontend/static/js/gestorAdministrador.js"
click node_history_ui "https://github.com/valeaza710/tp_integrador_dao/blob/main/frontend/static/js/historialClinico.js"
click node_reports_ui "https://github.com/valeaza710/tp_integrador_dao/blob/main/frontend/static/js/reportes.js"
click node_web_routes "https://github.com/valeaza710/tp_integrador_dao/blob/main/frontend/views/frontend_routers.py"
click node_app "https://github.com/valeaza710/tp_integrador_dao/blob/main/main.py"
click node_appointment_api "https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/routers/agenda_turno_routers.py"
click node_patient_api "https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/routers/paciente_routers.py"
click node_doctor_api "https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/routers/medico_routers.py"
click node_prescription_api "https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/routers/receta_routers.py"
click node_reports_api "https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/routers/reportes_routers.py"
click node_appointment_service "https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/services/agenda_turno_service.py"
click node_schedule_service "https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/services/horario_medico_service.py"
click node_patient_service "https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/services/paciente_service.py"
click node_prescription_service "https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/services/receta_service.py"
click node_report_service "https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/services/reportes_service.py"
click node_doctor_service "https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/services/medico_service.py"
click node_appointment_repo "https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/repository/agenda_turno_repository.py"
click node_schedule_repo "https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/repository/horario_medico_repository.py"
click node_patient_repo "https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/repository/paciente_repository.py"
click node_prescription_repo "https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/repository/receta_repository.py"
click node_history_repo "https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/repository/historial_clinico_repository.py"
click node_report_repo "https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/repository/reportes_repository.py"
click node_db "https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/data_base/connection.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_booking_ui,node_admin_ui,node_history_ui,node_reports_ui,node_web_routes toneBlue
class node_app,node_appointment_api,node_patient_api,node_doctor_api,node_prescription_api,node_reports_api toneAmber
class node_appointment_service,node_schedule_service,node_patient_service,node_prescription_service,node_report_service,node_doctor_service toneMint
class node_appointment_repo,node_schedule_repo,node_patient_repo,node_prescription_repo,node_history_repo,node_report_repo,node_db toneRose
class node_user toneIndigo
```

## Components

### Web interface

- [Appointment booking](https://github.com/valeaza710/tp_integrador_dao/blob/main/frontend/static/js/agendarCita.js): `frontend/static/js/agendarCita.js`
- [Administration UI](https://github.com/valeaza710/tp_integrador_dao/blob/main/frontend/static/js/gestorAdministrador.js): `frontend/static/js/gestorAdministrador.js`
- [Clinical history UI](https://github.com/valeaza710/tp_integrador_dao/blob/main/frontend/static/js/historialClinico.js): `frontend/static/js/historialClinico.js`
- [Reports UI](https://github.com/valeaza710/tp_integrador_dao/blob/main/frontend/static/js/reportes.js): `frontend/static/js/reportes.js`
- [Page routes](https://github.com/valeaza710/tp_integrador_dao/blob/main/frontend/views/frontend_routers.py): `frontend/views/frontend_routers.py`

### API workflows

- [Application entry](https://github.com/valeaza710/tp_integrador_dao/blob/main/main.py): `main.py`
- [Appointment endpoints](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/routers/agenda_turno_routers.py): `backend/routers/agenda_turno_routers.py`
- [Patient endpoints](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/routers/paciente_routers.py): `backend/routers/paciente_routers.py`
- [Doctor endpoints](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/routers/medico_routers.py): `backend/routers/medico_routers.py`
- [Prescription endpoints](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/routers/receta_routers.py): `backend/routers/receta_routers.py`
- [Report endpoints](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/routers/reportes_routers.py): `backend/routers/reportes_routers.py`

### Clinical operations

- [Appointment workflow](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/services/agenda_turno_service.py): `backend/services/agenda_turno_service.py`
- [Doctor schedules](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/services/horario_medico_service.py): `backend/services/horario_medico_service.py`
- [Patient management](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/services/paciente_service.py): `backend/services/paciente_service.py`
- [Clinical records](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/services/receta_service.py): `backend/services/receta_service.py`
- [Report generation](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/services/reportes_service.py): `backend/services/reportes_service.py`
- [Doctor management](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/services/medico_service.py): `backend/services/medico_service.py`

### Persistence

- [Appointment records](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/repository/agenda_turno_repository.py): `backend/repository/agenda_turno_repository.py`
- [Schedule records](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/repository/horario_medico_repository.py): `backend/repository/horario_medico_repository.py`
- [Patient records](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/repository/paciente_repository.py): `backend/repository/paciente_repository.py`
- [Prescription records](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/repository/receta_repository.py): `backend/repository/receta_repository.py`
- [Clinical history records](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/repository/historial_clinico_repository.py): `backend/repository/historial_clinico_repository.py`
- [Report queries](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/repository/reportes_repository.py): `backend/repository/reportes_repository.py`
- [SQLite database](https://github.com/valeaza710/tp_integrador_dao/blob/main/backend/data_base/connection.py): `backend/data_base/connection.py`

### Other components

- **Patient or staff**

## Connections

- Patient or staff → Appointment booking: books appointment
- Appointment booking → Appointment endpoints: submits booking
- Patient or staff → Administration UI: manages records
- Patient or staff → Clinical history UI: views history
- Patient or staff → Reports UI: views reports
- Application entry → Page routes: registers pages (evidence: `main.py`)
- Application entry → Appointment endpoints: registers routes (evidence: `main.py`)
- Application entry → Patient endpoints: registers routes (evidence: `main.py`)
- Application entry → Doctor endpoints: registers routes (evidence: `main.py`)
- Application entry → Prescription endpoints: registers routes (evidence: `main.py`)
- Application entry → Report endpoints: registers routes (evidence: `main.py`)
- Appointment endpoints → Appointment workflow: calls service (evidence: `backend/routers/agenda_turno_routers.py`)
- Patient endpoints → Patient management: calls service (evidence: `backend/routers/paciente_routers.py`)
- Doctor endpoints → Doctor management: calls service (evidence: `backend/routers/medico_routers.py`)
- Prescription endpoints → Clinical records: calls service (evidence: `backend/routers/receta_routers.py`)
- Report endpoints → Report generation: calls service (evidence: `backend/routers/reportes_routers.py`)
- Appointment workflow → Appointment records: reads and writes (evidence: `backend/services/agenda_turno_service.py`)
- Appointment workflow → Patient records: looks up patient (evidence: `backend/services/agenda_turno_service.py`)
- Doctor schedules → Appointment records: checks appointments (evidence: `backend/services/horario_medico_service.py`)
- Doctor schedules → Schedule records: manages schedules (evidence: `backend/services/horario_medico_service.py`)
- Patient management → Patient records: manages patients (evidence: `backend/services/paciente_service.py`)
- Clinical records → Prescription records: saves prescriptions (evidence: `backend/services/receta_service.py`)
- Clinical records → Clinical history records: uses history (evidence: `backend/services/receta_service.py`)
- Report generation → Report queries: requests reports (evidence: `backend/services/reportes_service.py`)
- Appointment records → SQLite database: queries SQLite (evidence: `backend/repository/agenda_turno_repository.py`)
- Schedule records → SQLite database: queries SQLite (evidence: `backend/repository/horario_medico_repository.py`)
- Patient records → SQLite database: queries SQLite (evidence: `backend/repository/paciente_repository.py`)
- Prescription records → SQLite database: queries SQLite (evidence: `backend/repository/receta_repository.py`)
- Clinical history records → SQLite database: queries SQLite (evidence: `backend/repository/historial_clinico_repository.py`)
- Report queries → SQLite database: queries SQLite (evidence: `backend/repository/reportes_repository.py`)
