# jesshdzz/sistema-bibliotecario architecture

> Architecture diagram of the GitHub repository jesshdzz/sistema-bibliotecario, 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/jesshdzz/sistema-bibliotecario
- Repository: https://github.com/jesshdzz/sistema-bibliotecario

## Overview

Sistema Bibliotecario is a university library-loan prototype: students are intended to request loans, while librarians manage inventory and circulation. The README describes that workflow, but the sampled repository has no catalog or loan pages, handlers, or business operations; its demo data explicitly bypasses the database and sessions. The graph therefore distinguishes documented product stages from implemented demo/schema layers. Relationships are limited to visible imports and README statements; unsampled UI behavior is not inferred.

Main entry points: [`src/lib/datos-demo.ts`](https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/lib/datos-demo.ts) (Demo records), [`src/db/schema/dominio.ts`](https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/db/schema/dominio.ts) (Loan circulation), [`src/db/schema/auth.ts`](https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/db/schema/auth.ts) (Users and sessions), [`src/db/index.ts`](https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/db/index.ts) (Drizzle client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_app_shell["App shell<br/>[layout.tsx]"]
  node_shared_ui["Shared UI<br/>[pagina.tsx]"]
  node_service_links["Service links<br/>[footer.tsx]"]
  node_status_badges["Status badges"]
end

subgraph group_library["Library domain"]
  node_catalog["Catalog search<br/>[datos-demo.ts]"]
  node_inventory["Titles and copies<br/>[dominio.ts]"]
  node_loan_circulation["Loan circulation<br/>[dominio.ts]"]
  node_policy["Loan parameters<br/>[dominio.ts]"]
  node_demo_records["Demo records<br/>[datos-demo.ts]"]
  node_fines_stats["Fines and statistics<br/>[datos-demo.ts]"]
end

subgraph group_identity["Identity and persistence"]
  node_auth_schema[("Users and sessions<br/>[auth.ts]")]
  node_db_client["Drizzle client<br/>[index.ts]"]
  node_postgres[("PostgreSQL")]
end

subgraph group_operations["Service operations"]
  node_health["Health endpoint<br/>[route.ts]"]
end

node_student(("Student"))
node_librarian(("Librarian"))

node_student -.->|"requests discovery"| node_catalog
node_student -.->|"requests loans"| node_loan_circulation
node_librarian -.->|"manages inventory"| node_inventory
node_librarian -.->|"controls circulation"| node_loan_circulation
node_app_shell -.->|"hosts interface"| node_shared_ui
node_service_links -->|"reads schedule"| node_demo_records
node_status_badges -->|"uses status types"| node_demo_records
node_demo_records -->|"provides sample catalog"| node_catalog
node_demo_records -->|"provides sample loans"| node_loan_circulation
node_demo_records -->|"includes sample aggregates"| node_fines_stats
node_demo_records -->|"imports domain types"| node_inventory
node_db_client -->|"loads schema"| node_auth_schema
node_db_client -->|"connects through pool"| node_postgres
node_inventory -->|"references users"| node_auth_schema
node_loan_circulation -->|"references copies"| node_inventory
node_loan_circulation -->|"references borrowers"| node_auth_schema
node_policy -->|"records editor"| node_auth_schema

click node_app_shell "https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/app/layout.tsx"
click node_shared_ui "https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/components/pagina.tsx"
click node_service_links "https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/components/footer.tsx"
click node_status_badges "https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/components/insignia-estado.tsx"
click node_catalog "https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/lib/datos-demo.ts"
click node_inventory "https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/db/schema/dominio.ts"
click node_loan_circulation "https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/db/schema/dominio.ts"
click node_policy "https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/db/schema/dominio.ts"
click node_demo_records "https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/lib/datos-demo.ts"
click node_fines_stats "https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/lib/datos-demo.ts"
click node_auth_schema "https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/db/schema/auth.ts"
click node_db_client "https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/db/index.ts"
click node_health "https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/app/api/health/route.ts"

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_shell,node_shared_ui,node_service_links,node_status_badges toneBlue
class node_catalog,node_inventory,node_loan_circulation,node_policy,node_demo_records,node_fines_stats toneAmber
class node_auth_schema,node_db_client,node_postgres toneMint
class node_health toneRose
class node_student,node_librarian toneIndigo
```

## Components

### Web experience

- [App shell](https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/app/layout.tsx): `src/app/layout.tsx`
- [Shared UI](https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/components/pagina.tsx): `src/components/pagina.tsx`
- [Service links](https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/components/footer.tsx): `src/components/footer.tsx`
- [Status badges](https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/components/insignia-estado.tsx): `src/components/insignia-estado.tsx`

### Library domain

- [Catalog search](https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/lib/datos-demo.ts): `src/lib/datos-demo.ts`
- [Titles and copies](https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/db/schema/dominio.ts): `src/db/schema/dominio.ts`
- [Loan circulation](https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/db/schema/dominio.ts): `src/db/schema/dominio.ts`
- [Loan parameters](https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/db/schema/dominio.ts): `src/db/schema/dominio.ts`
- [Demo records](https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/lib/datos-demo.ts): `src/lib/datos-demo.ts`
- [Fines and statistics](https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/lib/datos-demo.ts): `src/lib/datos-demo.ts`

### Identity and persistence

- [Users and sessions](https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/db/schema/auth.ts): `src/db/schema/auth.ts`
- [Drizzle client](https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/db/index.ts): `src/db/index.ts`
- **PostgreSQL**

### Service operations

- [Health endpoint](https://github.com/jesshdzz/sistema-bibliotecario/blob/main/src/app/api/health/route.ts): `src/app/api/health/route.ts`

### Other components

- **Student**
- **Librarian**

## Connections

- Student → Catalog search: requests discovery (evidence: `README.md`)
- Student → Loan circulation: requests loans (evidence: `README.md`)
- Librarian → Titles and copies: manages inventory (evidence: `README.md`)
- Librarian → Loan circulation: controls circulation (evidence: `README.md`)
- App shell → Shared UI: hosts interface
- Service links → Demo records: reads schedule (evidence: `src/components/footer.tsx`)
- Status badges → Demo records: uses status types (evidence: `src/components/insignia-estado.tsx`)
- Demo records → Catalog search: provides sample catalog (evidence: `src/lib/datos-demo.ts`)
- Demo records → Loan circulation: provides sample loans (evidence: `src/lib/datos-demo.ts`)
- Demo records → Fines and statistics: includes sample aggregates (evidence: `src/lib/datos-demo.ts`)
- Demo records → Titles and copies: imports domain types (evidence: `src/lib/datos-demo.ts`)
- Drizzle client → Users and sessions: loads schema (evidence: `src/db/index.ts`)
- Drizzle client → PostgreSQL: connects through pool (evidence: `src/db/index.ts`)
- Titles and copies → Users and sessions: references users (evidence: `src/db/schema/dominio.ts`)
- Loan circulation → Titles and copies: references copies (evidence: `src/db/schema/dominio.ts`)
- Loan circulation → Users and sessions: references borrowers (evidence: `src/db/schema/dominio.ts`)
- Loan parameters → Users and sessions: records editor (evidence: `src/db/schema/dominio.ts`)
