# leonardogtc/a2026_sistema_de_biblioteca architecture

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

- Interactive diagram: https://gitdiagram.com/leonardogtc/a2026_sistema_de_biblioteca
- Repository: https://github.com/leonardogtc/a2026_sistema_de_biblioteca

## Overview

This is a small library-management web application. A visitor reaches the login page, authenticates through the Express server, and receives a session that gates the dashboard; the dashboard endpoint returns library metrics and recent records. The server also exposes profile, photo, and logout endpoints. Prisma connects the application to PostgreSQL. The README is empty, and the HTML files and Prisma schema were not excerpted, so their internal behavior and the broader catalog/loan workflows are not inferred.

Main entry points: [`src/server.js`](https://github.com/leonardogtc/a2026_sistema_de_biblioteca/blob/main/src/server.js) (Express server), [`src/prisma.js`](https://github.com/leonardogtc/a2026_sistema_de_biblioteca/blob/main/src/prisma.js) (Prisma client), [`public/login.html`](https://github.com/leonardogtc/a2026_sistema_de_biblioteca/blob/main/public/login.html) (Login page), [`public/dashboard.html`](https://github.com/leonardogtc/a2026_sistema_de_biblioteca/blob/main/public/dashboard.html) (Dashboard page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_server["Express server<br/>[server.js]"]
  node_login["Login page<br/>[login.html]"]
  node_dashboard["Dashboard page<br/>[dashboard.html]"]
end

subgraph group_identity["Identity and profile"]
  node_auth["Authentication and sessions<br/>[server.js]"]
  node_profile["User profile and photo<br/>[server.js]"]
end

subgraph group_library["Library data"]
  node_metrics["Dashboard metrics<br/>[server.js]"]
  node_prisma["Prisma client<br/>[prisma.js]"]
end

node_visitor(("Visitor"))
node_postgres[("PostgreSQL")]

node_visitor -->|"sends requests"| node_server
node_server -->|"serves page"| node_login
node_server -->|"serves protected page"| node_dashboard
node_server -->|"routes authentication"| node_auth
node_server -->|"routes profile requests"| node_profile
node_server -->|"routes stats requests"| node_metrics
node_auth -->|"queries users"| node_prisma
node_profile -->|"queries users"| node_prisma
node_metrics -->|"queries library records"| node_prisma
node_prisma -->|"connects through pg"| node_postgres

click node_server "https://github.com/leonardogtc/a2026_sistema_de_biblioteca/blob/main/src/server.js"
click node_login "https://github.com/leonardogtc/a2026_sistema_de_biblioteca/blob/main/public/login.html"
click node_dashboard "https://github.com/leonardogtc/a2026_sistema_de_biblioteca/blob/main/public/dashboard.html"
click node_auth "https://github.com/leonardogtc/a2026_sistema_de_biblioteca/blob/main/src/server.js"
click node_profile "https://github.com/leonardogtc/a2026_sistema_de_biblioteca/blob/main/src/server.js"
click node_metrics "https://github.com/leonardogtc/a2026_sistema_de_biblioteca/blob/main/src/server.js"
click node_prisma "https://github.com/leonardogtc/a2026_sistema_de_biblioteca/blob/main/src/prisma.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_login,node_dashboard toneBlue
class node_auth,node_profile,node_postgres toneAmber
class node_metrics,node_prisma toneMint
class node_visitor toneIndigo
```

## Components

### Web application

- [Express server](https://github.com/leonardogtc/a2026_sistema_de_biblioteca/blob/main/src/server.js): `src/server.js`
- [Login page](https://github.com/leonardogtc/a2026_sistema_de_biblioteca/blob/main/public/login.html): `public/login.html`
- [Dashboard page](https://github.com/leonardogtc/a2026_sistema_de_biblioteca/blob/main/public/dashboard.html): `public/dashboard.html`

### Identity and profile

- [Authentication and sessions](https://github.com/leonardogtc/a2026_sistema_de_biblioteca/blob/main/src/server.js): `src/server.js`
- [User profile and photo](https://github.com/leonardogtc/a2026_sistema_de_biblioteca/blob/main/src/server.js): `src/server.js`

### Library data

- [Dashboard metrics](https://github.com/leonardogtc/a2026_sistema_de_biblioteca/blob/main/src/server.js): `src/server.js`
- [Prisma client](https://github.com/leonardogtc/a2026_sistema_de_biblioteca/blob/main/src/prisma.js): `src/prisma.js`

### Other components

- **Visitor**
- **PostgreSQL**

## Connections

- Visitor → Express server: sends requests (evidence: `src/server.js`)
- Express server → Login page: serves page (evidence: `src/server.js`)
- Express server → Dashboard page: serves protected page (evidence: `src/server.js`)
- Express server → Authentication and sessions: routes authentication (evidence: `src/server.js`)
- Express server → User profile and photo: routes profile requests (evidence: `src/server.js`)
- Express server → Dashboard metrics: routes stats requests (evidence: `src/server.js`)
- Authentication and sessions → Prisma client: queries users (evidence: `src/server.js`)
- User profile and photo → Prisma client: queries users (evidence: `src/server.js`)
- Dashboard metrics → Prisma client: queries library records (evidence: `src/server.js`)
- Prisma client → PostgreSQL: connects through pg (evidence: `src/prisma.js`)
