# soviion/itivp architecture

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

- Interactive diagram: https://gitdiagram.com/soviion/itivp
- Repository: https://github.com/soviion/itivp

## Overview

This is a small Express clinic-appointment REST API. A client sends appointment requests to the server, which mounts the appointments router; routes dispatch to controller handlers that validate inputs and read or mutate an in-memory appointment collection, then return JSON responses. The API supports listing, status-filtered queries, lookup by ID, creation, full and partial updates, and deletion. The server also formats errors. The README is empty, so this map is based on the supplied tree and sampled source.

Main entry points: [`server.js`](https://github.com/soviion/itivp/blob/main/server.js) (Express server), [`controllers/appointmentsController.js`](https://github.com/soviion/itivp/blob/main/controllers/appointmentsController.js) (Appointment handlers), [`routes/appointments.js`](https://github.com/soviion/itivp/blob/main/routes/appointments.js) (Appointment routes), [`utils/ApiError.js`](https://github.com/soviion/itivp/blob/main/utils/ApiError.js) (API error type)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP entry"]
  node_server["Express server<br/>[server.js]"]
  node_routes["Appointment routes<br/>[appointments.js]"]
end

subgraph group_appointments["Appointments"]
  node_controller["Appointment handlers"]
  node_store[("In-memory appointments<br/>[appointments.js]")]
end

subgraph group_errors["Error handling"]
  node_apierror["API error type<br/>[ApiError.js]"]
end

node_client(("API client"))

node_client -->|"sends HTTP"| node_server
node_server -->|"mounts router"| node_routes
node_routes -->|"dispatches requests"| node_controller
node_controller -->|"reads and mutates"| node_store
node_controller -->|"throws errors"| node_apierror
node_server -->|"creates errors"| node_apierror
node_server -->|"returns JSON"| node_client

click node_server "https://github.com/soviion/itivp/blob/main/server.js"
click node_routes "https://github.com/soviion/itivp/blob/main/routes/appointments.js"
click node_controller "https://github.com/soviion/itivp/blob/main/controllers/appointmentsController.js"
click node_store "https://github.com/soviion/itivp/blob/main/models/appointments.js"
click node_apierror "https://github.com/soviion/itivp/blob/main/utils/ApiError.js"

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_server,node_routes,node_client toneBlue
class node_controller,node_store toneAmber
class node_apierror toneMint
```

## Components

### HTTP entry

- [Express server](https://github.com/soviion/itivp/blob/main/server.js): `server.js`
- [Appointment routes](https://github.com/soviion/itivp/blob/main/routes/appointments.js): `routes/appointments.js`

### Appointments

- [Appointment handlers](https://github.com/soviion/itivp/blob/main/controllers/appointmentsController.js): `controllers/appointmentsController.js`
- [In-memory appointments](https://github.com/soviion/itivp/blob/main/models/appointments.js): `models/appointments.js`

### Error handling

- [API error type](https://github.com/soviion/itivp/blob/main/utils/ApiError.js): `utils/ApiError.js`

### Other components

- **API client**

## Connections

- API client → Express server: sends HTTP
- Express server → Appointment routes: mounts router
- Appointment routes → Appointment handlers: dispatches requests
- Appointment handlers → In-memory appointments: reads and mutates
- Appointment handlers → API error type: throws errors
- Express server → API error type: creates errors
- Express server → API client: returns JSON
