# cpgabo/final-proyect-firstsem-backend architecture

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

- Interactive diagram: https://gitdiagram.com/cpgabo/final-proyect-firstsem-backend
- Repository: https://github.com/cpgabo/final-proyect-firstsem-backend

## Overview

Revista Digital is a small Express REST backend for serving and creating articles. The workflow is an HTTP request through CORS/JSON middleware to article routes, which read or update an in-memory article collection and return JSON; unmatched routes and errors receive dedicated responses. The README documents list, single-article lookup, and creation. The sampled source shows these behaviors in one file; no persistent database or separate domain modules are present.

Main entry points: [`index.js`](https://github.com/cpgabo/final-proyect-firstsem-backend/blob/main/index.js) (CORS and JSON)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP API"]
  node_middleware["CORS and JSON<br/>[index.js]"]
  node_routes["Article routes<br/>[index.js]"]
  node_fallback["404 and errors<br/>[index.js]"]
  node_server["HTTP server<br/>[index.js]"]
end

subgraph group_runtime["Article Runtime"]
  node_collection["Article collection<br/>[index.js]"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_server
node_server -->|"dispatches through"| node_middleware
node_middleware -->|"passes requests"| node_routes
node_routes -->|"reads and updates"| node_collection
node_routes -->|"returns JSON"| node_client
node_middleware -->|"unmatched requests"| node_fallback
node_server -->|"handles errors"| node_fallback

click node_middleware "https://github.com/cpgabo/final-proyect-firstsem-backend/blob/main/index.js"
click node_routes "https://github.com/cpgabo/final-proyect-firstsem-backend/blob/main/index.js"
click node_fallback "https://github.com/cpgabo/final-proyect-firstsem-backend/blob/main/index.js"
click node_collection "https://github.com/cpgabo/final-proyect-firstsem-backend/blob/main/index.js"
click node_server "https://github.com/cpgabo/final-proyect-firstsem-backend/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_middleware,node_routes,node_fallback,node_server,node_client toneBlue
class node_collection toneAmber
```

## Components

### HTTP API

- [CORS and JSON](https://github.com/cpgabo/final-proyect-firstsem-backend/blob/main/index.js): `index.js`
- [Article routes](https://github.com/cpgabo/final-proyect-firstsem-backend/blob/main/index.js): `index.js`
- [404 and errors](https://github.com/cpgabo/final-proyect-firstsem-backend/blob/main/index.js): `index.js`
- [HTTP server](https://github.com/cpgabo/final-proyect-firstsem-backend/blob/main/index.js): `index.js`

### Article Runtime

- [Article collection](https://github.com/cpgabo/final-proyect-firstsem-backend/blob/main/index.js): `index.js`

### Other components

- **API client**

## Connections

- API client → HTTP server: sends requests (evidence: `README.md`)
- HTTP server → CORS and JSON: dispatches through (evidence: `index.js`)
- CORS and JSON → Article routes: passes requests (evidence: `index.js`)
- Article routes → Article collection: reads and updates (evidence: `index.js`)
- Article routes → API client: returns JSON (evidence: `index.js`)
- CORS and JSON → 404 and errors: unmatched requests (evidence: `index.js`)
- HTTP server → 404 and errors: handles errors (evidence: `index.js`)
