# lucasosrodrigues/agenda-plus architecture

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

- Interactive diagram: https://gitdiagram.com/lucasosrodrigues/agenda-plus
- Repository: https://github.com/lucasosrodrigues/agenda-plus

## Overview

Agenda+ supports clinic appointment requests: patients browse availability and submit requests; secretaries manage slots and confirm or refuse requests. The current backend uses in-memory mock data. The README also describes medication reservations, authentication, and doctor and administrator portals, but their implementation is not represented in the sampled source or tree, so those capabilities are shown as documented, unverified subsystems. Edges reflect the sampled calls and documented API; unsampled behavior is not inferred.

Main entry points: [`backend/src/app.ts`](https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/app.ts) (Express API), [`frontend/services/solicitacoes.ts`](https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/services/solicitacoes.ts) (Request API client), [`backend/src/mocks/banco.ts`](https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/mocks/banco.ts) (Mock data store), [`frontend/services/rotas.ts`](https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/services/rotas.ts) (API paths)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_patient["Patient portal"]
  node_patient_schedule["Browse availability<br/>[page.tsx]"]
  node_patient_requests["My requests<br/>[page.tsx]"]
  node_patient_signup["Patient signup<br/>[page.tsx]"]
end

subgraph group_staff["Staff portals"]
  node_staff_schedule["Manage slots<br/>[page.tsx]"]
  node_staff_requests["Review requests<br/>[page.tsx]"]
  node_staff_team["Manage team<br/>[page.tsx]"]
  node_future_roles["Doctor and admin portals"]
  node_future_medicines["Medication reservations"]
end

subgraph group_api["API and domain services"]
  node_frontend_schedule_api["Schedule API client<br/>[horarios.ts]"]
  node_frontend_request_api["Request API client<br/>[solicitacoes.ts]"]
  node_frontend_patient_api["Patient API client<br/>[pacientes.ts]"]
  node_frontend_team_api["Team API client<br/>[equipe.ts]"]
  node_api_app["Express API<br/>[app.ts]"]
  node_schedule_routes["Schedule routes<br/>[horarios.ts]"]
  node_request_routes["Request routes<br/>[solicitacoes.ts]"]
  node_patient_routes["Patient routes<br/>[pacientes.ts]"]
  node_team_routes["Team routes<br/>[equipe.ts]"]
  node_schedule_service["Schedule rules<br/>[horarios.ts]"]
  node_request_service["Request rules<br/>[solicitacoes.ts]"]
  node_patient_service["Patient registration<br/>[pacientes.ts]"]
  node_team_service["Team registration<br/>[equipe.ts]"]
end

subgraph group_state["Runtime state and contracts"]
  node_memory_store[("Mock data store<br/>[banco.ts]")]
  node_shared_types["Agenda types<br/>[agenda.ts]"]
  node_api_paths["API paths<br/>[rotas.ts]"]
end

node_patient_actor(("Patient"))
node_secretary_actor(("Secretary"))

node_patient_actor -->|"browses"| node_patient_schedule
node_patient_schedule -->|"loads availability"| node_frontend_schedule_api
node_patient_schedule -->|"submits request"| node_frontend_request_api
node_patient_actor -->|"tracks requests"| node_patient_requests
node_patient_requests -->|"loads requests"| node_frontend_request_api
node_patient_actor -->|"registers"| node_patient_signup
node_patient_signup -->|"sends registration"| node_frontend_patient_api
node_secretary_actor -->|"manages slots"| node_staff_schedule
node_staff_schedule -->|"manages availability"| node_frontend_schedule_api
node_secretary_actor -->|"reviews requests"| node_staff_requests
node_staff_requests -->|"decides requests"| node_frontend_request_api
node_staff_team -->|"registers staff"| node_frontend_team_api
node_frontend_schedule_api -->|"uses paths"| node_api_paths
node_frontend_request_api -->|"uses paths"| node_api_paths
node_frontend_patient_api -->|"uses paths"| node_api_paths
node_frontend_team_api -->|"uses paths"| node_api_paths
node_api_app -->|"mounts routes"| node_schedule_routes
node_api_app -->|"mounts routes"| node_request_routes
node_api_app -->|"mounts routes"| node_patient_routes
node_api_app -->|"mounts routes"| node_team_routes
node_schedule_routes -->|"calls"| node_schedule_service
node_request_routes -->|"calls"| node_request_service
node_patient_routes -->|"calls"| node_patient_service
node_team_routes -->|"calls"| node_team_service
node_schedule_service -->|"reads and updates"| node_memory_store
node_request_service -->|"reads and updates"| node_memory_store
node_patient_service -->|"reads and updates"| node_memory_store
node_team_service -->|"reads and updates"| node_memory_store
node_future_roles -.->|"documented portals"| node_secretary_actor
node_future_medicines -.->|"documented capability"| node_secretary_actor

