# gabmiranda7/vitus architecture

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

- Interactive diagram: https://gitdiagram.com/gabmiranda7/vitus
- Repository: https://github.com/gabmiranda7/vitus

## Overview

Vitus is an electronic health-record system for receptionists, nurses and physicians. Its central clinical workflow is appointment scheduling, nurse-led triage, physician consultation and notes, then prescription and completion, with patient records and exam attachments supporting care. The web and mobile clients front a .NET API; application use cases coordinate domain rules and infrastructure persistence. The README documents additional capabilities, but their internal call paths are not all shown, so those links are omitted or marked unverified.

Main entry points: [`src/Vitus.Application/UseCases`](https://github.com/gabmiranda7/vitus/tree/main/src/Vitus.Application/UseCases) (Clinical use cases), [`web/src/pages`](https://github.com/gabmiranda7/vitus/tree/main/web/src/pages) (Web client), [`mobile/src/screens`](https://github.com/gabmiranda7/vitus/tree/main/mobile/src/screens) (Mobile client), [`src/Vitus.API/Controllers/AuthController.cs`](https://github.com/gabmiranda7/vitus/blob/main/src/Vitus.API/Controllers/AuthController.cs) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User clients"]
  node_web["Web client"]
  node_mobile["Mobile client"]
  node_api_service["API client services<br/>[api.ts]"]
  node_mobile_api["Mobile API service<br/>[api.ts]"]
end

subgraph group_api["API and application"]
  node_auth["Authentication<br/>[AuthController.cs]"]
  node_patients["Patient management"]
  node_appointments["Appointment workflow"]
  node_care_use_cases["Clinical use cases<br/>[UseCases]"]
  node_support_use_cases["Supporting use cases<br/>[UseCases]"]
end

subgraph group_clinical["Clinical domain"]
  node_patient_records["Patient records<br/>[Paciente.cs]"]
  node_clinical_entities["Clinical entities<br/>[Consulta.cs]"]
  node_triage["Triage<br/>[RegistrarTriagem]"]
  node_prescriptions["Prescriptions<br/>[Receitas]"]
  node_exams["Exam attachments<br/>[Exames]"]
  node_audit["Audit logs<br/>[AuditoriaLog.cs]"]
end

subgraph group_infrastructure["Persistence and services"]
  node_repositories["Repositories<br/>[Repositories]"]
  node_database[("Relational database<br/>[AppDbContext.cs]")]
  node_document_service["Prescription documents"]
  node_file_service["Exam file storage<br/>[ArquivoService.cs]"]
end

node_receptionist(("Receptionist"))
node_nurse(("Nurse"))
node_physician(("Physician"))

node_receptionist -->|"uses"| node_web
node_nurse -->|"uses"| node_web
node_physician -->|"uses"| node_web
node_receptionist -.->|"uses"| node_mobile
node_nurse -.->|"uses"| node_mobile
node_physician -.->|"uses"| node_mobile
node_web -->|"requests data"| node_api_service
node_api_service -.->|"calls API"| node_auth
node_mobile -.->|"requests data"| node_mobile_api
node_mobile_api -.->|"calls API"| node_auth
node_auth -->|"executes"| node_support_use_cases
node_patients -->|"executes"| node_support_use_cases
node_appointments -->|"executes"| node_care_use_cases
node_care_use_cases -.->|"applies domain rules"| node_clinical_entities
node_support_use_cases -.->|"uses domain"| node_patient_records
node_care_use_cases -.->|"includes"| node_triage
node_care_use_cases -.->|"includes"| node_prescriptions
node_care_use_cases -.->|"includes"| node_exams
node_support_use_cases -.->|"includes"| node_audit
node_care_use_cases -.->|"uses interfaces"| node_repositories
node_support_use_cases -.->|"uses interfaces"| node_repositories
node_repositories -->|"reads and writes"| node_database
node_prescriptions -.->|"generates document"| node_document_service
node_exams -.->|"stores files"| node_file_service

click node_web "https://github.com/gabmiranda7/vitus/tree/main/web/src/pages"
click node_mobile "https://github.com/gabmiranda7/vitus/tree/main/mobile/src/screens"
click node_api_service "https://github.com/gabmiranda7/vitus/blob/main/web/src/services/api.ts"
click node_mobile_api "https://github.com/gabmiranda7/vitus/blob/main/mobile/src/services/api.ts"
click node_auth "https://github.com/gabmiranda7/vitus/blob/main/src/Vitus.API/Controllers/AuthController.cs"
click node_patients "https://github.com/gabmiranda7/vitus/blob/main/src/Vitus.API/Controllers/PacienteController.cs"
click node_appointments "https://github.com/gabmiranda7/vitus/blob/main/src/Vitus.API/Controllers/ConsultaController.cs"
click node_care_use_cases "https://github.com/gabmiranda7/vitus/tree/main/src/Vitus.Application/UseCases"
click node_support_use_cases "https://github.com/gabmiranda7/vitus/tree/main/src/Vitus.Application/UseCases"
click node_patient_records "https://github.com/gabmiranda7/vitus/blob/main/src/Vitus.Domain/Entities/Paciente.cs"
click node_clinical_entities "https://github.com/gabmiranda7/vitus/blob/main/src/Vitus.Domain/Entities/Consulta.cs"
click node_triage "https://github.com/gabmiranda7/vitus/tree/main/src/Vitus.Application/UseCases/Triagens/RegistrarTriagem"
click node_prescriptions "https://github.com/gabmiranda7/vitus/tree/main/src/Vitus.Application/UseCases/Receitas"
click node_exams "https://github.com/gabmiranda7/vitus/tree/main/src/Vitus.Application/UseCases/Exames"
click node_audit "https://github.com/gabmiranda7/vitus/blob/main/src/Vitus.Domain/Entities/AuditoriaLog.cs"
click node_repositories "https://github.com/gabmiranda7/vitus/tree/main/src/Vitus.Infrastructure/Repositories"
click node_database "https://github.com/gabmiranda7/vitus/blob/main/src/Vitus.Infrastructure/Data/AppDbContext.cs"
click node_document_service "https://github.com/gabmiranda7/vitus/blob/main/src/Vitus.Infrastructure/Services/DocumentoService.cs"
click node_file_service "https://github.com/gabmiranda7/vitus/blob/main/src/Vitus.Infrastructure/Services/ArquivoService.cs"

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_web,node_mobile,node_api_service,node_mobile_api toneBlue
class node_auth,node_patients,node_appointments,node_care_use_cases,node_support_use_cases toneAmber
class node_patient_records,node_clinical_entities,node_triage,node_prescriptions,node_exams,node_audit toneMint
class node_repositories,node_database,node_document_service,node_file_service toneRose
class node_receptionist,node_nurse,node_physician toneIndigo
```

## Components

### User clients

- [Web client](https://github.com/gabmiranda7/vitus/tree/main/web/src/pages): `web/src/pages`
- [Mobile client](https://github.com/gabmiranda7/vitus/tree/main/mobile/src/screens): `mobile/src/screens`
- [API client services](https://github.com/gabmiranda7/vitus/blob/main/web/src/services/api.ts): `web/src/services/api.ts`
- [Mobile API service](https://github.com/gabmiranda7/vitus/blob/main/mobile/src/services/api.ts): `mobile/src/services/api.ts`

### API and application

- [Authentication](https://github.com/gabmiranda7/vitus/blob/main/src/Vitus.API/Controllers/AuthController.cs): `src/Vitus.API/Controllers/AuthController.cs`
- [Patient management](https://github.com/gabmiranda7/vitus/blob/main/src/Vitus.API/Controllers/PacienteController.cs): `src/Vitus.API/Controllers/PacienteController.cs`
- [Appointment workflow](https://github.com/gabmiranda7/vitus/blob/main/src/Vitus.API/Controllers/ConsultaController.cs): `src/Vitus.API/Controllers/ConsultaController.cs`
- [Clinical use cases](https://github.com/gabmiranda7/vitus/tree/main/src/Vitus.Application/UseCases): `src/Vitus.Application/UseCases`
- [Supporting use cases](https://github.com/gabmiranda7/vitus/tree/main/src/Vitus.Application/UseCases): `src/Vitus.Application/UseCases`

### Clinical domain

- [Patient records](https://github.com/gabmiranda7/vitus/blob/main/src/Vitus.Domain/Entities/Paciente.cs): `src/Vitus.Domain/Entities/Paciente.cs`
- [Clinical entities](https://github.com/gabmiranda7/vitus/blob/main/src/Vitus.Domain/Entities/Consulta.cs): `src/Vitus.Domain/Entities/Consulta.cs`
- [Triage](https://github.com/gabmiranda7/vitus/tree/main/src/Vitus.Application/UseCases/Triagens/RegistrarTriagem): `src/Vitus.Application/UseCases/Triagens/RegistrarTriagem`
- [Prescriptions](https://github.com/gabmiranda7/vitus/tree/main/src/Vitus.Application/UseCases/Receitas): `src/Vitus.Application/UseCases/Receitas`
- [Exam attachments](https://github.com/gabmiranda7/vitus/tree/main/src/Vitus.Application/UseCases/Exames): `src/Vitus.Application/UseCases/Exames`
- [Audit logs](https://github.com/gabmiranda7/vitus/blob/main/src/Vitus.Domain/Entities/AuditoriaLog.cs): `src/Vitus.Domain/Entities/AuditoriaLog.cs`

### Persistence and services

- [Repositories](https://github.com/gabmiranda7/vitus/tree/main/src/Vitus.Infrastructure/Repositories): `src/Vitus.Infrastructure/Repositories`
- [Relational database](https://github.com/gabmiranda7/vitus/blob/main/src/Vitus.Infrastructure/Data/AppDbContext.cs): `src/Vitus.Infrastructure/Data/AppDbContext.cs`
- [Prescription documents](https://github.com/gabmiranda7/vitus/blob/main/src/Vitus.Infrastructure/Services/DocumentoService.cs): `src/Vitus.Infrastructure/Services/DocumentoService.cs`
- [Exam file storage](https://github.com/gabmiranda7/vitus/blob/main/src/Vitus.Infrastructure/Services/ArquivoService.cs): `src/Vitus.Infrastructure/Services/ArquivoService.cs`

### Other components

- **Receptionist**
- **Nurse**
- **Physician**

## Connections

- Receptionist → Web client: uses (evidence: `README.md`)
- Nurse → Web client: uses (evidence: `README.md`)
- Physician → Web client: uses (evidence: `README.md`)
- Receptionist → Mobile client: uses
- Nurse → Mobile client: uses
- Physician → Mobile client: uses
- Web client → API client services: requests data (evidence: `README.md`)
- API client services → Authentication: calls API
- Mobile client → Mobile API service: requests data
- Mobile API service → Authentication: calls API
- Authentication → Supporting use cases: executes (evidence: `src/Vitus.API/Controllers/AuthController.cs`)
- Patient management → Supporting use cases: executes (evidence: `src/Vitus.API/Controllers/PacienteController.cs`)
- Appointment workflow → Clinical use cases: executes (evidence: `src/Vitus.API/Controllers/ConsultaController.cs`)
- Clinical use cases → Clinical entities: applies domain rules (evidence: `src/Vitus.Application/UseCases/Consultas/AguardarAtendimento/AguardarAtendimentoUseCase.cs`)
- Supporting use cases → Patient records: uses domain (evidence: `src/Vitus.Application/UseCases/Auth/Registrar/RegistrarUsuarioUseCase.cs`)
- Clinical use cases → Triage: includes (evidence: `README.md`)
- Clinical use cases → Prescriptions: includes (evidence: `README.md`)
- Clinical use cases → Exam attachments: includes (evidence: `README.md`)
- Supporting use cases → Audit logs: includes (evidence: `README.md`)
- Clinical use cases → Repositories: uses interfaces (evidence: `README.md`)
- Supporting use cases → Repositories: uses interfaces (evidence: `README.md`)
- Repositories → Relational database: reads and writes (evidence: `src/Vitus.Infrastructure/Repositories/AuditoriaRepository.cs`)
- Prescriptions → Prescription documents: generates document
- Exam attachments → Exam file storage: stores files
