# jlizanab/holidays_cl architecture

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

- Interactive diagram: https://gitdiagram.com/jlizanab/holidays_cl
- Repository: https://github.com/jlizanab/holidays_cl

## Overview

Es un servicio REST pequeño que consulta feriados nacionales de Chile por fecha. El flujo principal es una petición a `/festivos/:fecha`, validación de la fecha y del año disponible, búsqueda en un índice cargado desde el JSON y respuesta con los datos del feriado o `festivo: false`. README documenta también las respuestas 400 y 404 y la exclusión de feriados específicos. Las relaciones internas se basan en `index.js`; no se infieren componentes adicionales.

Main entry points: [`index.js`](https://github.com/jlizanab/holidays_cl/blob/main/index.js) (Ruta festivos), [`holidayscl.json`](https://github.com/jlizanab/holidays_cl/blob/main/holidayscl.json) (Feriados JSON)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Consulta REST"]
  node_route["Ruta festivos<br/>[index.js]"]
  node_validation["Validación fecha<br/>[index.js]"]
  node_year_check["Control de año<br/>[index.js]"]
  node_response["Respuesta JSON<br/>[index.js]"]
end

subgraph group_holiday_data["Datos de feriados"]
  node_holiday_index[("Índice por fecha<br/>[index.js]")]
  node_holiday_file["Feriados JSON<br/>[holidayscl.json]"]
end

node_client(("Cliente HTTP"))

node_client -->|"consulta"| node_route
node_route -->|"valida fecha"| node_validation
node_route -->|"comprueba año"| node_year_check
node_route -->|"busca fecha"| node_holiday_index
node_route -->|"responde JSON"| node_response
node_route -->|"carga datos"| node_holiday_file
node_holiday_file -->|"inicializa índice"| node_holiday_index

click node_route "https://github.com/jlizanab/holidays_cl/blob/main/index.js"
click node_validation "https://github.com/jlizanab/holidays_cl/blob/main/index.js"
click node_year_check "https://github.com/jlizanab/holidays_cl/blob/main/index.js"
click node_holiday_index "https://github.com/jlizanab/holidays_cl/blob/main/index.js"
click node_holiday_file "https://github.com/jlizanab/holidays_cl/blob/main/holidayscl.json"
click node_response "https://github.com/jlizanab/holidays_cl/blob/main/index.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_route,node_validation,node_year_check,node_response,node_client toneBlue
class node_holiday_index,node_holiday_file toneAmber
```

## Components

### Consulta REST

- [Ruta festivos](https://github.com/jlizanab/holidays_cl/blob/main/index.js): `index.js`
- [Validación fecha](https://github.com/jlizanab/holidays_cl/blob/main/index.js): `index.js`
- [Control de año](https://github.com/jlizanab/holidays_cl/blob/main/index.js): `index.js`
- [Respuesta JSON](https://github.com/jlizanab/holidays_cl/blob/main/index.js): `index.js`

### Datos de feriados

- [Índice por fecha](https://github.com/jlizanab/holidays_cl/blob/main/index.js): `index.js`
- [Feriados JSON](https://github.com/jlizanab/holidays_cl/blob/main/holidayscl.json): `holidayscl.json`

### Other components

- **Cliente HTTP**

## Connections

- Cliente HTTP → Ruta festivos: consulta (evidence: `README.md`)
- Ruta festivos → Validación fecha: valida fecha (evidence: `index.js`)
- Ruta festivos → Control de año: comprueba año (evidence: `index.js`)
- Ruta festivos → Índice por fecha: busca fecha (evidence: `index.js`)
- Ruta festivos → Respuesta JSON: responde JSON (evidence: `index.js`)
- Ruta festivos → Feriados JSON: carga datos (evidence: `index.js`)
- Feriados JSON → Índice por fecha: inicializa índice (evidence: `index.js`)
