# andersson1901/login-jsp architecture

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

- Interactive diagram: https://gitdiagram.com/andersson1901/login-jsp
- Repository: https://github.com/andersson1901/login-jsp

## Overview

This Java web application manages a small business’s customers, suppliers, products, purchase requests, sales, and associated documents. The main workflow runs through the sales servlet: it accepts a request, uses repositories to create or manage a sale, and the JDBC layer performs transactional persistence and stock operations. The graph also preserves authentication, catalog administration, reporting, and sale-change notifications. The source index and excerpts show selected wiring; unsampled servlet and repository behavior is represented only where paths are supported, and uncertain links are omitted.

Main entry points: [`src/controlador/VentaServlet.java`](https://github.com/andersson1901/login-jsp/blob/main/src/controlador/VentaServlet.java) (Sales operations), [`src/repositorio/VentaRepositoryJDBC.java`](https://github.com/andersson1901/login-jsp/blob/main/src/repositorio/VentaRepositoryJDBC.java) (Sale repository), [`src/repositorio/Repositorios.java`](https://github.com/andersson1901/login-jsp/blob/main/src/repositorio/Repositorios.java) (Repository factory), [`src/repositorio/OperacionVentaJDBC.java`](https://github.com/andersson1901/login-jsp/blob/main/src/repositorio/OperacionVentaJDBC.java) (Sale transactions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web and access"]
  node_auth["User access"]
  node_session["Session guard<br/>[SesionFilter.java]"]
  node_webutil["Request utilities<br/>[Web.java]"]
end

subgraph group_catalog["Business records"]
  node_clients["Client management"]
  node_products["Product management"]
  node_catalogother["Catalog and supplier routes"]
  node_records["Customer and product records"]
end

subgraph group_sales["Sales workflow"]
  node_salesentry["Sales operations<br/>[VentaServlet.java]"]
  node_sale["Sale repository"]
  node_request["Purchase requests"]
  node_saleops["Sale transactions"]
  node_saleentities["Sale and detail models<br/>[Venta.java]"]
  node_documents["Sales documents"]
  node_guides["Dispatch guides"]
  node_summary["Business summaries"]
end

subgraph group_persistence["Persistence"]
  node_registry["Repository factory<br/>[Repositorios.java]"]
  node_dbconnection["JDBC connection<br/>[ConexionBD.java]"]
  node_database[("MariaDB")]
end

subgraph group_events["Notifications"]
  node_eventsubject["Sale event subject<br/>[SujetoVenta.java]"]
  node_owneralert["Owner notifier"]
  node_notifications["Notification storage"]
  node_eventmodel["Sale event<br/>[EventoVenta.java]"]
end

node_user(("Business user"))

node_user -.->|"submits requests"| node_auth
node_user -.->|"submits requests"| node_salesentry
node_auth -->|"obtains repositories"| node_registry
node_auth -->|"validates input"| node_webutil
node_session -->|"obtains users"| node_registry
node_clients -->|"obtains repositories"| node_registry
node_clients -->|"uses request helpers"| node_webutil
node_products -->|"obtains repositories"| node_registry
node_products -->|"uses request helpers"| node_webutil
node_catalogother -.->|"obtains repositories"| node_registry
node_salesentry -->|"obtains repositories"| node_registry
node_salesentry -->|"uses request helpers"| node_webutil
node_salesentry -->|"uses requests"| node_request
node_salesentry -->|"uses sales"| node_sale
node_salesentry -->|"uses receipts"| node_documents
node_salesentry -->|"uses guides"| node_guides
node_salesentry -->|"uses customer and product models"| node_records
node_registry -->|"constructs JDBC adapter"| node_sale
node_registry -->|"constructs JDBC adapter"| node_summary
node_sale -->|"runs transactions"| node_saleops
node_sale -->|"loads requests"| node_request
node_sale -->|"notifies changes"| node_eventsubject
node_documents -->|"runs transactions"| node_saleops
node_documents -->|"checks sale status"| node_sale
node_guides -->|"runs transactions"| node_saleops
node_guides -->|"checks sale status"| node_sale
node_saleops -->|"opens connections"| node_dbconnection
node_request -->|"opens connections"| node_dbconnection
node_sale -->|"maps sale data"| node_saleentities
node_dbconnection -->|"connects to"| node_database
node_eventsubject -->|"dispatches events"| node_owneralert
node_owneralert -->|"uses notification repository"| node_notifications
node_owneralert -->|"reads event"| node_eventmodel

click node_auth "https://github.com/andersson1901/login-jsp/blob/main/src/controlador/UsuarioServlet.java"
click node_session "https://github.com/andersson1901/login-jsp/blob/main/src/filtro/SesionFilter.java"
click node_webutil "https://github.com/andersson1901/login-jsp/blob/main/src/util/Web.java"
click node_clients "https://github.com/andersson1901/login-jsp/blob/main/src/controlador/ClienteServlet.java"
click node_products "https://github.com/andersson1901/login-jsp/blob/main/src/controlador/ProductoServlet.java"
click node_catalogother "https://github.com/andersson1901/login-jsp/tree/main/src/controlador"
click node_records "https://github.com/andersson1901/login-jsp/tree/main/src/modelo"
click node_salesentry "https://github.com/andersson1901/login-jsp/blob/main/src/controlador/VentaServlet.java"
click node_sale "https://github.com/andersson1901/login-jsp/blob/main/src/repositorio/VentaRepositoryJDBC.java"
click node_request "https://github.com/andersson1901/login-jsp/blob/main/src/repositorio/SolpedRepositoryJDBC.java"
click node_saleops "https://github.com/andersson1901/login-jsp/blob/main/src/repositorio/OperacionVentaJDBC.java"
click node_saleentities "https://github.com/andersson1901/login-jsp/blob/main/src/modelo/Venta.java"
click node_documents "https://github.com/andersson1901/login-jsp/blob/main/src/repositorio/ComprobanteRepositoryJDBC.java"
click node_guides "https://github.com/andersson1901/login-jsp/blob/main/src/repositorio/GuiaRepositoryJDBC.java"
click node_summary "https://github.com/andersson1901/login-jsp/blob/main/src/repositorio/ResumenRepositoryJDBC.java"
click node_registry "https://github.com/andersson1901/login-jsp/blob/main/src/repositorio/Repositorios.java"
click node_dbconnection "https://github.com/andersson1901/login-jsp/blob/main/src/conexion/ConexionBD.java"
click node_eventsubject "https://github.com/andersson1901/login-jsp/blob/main/src/observador/SujetoVenta.java"
click node_owneralert "https://github.com/andersson1901/login-jsp/blob/main/src/observador/NotificadorDueno.java"
click node_notifications "https://github.com/andersson1901/login-jsp/blob/main/src/repositorio/NotificacionRepositoryJDBC.java"
click node_eventmodel "https://github.com/andersson1901/login-jsp/blob/main/src/observador/EventoVenta.java"

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_auth,node_session,node_webutil,node_user toneBlue
class node_clients,node_products,node_catalogother,node_records toneAmber
class node_salesentry,node_sale,node_request,node_saleops,node_saleentities,node_documents,node_guides,node_summary toneMint
class node_registry,node_dbconnection,node_database toneRose
class node_eventsubject,node_owneralert,node_notifications,node_eventmodel toneIndigo
```

## Components

### Web and access

- [User access](https://github.com/andersson1901/login-jsp/blob/main/src/controlador/UsuarioServlet.java): `src/controlador/UsuarioServlet.java`
- [Session guard](https://github.com/andersson1901/login-jsp/blob/main/src/filtro/SesionFilter.java): `src/filtro/SesionFilter.java`
- [Request utilities](https://github.com/andersson1901/login-jsp/blob/main/src/util/Web.java): `src/util/Web.java`

### Business records

- [Client management](https://github.com/andersson1901/login-jsp/blob/main/src/controlador/ClienteServlet.java): `src/controlador/ClienteServlet.java`
- [Product management](https://github.com/andersson1901/login-jsp/blob/main/src/controlador/ProductoServlet.java): `src/controlador/ProductoServlet.java`
- [Catalog and supplier routes](https://github.com/andersson1901/login-jsp/tree/main/src/controlador): `src/controlador`
- [Customer and product records](https://github.com/andersson1901/login-jsp/tree/main/src/modelo): `src/modelo`

### Sales workflow

- [Sales operations](https://github.com/andersson1901/login-jsp/blob/main/src/controlador/VentaServlet.java): `src/controlador/VentaServlet.java`
- [Sale repository](https://github.com/andersson1901/login-jsp/blob/main/src/repositorio/VentaRepositoryJDBC.java): `src/repositorio/VentaRepositoryJDBC.java`
- [Purchase requests](https://github.com/andersson1901/login-jsp/blob/main/src/repositorio/SolpedRepositoryJDBC.java): `src/repositorio/SolpedRepositoryJDBC.java`
- [Sale transactions](https://github.com/andersson1901/login-jsp/blob/main/src/repositorio/OperacionVentaJDBC.java): `src/repositorio/OperacionVentaJDBC.java`
- [Sale and detail models](https://github.com/andersson1901/login-jsp/blob/main/src/modelo/Venta.java): `src/modelo/Venta.java`
- [Sales documents](https://github.com/andersson1901/login-jsp/blob/main/src/repositorio/ComprobanteRepositoryJDBC.java): `src/repositorio/ComprobanteRepositoryJDBC.java`
- [Dispatch guides](https://github.com/andersson1901/login-jsp/blob/main/src/repositorio/GuiaRepositoryJDBC.java): `src/repositorio/GuiaRepositoryJDBC.java`
- [Business summaries](https://github.com/andersson1901/login-jsp/blob/main/src/repositorio/ResumenRepositoryJDBC.java): `src/repositorio/ResumenRepositoryJDBC.java`

### Persistence

- [Repository factory](https://github.com/andersson1901/login-jsp/blob/main/src/repositorio/Repositorios.java): `src/repositorio/Repositorios.java`
- [JDBC connection](https://github.com/andersson1901/login-jsp/blob/main/src/conexion/ConexionBD.java): `src/conexion/ConexionBD.java`
- **MariaDB**

### Notifications

- [Sale event subject](https://github.com/andersson1901/login-jsp/blob/main/src/observador/SujetoVenta.java): `src/observador/SujetoVenta.java`
- [Owner notifier](https://github.com/andersson1901/login-jsp/blob/main/src/observador/NotificadorDueno.java): `src/observador/NotificadorDueno.java`
- [Notification storage](https://github.com/andersson1901/login-jsp/blob/main/src/repositorio/NotificacionRepositoryJDBC.java): `src/repositorio/NotificacionRepositoryJDBC.java`
- [Sale event](https://github.com/andersson1901/login-jsp/blob/main/src/observador/EventoVenta.java): `src/observador/EventoVenta.java`

### Other components

- **Business user**

## Connections

- Business user → User access: submits requests
- Business user → Sales operations: submits requests
- User access → Repository factory: obtains repositories (evidence: `src/controlador/UsuarioServlet.java`)
- User access → Request utilities: validates input (evidence: `src/controlador/UsuarioServlet.java`)
- Session guard → Repository factory: obtains users (evidence: `src/filtro/SesionFilter.java`)
- Client management → Repository factory: obtains repositories (evidence: `src/controlador/ClienteServlet.java`)
- Client management → Request utilities: uses request helpers (evidence: `src/controlador/ClienteServlet.java`)
- Product management → Repository factory: obtains repositories (evidence: `src/controlador/ProductoServlet.java`)
- Product management → Request utilities: uses request helpers (evidence: `src/controlador/ProductoServlet.java`)
- Catalog and supplier routes → Repository factory: obtains repositories (evidence: `src/controlador/ClienteServlet.java`)
- Sales operations → Repository factory: obtains repositories (evidence: `src/controlador/VentaServlet.java`)
- Sales operations → Request utilities: uses request helpers (evidence: `src/controlador/VentaServlet.java`)
- Sales operations → Purchase requests: uses requests (evidence: `src/controlador/VentaServlet.java`)
- Sales operations → Sale repository: uses sales (evidence: `src/controlador/VentaServlet.java`)
- Sales operations → Sales documents: uses receipts (evidence: `src/controlador/VentaServlet.java`)
- Sales operations → Dispatch guides: uses guides (evidence: `src/controlador/VentaServlet.java`)
- Sales operations → Customer and product records: uses customer and product models (evidence: `src/controlador/VentaServlet.java`)
- Repository factory → Sale repository: constructs JDBC adapter (evidence: `src/repositorio/Repositorios.java`)
- Repository factory → Business summaries: constructs JDBC adapter (evidence: `src/repositorio/Repositorios.java`)
- Sale repository → Sale transactions: runs transactions (evidence: `src/repositorio/VentaRepositoryJDBC.java`)
- Sale repository → Purchase requests: loads requests (evidence: `src/repositorio/VentaRepositoryJDBC.java`)
- Sale repository → Sale event subject: notifies changes (evidence: `src/repositorio/VentaRepositoryJDBC.java`)
- Sales documents → Sale transactions: runs transactions (evidence: `src/repositorio/ComprobanteRepositoryJDBC.java`)
- Sales documents → Sale repository: checks sale status (evidence: `src/repositorio/ComprobanteRepositoryJDBC.java`)
- Dispatch guides → Sale transactions: runs transactions (evidence: `src/repositorio/GuiaRepositoryJDBC.java`)
- Dispatch guides → Sale repository: checks sale status (evidence: `src/repositorio/GuiaRepositoryJDBC.java`)
- Sale transactions → JDBC connection: opens connections (evidence: `src/repositorio/OperacionVentaJDBC.java`)
- Purchase requests → JDBC connection: opens connections (evidence: `src/repositorio/SolpedRepositoryJDBC.java`)
- Sale repository → Sale and detail models: maps sale data (evidence: `src/repositorio/VentaRepositoryJDBC.java`)
- JDBC connection → MariaDB: connects to (evidence: `src/conexion/ConexionBD.java`)
- Sale event subject → Owner notifier: dispatches events (evidence: `src/observador/SujetoVenta.java`)
- Owner notifier → Notification storage: uses notification repository (evidence: `src/observador/NotificadorDueno.java`)
- Owner notifier → Sale event: reads event (evidence: `src/observador/NotificadorDueno.java`)