click node_patient_schedule "https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/app/horarios/page.tsx"
click node_patient_requests "https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/app/solicitacoes/page.tsx"
click node_patient_signup "https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/app/cadastro/page.tsx"
click node_staff_schedule "https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/app/gerenciamento/horarios/page.tsx"
click node_staff_requests "https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/app/gerenciamento/solicitacoes/page.tsx"
click node_staff_team "https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/app/administracao/equipe/page.tsx"
click node_frontend_schedule_api "https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/services/horarios.ts"
click node_frontend_request_api "https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/services/solicitacoes.ts"
click node_frontend_patient_api "https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/services/pacientes.ts"
click node_frontend_team_api "https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/services/equipe.ts"
click node_api_app "https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/app.ts"
click node_schedule_routes "https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/routes/horarios.ts"
click node_request_routes "https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/routes/solicitacoes.ts"
click node_patient_routes "https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/routes/pacientes.ts"
click node_team_routes "https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/routes/equipe.ts"
click node_schedule_service "https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/services/horarios.ts"
click node_request_service "https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/services/solicitacoes.ts"
click node_patient_service "https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/services/pacientes.ts"
click node_team_service "https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/services/equipe.ts"
click node_memory_store "https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/mocks/banco.ts"
click node_shared_types "https://github.com/lucasosrodrigues/agenda-plus/blob/main/shared/agenda.ts"
click node_api_paths "https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/services/rotas.ts"

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_patient_schedule,node_patient_requests,node_patient_signup toneBlue
class node_staff_schedule,node_staff_requests,node_staff_team,node_future_roles,node_future_medicines toneAmber
class node_frontend_schedule_api,node_frontend_request_api,node_frontend_patient_api,node_frontend_team_api,node_api_app,node_schedule_routes,node_request_routes,node_patient_routes,node_team_routes,node_schedule_service,node_request_service,node_patient_service,node_team_service toneMint
class node_memory_store,node_shared_types,node_api_paths toneRose
class node_patient_actor,node_secretary_actor toneIndigo
```

## Components

### Patient portal

- [Browse availability](https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/app/horarios/page.tsx): `frontend/app/horarios/page.tsx`
- [My requests](https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/app/solicitacoes/page.tsx): `frontend/app/solicitacoes/page.tsx`
- [Patient signup](https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/app/cadastro/page.tsx): `frontend/app/cadastro/page.tsx`

### Staff portals

- [Manage slots](https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/app/gerenciamento/horarios/page.tsx): `frontend/app/gerenciamento/horarios/page.tsx`
- [Review requests](https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/app/gerenciamento/solicitacoes/page.tsx): `frontend/app/gerenciamento/solicitacoes/page.tsx`
- [Manage team](https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/app/administracao/equipe/page.tsx): `frontend/app/administracao/equipe/page.tsx`
- **Doctor and admin portals**
- **Medication reservations**

### API and domain services

- [Schedule API client](https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/services/horarios.ts): `frontend/services/horarios.ts`
- [Request API client](https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/services/solicitacoes.ts): `frontend/services/solicitacoes.ts`
- [Patient API client](https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/services/pacientes.ts): `frontend/services/pacientes.ts`
- [Team API client](https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/services/equipe.ts): `frontend/services/equipe.ts`
- [Express API](https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Schedule routes](https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/routes/horarios.ts): `backend/src/routes/horarios.ts`
- [Request routes](https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/routes/solicitacoes.ts): `backend/src/routes/solicitacoes.ts`
- [Patient routes](https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/routes/pacientes.ts): `backend/src/routes/pacientes.ts`
- [Team routes](https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/routes/equipe.ts): `backend/src/routes/equipe.ts`
- [Schedule rules](https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/services/horarios.ts): `backend/src/services/horarios.ts`
- [Request rules](https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/services/solicitacoes.ts): `backend/src/services/solicitacoes.ts`
- [Patient registration](https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/services/pacientes.ts): `backend/src/services/pacientes.ts`
- [Team registration](https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/services/equipe.ts): `backend/src/services/equipe.ts`

### Runtime state and contracts

- [Mock data store](https://github.com/lucasosrodrigues/agenda-plus/blob/main/backend/src/mocks/banco.ts): `backend/src/mocks/banco.ts`
- [Agenda types](https://github.com/lucasosrodrigues/agenda-plus/blob/main/shared/agenda.ts): `shared/agenda.ts`
- [API paths](https://github.com/lucasosrodrigues/agenda-plus/blob/main/frontend/services/rotas.ts): `frontend/services/rotas.ts`

### Other components

- **Patient**
- **Secretary**

## Connections

- Patient → Browse availability: browses (evidence: `readme.md`)
- Browse availability → Schedule API client: loads availability (evidence: `frontend/app/horarios/page.tsx`)
- Browse availability → Request API client: submits request (evidence: `frontend/app/horarios/page.tsx`)
- Patient → My requests: tracks requests (evidence: `readme.md`)
- My requests → Request API client: loads requests (evidence: `frontend/services/solicitacoes.ts`)
- Patient → Patient signup: registers (evidence: `frontend/app/cadastro/page.tsx`)
- Patient signup → Patient API client: sends registration (evidence: `frontend/app/cadastro/page.tsx`)
- Secretary → Manage slots: manages slots (evidence: `readme.md`)
- Manage slots → Schedule API client: manages availability (evidence: `frontend/app/gerenciamento/horarios/page.tsx`)
- Secretary → Review requests: reviews requests (evidence: `readme.md`)
- Review requests → Request API client: decides requests (evidence: `frontend/app/gerenciamento/solicitacoes/page.tsx`)
- Manage team → Team API client: registers staff (evidence: `frontend/app/administracao/equipe/page.tsx`)
- Schedule API client → API paths: uses paths (evidence: `frontend/services/horarios.ts`)
- Request API client → API paths: uses paths (evidence: `frontend/services/solicitacoes.ts`)
- Patient API client → API paths: uses paths (evidence: `frontend/services/pacientes.ts`)
- Team API client → API paths: uses paths (evidence: `frontend/services/equipe.ts`)
- Express API → Schedule routes: mounts routes (evidence: `backend/src/app.ts`)
- Express API → Request routes: mounts routes (evidence: `backend/src/app.ts`)
- Express API → Patient routes: mounts routes (evidence: `backend/src/app.ts`)
- Express API → Team routes: mounts routes (evidence: `backend/src/app.ts`)
- Schedule routes → Schedule rules: calls (evidence: `backend/src/routes/horarios.ts`)
- Request routes → Request rules: calls (evidence: `backend/src/routes/solicitacoes.ts`)
- Patient routes → Patient registration: calls (evidence: `backend/src/routes/pacientes.ts`)
- Team routes → Team registration: calls (evidence: `backend/src/routes/equipe.ts`)
- Schedule rules → Mock data store: reads and updates (evidence: `backend/src/services/horarios.ts`)
- Request rules → Mock data store: reads and updates (evidence: `backend/src/services/solicitacoes.ts`)
- Patient registration → Mock data store: reads and updates (evidence: `backend/src/services/pacientes.ts`)
- Team registration → Mock data store: reads and updates (evidence: `backend/src/services/equipe.ts`)
- Doctor and admin portals → Secretary: documented portals (evidence: `readme.md`)
- Medication reservations → Secretary: documented capability (evidence: `readme.md`)
