# ibanfernandez/medical-appointments-system architecture

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

- Interactive diagram: https://gitdiagram.com/ibanfernandez/medical-appointments-system
- Repository: https://github.com/ibanfernandez/medical-appointments-system

## Overview

This Laravel application manages patients, appointments, and service packages (bonos). A clinic user submits requests that web routes dispatch to resource controllers; controllers validate and query Eloquent models, then return Blade pages or appointment-event JSON for the calendar. The domain links patients to appointments and bonos, with bonos tracking consumed services. Seeders provide sample domain data. The README also documents pagination, validation, and authorization capabilities, but authorization policies and migrations are not present in the supplied tree. Some frontend-to-endpoint wiring is unverified because the calendar source was indexed but not excerpted.

Main entry points: [`app/Models/Paciente.php`](https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Models/Paciente.php) (Paciente model), [`app/Models/Bono.php`](https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Models/Bono.php) (Bono model), [`app/Http/Controllers/CitaController.php`](https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Http/Controllers/CitaController.php) (Appointment management), [`routes/web.php`](https://github.com/ibanfernandez/medical-appointments-system/blob/master/routes/web.php) (Web routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_routes["Web routes<br/>[web.php]"]
  node_patient_actions["Patient management"]
  node_appointment_actions["Appointment management<br/>[CitaController.php]"]
  node_package_actions["Bono management<br/>[BonoController.php]"]
  node_patient_views["Patient pages"]
  node_appointment_views["Appointment pages"]
  node_package_views["Bono pages"]
  node_calendar_js["Calendar client<br/>[citas-calendar.js]"]
  node_app_js["JavaScript entry<br/>[app.js]"]
  node_js_bootstrap["JS bootstrap<br/>[bootstrap.js]"]
end

subgraph group_domain["Clinic domain"]
  node_paciente["Paciente model<br/>[Paciente.php]"]
  node_cita["Cita model<br/>[Cita.php]"]
  node_bono["Bono model<br/>[Bono.php]"]
  node_database[("Relational database")]
end

subgraph group_runtime["Laravel runtime"]
  node_laravel_bootstrap["Application bootstrap<br/>[app.php]"]
  node_base_controller["Base controller<br/>[Controller.php]"]
  node_service_provider["Pagination defaults"]
  node_user_model["User model<br/>[User.php]"]
end

subgraph group_data_setup["Sample data"]
  node_database_seeder["Seeder coordinator<br/>[DatabaseSeeder.php]"]
  node_patient_seeder["Patient sample data<br/>[PacienteSeeder.php]"]
  node_bono_seeder["Bono sample data<br/>[BonoSeeder.php]"]
  node_appointment_seeder["Appointment sample data<br/>[CitaSeeder.php]"]
end

node_user(("Clinic user"))

node_user -->|"sends requests"| node_routes
node_routes -->|"dispatches"| node_patient_actions
node_routes -->|"dispatches"| node_appointment_actions
node_routes -->|"dispatches"| node_package_actions
node_patient_actions -->|"queries and updates"| node_paciente
node_appointment_actions -->|"queries and updates"| node_cita
node_appointment_actions -->|"loads patients"| node_paciente
node_appointment_actions -->|"loads bonos"| node_bono
node_package_actions -->|"queries and updates"| node_bono
node_package_actions -->|"loads patients"| node_paciente
node_patient_actions -->|"returns pages"| node_patient_views
node_appointment_actions -->|"returns pages"| node_appointment_views
node_package_actions -->|"returns pages"| node_package_views
node_appointment_actions -.->|"serves event data"| node_calendar_js
node_app_js -->|"imports"| node_js_bootstrap
node_app_js -->|"imports"| node_calendar_js
node_paciente -->|"defines relation"| node_bono
node_paciente -->|"defines relation"| node_cita
node_bono -->|"defines relation"| node_cita
node_paciente -.->|"persists via Eloquent"| node_database
node_cita -.->|"persists via Eloquent"| node_database
node_bono -.->|"persists via Eloquent"| node_database
node_laravel_bootstrap -->|"loads routes"| node_routes
node_laravel_bootstrap -->|"registers provider"| node_service_provider
node_patient_seeder -->|"creates records"| node_paciente
node_bono_seeder -->|"creates records"| node_bono
node_appointment_seeder -->|"creates records"| node_cita
node_appointment_seeder -->|"loads patients"| node_paciente
node_appointment_seeder -->|"loads bonos"| node_bono
node_database_seeder -->|"runs"| node_patient_seeder
node_database_seeder -->|"runs"| node_bono_seeder
node_database_seeder -->|"runs"| node_appointment_seeder

click node_routes "https://github.com/ibanfernandez/medical-appointments-system/blob/master/routes/web.php"
click node_patient_actions "https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Http/Controllers/PacienteController.php"
click node_appointment_actions "https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Http/Controllers/CitaController.php"
click node_package_actions "https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Http/Controllers/BonoController.php"
click node_patient_views "https://github.com/ibanfernandez/medical-appointments-system/tree/master/resources/views/pacientes"
click node_appointment_views "https://github.com/ibanfernandez/medical-appointments-system/tree/master/resources/views/citas"
click node_package_views "https://github.com/ibanfernandez/medical-appointments-system/tree/master/resources/views/bonos"
click node_calendar_js "https://github.com/ibanfernandez/medical-appointments-system/blob/master/resources/js/citas-calendar.js"
click node_app_js "https://github.com/ibanfernandez/medical-appointments-system/blob/master/resources/js/app.js"
click node_js_bootstrap "https://github.com/ibanfernandez/medical-appointments-system/blob/master/resources/js/bootstrap.js"
click node_paciente "https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Models/Paciente.php"
click node_cita "https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Models/Cita.php"
click node_bono "https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Models/Bono.php"
click node_laravel_bootstrap "https://github.com/ibanfernandez/medical-appointments-system/blob/master/bootstrap/app.php"
click node_base_controller "https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Http/Controllers/Controller.php"
click node_service_provider "https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Providers/AppServiceProvider.php"
click node_user_model "https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Models/User.php"
click node_database_seeder "https://github.com/ibanfernandez/medical-appointments-system/blob/master/database/seeders/DatabaseSeeder.php"
click node_patient_seeder "https://github.com/ibanfernandez/medical-appointments-system/blob/master/database/seeders/PacienteSeeder.php"
click node_bono_seeder "https://github.com/ibanfernandez/medical-appointments-system/blob/master/database/seeders/BonoSeeder.php"
click node_appointment_seeder "https://github.com/ibanfernandez/medical-appointments-system/blob/master/database/seeders/CitaSeeder.php"

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_routes,node_patient_actions,node_appointment_actions,node_package_actions,node_patient_views,node_appointment_views,node_package_views,node_calendar_js,node_app_js,node_js_bootstrap,node_user toneBlue
class node_paciente,node_cita,node_bono,node_database toneAmber
class node_laravel_bootstrap,node_base_controller,node_service_provider,node_user_model toneMint
class node_database_seeder,node_patient_seeder,node_bono_seeder,node_appointment_seeder toneRose
```

## Components

### Web experience

- [Web routes](https://github.com/ibanfernandez/medical-appointments-system/blob/master/routes/web.php): `routes/web.php`
- [Patient management](https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Http/Controllers/PacienteController.php): `app/Http/Controllers/PacienteController.php`
- [Appointment management](https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Http/Controllers/CitaController.php): `app/Http/Controllers/CitaController.php`
- [Bono management](https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Http/Controllers/BonoController.php): `app/Http/Controllers/BonoController.php`
- [Patient pages](https://github.com/ibanfernandez/medical-appointments-system/tree/master/resources/views/pacientes): `resources/views/pacientes`
- [Appointment pages](https://github.com/ibanfernandez/medical-appointments-system/tree/master/resources/views/citas): `resources/views/citas`
- [Bono pages](https://github.com/ibanfernandez/medical-appointments-system/tree/master/resources/views/bonos): `resources/views/bonos`
- [Calendar client](https://github.com/ibanfernandez/medical-appointments-system/blob/master/resources/js/citas-calendar.js): `resources/js/citas-calendar.js`
- [JavaScript entry](https://github.com/ibanfernandez/medical-appointments-system/blob/master/resources/js/app.js): `resources/js/app.js`
- [JS bootstrap](https://github.com/ibanfernandez/medical-appointments-system/blob/master/resources/js/bootstrap.js): `resources/js/bootstrap.js`

### Clinic domain

- [Paciente model](https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Models/Paciente.php): `app/Models/Paciente.php`
- [Cita model](https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Models/Cita.php): `app/Models/Cita.php`
- [Bono model](https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Models/Bono.php): `app/Models/Bono.php`
- **Relational database**

### Laravel runtime

- [Application bootstrap](https://github.com/ibanfernandez/medical-appointments-system/blob/master/bootstrap/app.php): `bootstrap/app.php`
- [Base controller](https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Http/Controllers/Controller.php): `app/Http/Controllers/Controller.php`
- [Pagination defaults](https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Providers/AppServiceProvider.php): `app/Providers/AppServiceProvider.php`
- [User model](https://github.com/ibanfernandez/medical-appointments-system/blob/master/app/Models/User.php): `app/Models/User.php`

### Sample data

- [Seeder coordinator](https://github.com/ibanfernandez/medical-appointments-system/blob/master/database/seeders/DatabaseSeeder.php): `database/seeders/DatabaseSeeder.php`
- [Patient sample data](https://github.com/ibanfernandez/medical-appointments-system/blob/master/database/seeders/PacienteSeeder.php): `database/seeders/PacienteSeeder.php`
- [Bono sample data](https://github.com/ibanfernandez/medical-appointments-system/blob/master/database/seeders/BonoSeeder.php): `database/seeders/BonoSeeder.php`
- [Appointment sample data](https://github.com/ibanfernandez/medical-appointments-system/blob/master/database/seeders/CitaSeeder.php): `database/seeders/CitaSeeder.php`

### Other components

- **Clinic user**

## Connections

- Clinic user → Web routes: sends requests
- Web routes → Patient management: dispatches (evidence: `routes/web.php`)
- Web routes → Appointment management: dispatches (evidence: `routes/web.php`)
- Web routes → Bono management: dispatches (evidence: `routes/web.php`)
- Patient management → Paciente model: queries and updates (evidence: `app/Http/Controllers/PacienteController.php`)
- Appointment management → Cita model: queries and updates (evidence: `app/Http/Controllers/CitaController.php`)
- Appointment management → Paciente model: loads patients (evidence: `app/Http/Controllers/CitaController.php`)
- Appointment management → Bono model: loads bonos (evidence: `app/Http/Controllers/CitaController.php`)
- Bono management → Bono model: queries and updates (evidence: `app/Http/Controllers/BonoController.php`)
- Bono management → Paciente model: loads patients (evidence: `app/Http/Controllers/BonoController.php`)
- Patient management → Patient pages: returns pages (evidence: `app/Http/Controllers/PacienteController.php`)
- Appointment management → Appointment pages: returns pages (evidence: `app/Http/Controllers/CitaController.php`)
- Bono management → Bono pages: returns pages (evidence: `app/Http/Controllers/BonoController.php`)
- Appointment management → Calendar client: serves event data
- JavaScript entry → JS bootstrap: imports (evidence: `resources/js/app.js`)
- JavaScript entry → Calendar client: imports (evidence: `resources/js/app.js`)
- Paciente model → Bono model: defines relation (evidence: `app/Models/Paciente.php`)
- Paciente model → Cita model: defines relation (evidence: `app/Models/Paciente.php`)
- Bono model → Cita model: defines relation (evidence: `app/Models/Bono.php`)
- Paciente model → Relational database: persists via Eloquent
- Cita model → Relational database: persists via Eloquent
- Bono model → Relational database: persists via Eloquent
- Application bootstrap → Web routes: loads routes (evidence: `bootstrap/app.php`)
- Application bootstrap → Pagination defaults: registers provider
- Patient sample data → Paciente model: creates records (evidence: `database/seeders/PacienteSeeder.php`)
- Bono sample data → Bono model: creates records (evidence: `database/seeders/BonoSeeder.php`)
- Appointment sample data → Cita model: creates records (evidence: `database/seeders/CitaSeeder.php`)
- Appointment sample data → Paciente model: loads patients (evidence: `database/seeders/CitaSeeder.php`)
- Appointment sample data → Bono model: loads bonos (evidence: `database/seeders/CitaSeeder.php`)
- Seeder coordinator → Patient sample data: runs (evidence: `database/seeders/DatabaseSeeder.php`)
- Seeder coordinator → Bono sample data: runs (evidence: `database/seeders/DatabaseSeeder.php`)
- Seeder coordinator → Appointment sample data: runs (evidence: `database/seeders/DatabaseSeeder.php`)
