# fvm14/citame_devsecops architecture

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

- Interactive diagram: https://gitdiagram.com/fvm14/citame_devsecops
- Repository: https://github.com/fvm14/citame_devsecops

## Overview

CitaMe SecOps is a Laravel medical-appointment application reinforced with security logging, role-based controls, and two-factor authentication. A patient-facing workflow enters through the Laravel front controller, reaches appointment handling, checks doctor availability, and creates or manages appointments; doctors and administrators also manage schedules and clinical records. The README documents MySQL and Wazuh monitoring as deployment capabilities. Some route wiring and security subsystems are unsampled, so uncertain runtime connections are omitted or marked dashed rather than inferred.

Main entry points: [`app/Http/Controllers/AppointmentController.php`](https://github.com/fvm14/citame_devsecops/blob/main/app/Http/Controllers/AppointmentController.php) (Appointment handling), [`app/Services/HorarioService.php`](https://github.com/fvm14/citame_devsecops/blob/main/app/Services/HorarioService.php) (Availability service), [`app/Support/SecurityLog.php`](https://github.com/fvm14/citame_devsecops/blob/main/app/Support/SecurityLog.php) (Security event logging), [`app/Models/Appointment.php`](https://github.com/fvm14/citame_devsecops/blob/main/app/Models/Appointment.php) (Appointment records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_front["Laravel entry<br/>[index.php]"]
  node_bootstrap["App bootstrap<br/>[app.php]"]
  node_httpkernel["HTTP kernel<br/>[Kernel.php]"]
  node_routes["Web routes<br/>[web.php]"]
end

subgraph group_care["Appointments and care"]
  node_appointments["Appointment handling"]
  node_scheduleapi["Schedule API"]
  node_doctorhours["Doctor schedules"]
  node_hoursservice["Availability service<br/>[HorarioService.php]"]
  node_hoursbinding["Schedule binding"]
  node_appointmentdata[("Appointment records<br/>[Appointment.php]")]
  node_scheduledata[("Schedule records<br/>[Horarios.php]")]
  node_specialties[("Medical specialties<br/>[Specialty.php]")]
end

subgraph group_identity["Identity and security"]
  node_users[("User accounts<br/>[User.php]")]
  node_auth["Authentication and 2FA"]
  node_policy["Appointment access policy"]
  node_authprovider["Authorization registration"]
end

subgraph group_monitoring["Security monitoring"]
  node_securitylog["Security event logging<br/>[SecurityLog.php]"]
  node_authlistener["Authentication event listener"]
  node_wazuh["Wazuh monitoring"]
end

node_patient(("Patient / clinician"))
node_mysql[("Local MySQL")]

node_patient -->|"requests"| node_front
node_front -->|"loads"| node_bootstrap
node_bootstrap -->|"binds"| node_httpkernel
node_httpkernel -.->|"routes requests"| node_routes
node_routes -.->|"dispatches"| node_appointments
node_appointments -->|"checks availability"| node_hoursservice
node_appointments -->|"creates and updates"| node_appointmentdata
node_appointments -->|"reads"| node_specialties
node_hoursservice -->|"reads schedules"| node_scheduledata
node_hoursservice -->|"checks bookings"| node_appointmentdata
node_hoursbinding -->|"binds service"| node_hoursservice
node_scheduleapi -->|"requests intervals"| node_hoursservice
node_doctorhours -.->|"manages schedules"| node_scheduledata
node_appointments -->|"authorizes actions"| node_policy
node_authprovider -->|"registers policy"| node_policy
node_appointments -->|"records events"| node_securitylog
node_authprovider -->|"logs denials"| node_securitylog
node_authlistener -->|"logs authentication"| node_securitylog
node_auth -->|"records 2FA events"| node_securitylog
node_securitylog -->|"ships security events"| node_wazuh
node_appointmentdata -.->|"persists records"| node_mysql
node_scheduledata -.->|"persists schedules"| node_mysql

click node_front "https://github.com/fvm14/citame_devsecops/blob/main/public/index.php"
click node_bootstrap "https://github.com/fvm14/citame_devsecops/blob/main/bootstrap/app.php"
click node_httpkernel "https://github.com/fvm14/citame_devsecops/blob/main/app/Http/Kernel.php"
click node_routes "https://github.com/fvm14/citame_devsecops/blob/main/routes/web.php"
click node_appointments "https://github.com/fvm14/citame_devsecops/blob/main/app/Http/Controllers/AppointmentController.php"
click node_scheduleapi "https://github.com/fvm14/citame_devsecops/blob/main/app/Http/Controllers/Api/HorarioController.php"
click node_doctorhours "https://github.com/fvm14/citame_devsecops/blob/main/app/Http/Controllers/Doctor/HorarioController.php"
click node_hoursservice "https://github.com/fvm14/citame_devsecops/blob/main/app/Services/HorarioService.php"
click node_hoursbinding "https://github.com/fvm14/citame_devsecops/blob/main/app/Providers/HorarioServiceProvider.php"
click node_appointmentdata "https://github.com/fvm14/citame_devsecops/blob/main/app/Models/Appointment.php"
click node_scheduledata "https://github.com/fvm14/citame_devsecops/blob/main/app/Models/Horarios.php"
click node_specialties "https://github.com/fvm14/citame_devsecops/blob/main/app/Models/Specialty.php"
click node_users "https://github.com/fvm14/citame_devsecops/blob/main/app/Models/User.php"
click node_auth "https://github.com/fvm14/citame_devsecops/blob/main/app/Http/Controllers/Auth/TwoFactorController.php"
click node_policy "https://github.com/fvm14/citame_devsecops/blob/main/app/Policies/AppointmentPolicy.php"
click node_authprovider "https://github.com/fvm14/citame_devsecops/blob/main/app/Providers/AuthServiceProvider.php"
click node_securitylog "https://github.com/fvm14/citame_devsecops/blob/main/app/Support/SecurityLog.php"
click node_authlistener "https://github.com/fvm14/citame_devsecops/blob/main/app/Listeners/LogAuthenticationEvents.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_front,node_bootstrap,node_httpkernel,node_routes toneBlue
class node_appointments,node_scheduleapi,node_doctorhours,node_hoursservice,node_hoursbinding,node_appointmentdata,node_scheduledata,node_specialties,node_mysql toneAmber
class node_users,node_auth,node_policy,node_authprovider toneMint
class node_securitylog,node_authlistener,node_wazuh toneRose
class node_patient toneIndigo
```

## Components

### Web entry

- [Laravel entry](https://github.com/fvm14/citame_devsecops/blob/main/public/index.php): `public/index.php`
- [App bootstrap](https://github.com/fvm14/citame_devsecops/blob/main/bootstrap/app.php): `bootstrap/app.php`
- [HTTP kernel](https://github.com/fvm14/citame_devsecops/blob/main/app/Http/Kernel.php): `app/Http/Kernel.php`
- [Web routes](https://github.com/fvm14/citame_devsecops/blob/main/routes/web.php): `routes/web.php`

### Appointments and care

- [Appointment handling](https://github.com/fvm14/citame_devsecops/blob/main/app/Http/Controllers/AppointmentController.php): `app/Http/Controllers/AppointmentController.php`
- [Schedule API](https://github.com/fvm14/citame_devsecops/blob/main/app/Http/Controllers/Api/HorarioController.php): `app/Http/Controllers/Api/HorarioController.php`
- [Doctor schedules](https://github.com/fvm14/citame_devsecops/blob/main/app/Http/Controllers/Doctor/HorarioController.php): `app/Http/Controllers/Doctor/HorarioController.php`
- [Availability service](https://github.com/fvm14/citame_devsecops/blob/main/app/Services/HorarioService.php): `app/Services/HorarioService.php`
- [Schedule binding](https://github.com/fvm14/citame_devsecops/blob/main/app/Providers/HorarioServiceProvider.php): `app/Providers/HorarioServiceProvider.php`
- [Appointment records](https://github.com/fvm14/citame_devsecops/blob/main/app/Models/Appointment.php): `app/Models/Appointment.php`
- [Schedule records](https://github.com/fvm14/citame_devsecops/blob/main/app/Models/Horarios.php): `app/Models/Horarios.php`
- [Medical specialties](https://github.com/fvm14/citame_devsecops/blob/main/app/Models/Specialty.php): `app/Models/Specialty.php`

### Identity and security

- [User accounts](https://github.com/fvm14/citame_devsecops/blob/main/app/Models/User.php): `app/Models/User.php`
- [Authentication and 2FA](https://github.com/fvm14/citame_devsecops/blob/main/app/Http/Controllers/Auth/TwoFactorController.php): `app/Http/Controllers/Auth/TwoFactorController.php`
- [Appointment access policy](https://github.com/fvm14/citame_devsecops/blob/main/app/Policies/AppointmentPolicy.php): `app/Policies/AppointmentPolicy.php`
- [Authorization registration](https://github.com/fvm14/citame_devsecops/blob/main/app/Providers/AuthServiceProvider.php): `app/Providers/AuthServiceProvider.php`

### Security monitoring

- [Security event logging](https://github.com/fvm14/citame_devsecops/blob/main/app/Support/SecurityLog.php): `app/Support/SecurityLog.php`
- [Authentication event listener](https://github.com/fvm14/citame_devsecops/blob/main/app/Listeners/LogAuthenticationEvents.php): `app/Listeners/LogAuthenticationEvents.php`
- **Wazuh monitoring**

### Other components

- **Patient / clinician**
- **Local MySQL**

## Connections

- Patient / clinician → Laravel entry: requests (evidence: `README.md`)
- Laravel entry → App bootstrap: loads (evidence: `public/index.php`)
- App bootstrap → HTTP kernel: binds (evidence: `bootstrap/app.php`)
- HTTP kernel → Web routes: routes requests
- Web routes → Appointment handling: dispatches
- Appointment handling → Availability service: checks availability (evidence: `app/Http/Controllers/AppointmentController.php`)
- Appointment handling → Appointment records: creates and updates (evidence: `app/Http/Controllers/AppointmentController.php`)
- Appointment handling → Medical specialties: reads (evidence: `app/Http/Controllers/AppointmentController.php`)
- Availability service → Schedule records: reads schedules (evidence: `app/Services/HorarioService.php`)
- Availability service → Appointment records: checks bookings (evidence: `app/Services/HorarioService.php`)
- Schedule binding → Availability service: binds service (evidence: `app/Providers/HorarioServiceProvider.php`)
- Schedule API → Availability service: requests intervals (evidence: `app/Http/Controllers/Api/HorarioController.php`)
- Doctor schedules → Schedule records: manages schedules (evidence: `app/Http/Controllers/Doctor/HorarioController.php`)
- Appointment handling → Appointment access policy: authorizes actions (evidence: `app/Http/Controllers/AppointmentController.php`)
- Authorization registration → Appointment access policy: registers policy (evidence: `app/Providers/AuthServiceProvider.php`)
- Appointment handling → Security event logging: records events (evidence: `app/Http/Controllers/AppointmentController.php`)
- Authorization registration → Security event logging: logs denials (evidence: `app/Providers/AuthServiceProvider.php`)
- Authentication event listener → Security event logging: logs authentication (evidence: `app/Listeners/LogAuthenticationEvents.php`)
- Authentication and 2FA → Security event logging: records 2FA events (evidence: `app/Http/Controllers/Auth/TwoFactorController.php`)
- Security event logging → Wazuh monitoring: ships security events (evidence: `README.md`)
- Appointment records → Local MySQL: persists records
- Schedule records → Local MySQL: persists schedules
