# oscargilvillalta/programacion_web_evaluacion_1 architecture

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

- Interactive diagram: https://gitdiagram.com/oscargilvillalta/programacion_web_evaluacion_1
- Repository: https://github.com/oscargilvillalta/programacion_web_evaluacion_1

## Overview

This is a small Express REST API for managing company incidents. An HTTP client sends JSON requests to the server, which mounts the incident routes; those routes dispatch to controller operations that validate requests and manage incidents in process memory. The API supports creation, listing and lookup, status changes, deletion, statistics, and priority classification. The controller uses shared helpers for IDs and validation. The README documents the endpoint capabilities; the sampled implementation stores data only in an array, so persistence is not durable.

Main entry points: [`routes/incidencias.js`](https://github.com/oscargilvillalta/programacion_web_evaluacion_1/blob/main/routes/incidencias.js) (Incident routes), [`controllers/incidenciasController.js`](https://github.com/oscargilvillalta/programacion_web_evaluacion_1/blob/main/controllers/incidenciasController.js) (In-memory incidents), [`utils/helper.js`](https://github.com/oscargilvillalta/programacion_web_evaluacion_1/blob/main/utils/helper.js) (ID and validation helpers), [`app.js`](https://github.com/oscargilvillalta/programacion_web_evaluacion_1/blob/main/app.js) (Express app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["HTTP server"]
  node_app["Express app<br/>[app.js]"]
  node_routes["Incident routes<br/>[incidencias.js]"]
end

subgraph group_incident["Incident management"]
  node_create["Create incidents"]
  node_browse["List and find"]
  node_lifecycle["Update and delete"]
  node_insights["Statistics and classification"]
  node_memory[("In-memory incidents")]
end

subgraph group_shared["Shared utilities"]
  node_helpers["ID and validation helpers<br/>[helper.js]"]
end

node_client(("HTTP client"))

node_client -->|"sends requests"| node_app
node_app -->|"mounts routes"| node_routes
node_routes -->|"dispatches create"| node_create
node_routes -->|"dispatches reads"| node_browse
node_routes -->|"dispatches changes"| node_lifecycle
node_routes -->|"dispatches insights"| node_insights
node_create -->|"adds incidents"| node_memory
node_browse -->|"reads incidents"| node_memory
node_lifecycle -->|"updates incidents"| node_memory
node_insights -->|"reads incidents"| node_memory
node_create -->|"uses IDs and validation"| node_helpers
node_browse -->|"checks empty list"| node_helpers
node_lifecycle -->|"checks values"| node_helpers
node_insights -->|"checks empty list"| node_helpers

click node_app "https://github.com/oscargilvillalta/programacion_web_evaluacion_1/blob/main/app.js"
click node_routes "https://github.com/oscargilvillalta/programacion_web_evaluacion_1/blob/main/routes/incidencias.js"
click node_create "https://github.com/oscargilvillalta/programacion_web_evaluacion_1/blob/main/controllers/incidenciasController.js"
click node_browse "https://github.com/oscargilvillalta/programacion_web_evaluacion_1/blob/main/controllers/incidenciasController.js"
click node_lifecycle "https://github.com/oscargilvillalta/programacion_web_evaluacion_1/blob/main/controllers/incidenciasController.js"
click node_insights "https://github.com/oscargilvillalta/programacion_web_evaluacion_1/blob/main/controllers/incidenciasController.js"
click node_memory "https://github.com/oscargilvillalta/programacion_web_evaluacion_1/blob/main/controllers/incidenciasController.js"
click node_helpers "https://github.com/oscargilvillalta/programacion_web_evaluacion_1/blob/main/utils/helper.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_app,node_routes,node_client toneBlue
class node_create,node_browse,node_lifecycle,node_insights,node_memory toneAmber
class node_helpers toneMint
```

## Components

### HTTP server

- [Express app](https://github.com/oscargilvillalta/programacion_web_evaluacion_1/blob/main/app.js): `app.js`
- [Incident routes](https://github.com/oscargilvillalta/programacion_web_evaluacion_1/blob/main/routes/incidencias.js): `routes/incidencias.js`

### Incident management

- [Create incidents](https://github.com/oscargilvillalta/programacion_web_evaluacion_1/blob/main/controllers/incidenciasController.js): `controllers/incidenciasController.js`
- [List and find](https://github.com/oscargilvillalta/programacion_web_evaluacion_1/blob/main/controllers/incidenciasController.js): `controllers/incidenciasController.js`
- [Update and delete](https://github.com/oscargilvillalta/programacion_web_evaluacion_1/blob/main/controllers/incidenciasController.js): `controllers/incidenciasController.js`
- [Statistics and classification](https://github.com/oscargilvillalta/programacion_web_evaluacion_1/blob/main/controllers/incidenciasController.js): `controllers/incidenciasController.js`
- [In-memory incidents](https://github.com/oscargilvillalta/programacion_web_evaluacion_1/blob/main/controllers/incidenciasController.js): `controllers/incidenciasController.js`

### Shared utilities

- [ID and validation helpers](https://github.com/oscargilvillalta/programacion_web_evaluacion_1/blob/main/utils/helper.js): `utils/helper.js`

### Other components

- **HTTP client**

## Connections

- HTTP client → Express app: sends requests (evidence: `README.md`)
- Express app → Incident routes: mounts routes (evidence: `app.js`)
- Incident routes → Create incidents: dispatches create (evidence: `routes/incidencias.js`)
- Incident routes → List and find: dispatches reads (evidence: `routes/incidencias.js`)
- Incident routes → Update and delete: dispatches changes (evidence: `routes/incidencias.js`)
- Incident routes → Statistics and classification: dispatches insights (evidence: `routes/incidencias.js`)
- Create incidents → In-memory incidents: adds incidents (evidence: `controllers/incidenciasController.js`)
- List and find → In-memory incidents: reads incidents (evidence: `controllers/incidenciasController.js`)
- Update and delete → In-memory incidents: updates incidents (evidence: `controllers/incidenciasController.js`)
- Statistics and classification → In-memory incidents: reads incidents (evidence: `controllers/incidenciasController.js`)
- Create incidents → ID and validation helpers: uses IDs and validation (evidence: `controllers/incidenciasController.js`)
- List and find → ID and validation helpers: checks empty list (evidence: `controllers/incidenciasController.js`)
- Update and delete → ID and validation helpers: checks values (evidence: `controllers/incidenciasController.js`)
- Statistics and classification → ID and validation helpers: checks empty list (evidence: `controllers/incidenciasController.js`)
