# moralesruizbrayan-create/avantiforms architecture

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

- Interactive diagram: https://gitdiagram.com/moralesruizbrayan-create/avantiforms
- Repository: https://github.com/moralesruizbrayan-create/avantiforms

## Overview

#### Purpose and Entry Points
AvantiForms manages IT equipment handover records (“Actas de Entrega”) and related employee/inventory data. The browser entry points are `index.html`, `login.html`, `dashboard.html`, `gestion-actas.html`, `inventario.html`, and `admin-empleados.html`. Shared client behavior is concentrated in `app.js` with presentation in `styles.css`.

#### Frontend Application Shell
The HTML pages represent distinct operational views rather than a single documented SPA:
- Authentication starts at `login.html`.
- Operational navigation and summary likely begin at `dashboard.html`.
- Equipment delivery record creation/management is handled by `gestion-actas.html`.
- Asset and employee administration are exposed through `inventario.html` and `admin-empleados.html`.
- `app.js` is the primary browser-side integration boundary to the API.

#### Authentication Boundary
`api/auth.js` provides the backend authentication endpoint consumed by the login flow. It is a distinct security boundary between unauthenticated UI (`login.html`) and the administration/operations pages (`dashboard.html`, `admin-empleados.html`).

#### Employee and Equipment Domains
The API separates people and assigned assets:
- Employee CRUD/query behavior is represented by `api/empleados.js`.
- Equipment lookup or assignment retrieval is represented by `api/obtener-equipo.js`.
- Employee administration is surfaced in `admin-empleados.html`; inventory operations in `inventario.html`.

This separation supports assembling a handover record from an employee identity plus one or more equipment details.

#### Handover-Record Workflow
The core business transaction is persisting an equipment-delivery certificate through `api/guardar-acta.js`, with `gestion-actas.html` as its corresponding UI. The expected flow is: user selects or supplies employee data, resolves equipment through `api/obtener-equipo.js`, submits the completed acta to `api/guardar-acta.js`, and returns to dashboard-level operational views.

#### Dashboard and Metrics Flow
`dashboard.html` presents aggregated operational information obtained through `api/obtener-metricas.js`. This endpoint is a reporting/read-model boundary, keeping metrics retrieval separate from transactional acta creation in `api/guardar-acta.js`.

#### Record Removal and Runtime
`api/eliminar-registro.js` provides destructive record-management capability and should be treated as an authorization-sensitive endpoint alongside `api/auth.js`. The repository uses JavaScript/HTML/CSS for the client and API handlers under `api/`; `package.json` indicates a Node.js runtime/dependency boundary, while `requirements.txt` indicates an additional Python-based runtime or service dependency. No database or third-party service is identified in the provided files.

Main entry points: [`app.js`](https://github.com/moralesruizbrayan-create/avantiforms/blob/main/app.js) (Client integration), [`dashboard.html`](https://github.com/moralesruizbrayan-create/avantiforms/blob/main/dashboard.html) (Dashboard), [`api/guardar-acta.js`](https://github.com/moralesruizbrayan-create/avantiforms/blob/main/api/guardar-acta.js) (Persist acta), [`login.html`](https://github.com/moralesruizbrayan-create/avantiforms/blob/main/login.html) (Login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser application"]
  node_landing["Landing page<br/>HTML entry<br/>[index.html]"]
  node_login["Login<br/>unauthenticated view<br/>[login.html]"]
  node_dashboard["Dashboard<br/>operations view<br/>[dashboard.html]"]
  node_actas["Acta management<br/>handover view<br/>[gestion-actas.html]"]
  node_inventory["Inventory<br/>asset view<br/>[inventario.html]"]
  node_employee_admin["Employee administration<br/>employee view"]
  node_app_js["Client integration<br/>shared browser logic<br/>[app.js]"]
  node_styles["Shared styles<br/>CSS presentation<br/>[styles.css]"]
end

subgraph group_api["Node API handlers"]
  node_auth_api{{"Authentication<br/>security endpoint<br/>[auth.js]"}}
  node_employees_api["Employees<br/>CRUD/query endpoint<br/>[empleados.js]"]
  node_equipment_api["Equipment lookup<br/>asset endpoint<br/>[obtener-equipo.js]"]
  node_save_acta_api["Persist acta<br/>transaction endpoint<br/>[guardar-acta.js]"]
  node_metrics_api["Operational metrics<br/>reporting endpoint"]
  node_delete_api{{"Remove record<br/>destructive endpoint"}}
end

subgraph group_runtime["Runtime boundaries"]
  node_node_runtime["Node.js dependencies<br/>runtime manifest<br/>[package.json]"]
  node_python_runtime["Python dependencies<br/>runtime manifest<br/>[requirements.txt]"]
end

node_landing -->|"starts authentication"| node_login
node_login -->|"uses"| node_app_js
node_app_js -->|"authenticates"| node_auth_api
node_auth_api -.->|"grants access to"| node_dashboard
node_dashboard -->|"uses"| node_app_js
node_actas -->|"uses"| node_app_js
node_inventory -->|"uses"| node_app_js
node_employee_admin -->|"uses"| node_app_js
node_app_js -->|"loads metrics"| node_metrics_api
node_app_js -->|"manages employees"| node_employees_api
node_app_js -->|"resolves equipment"| node_equipment_api
node_app_js -->|"submits acta"| node_save_acta_api
node_app_js -->|"removes records"| node_delete_api
node_employees_api -.->|"supplies employee identity"| node_save_acta_api
node_equipment_api -.->|"supplies equipment details"| node_save_acta_api
node_save_acta_api -.->|"returns to operations"| node_dashboard
node_node_runtime -.->|"hosts handlers"| node_auth_api
node_styles -.->|"styles"| node_login
node_styles -.->|"styles"| node_dashboard

click node_landing "https://github.com/moralesruizbrayan-create/avantiforms/blob/main/index.html"
click node_login "https://github.com/moralesruizbrayan-create/avantiforms/blob/main/login.html"
click node_dashboard "https://github.com/moralesruizbrayan-create/avantiforms/blob/main/dashboard.html"
click node_actas "https://github.com/moralesruizbrayan-create/avantiforms/blob/main/gestion-actas.html"
click node_inventory "https://github.com/moralesruizbrayan-create/avantiforms/blob/main/inventario.html"
click node_employee_admin "https://github.com/moralesruizbrayan-create/avantiforms/blob/main/admin-empleados.html"
click node_app_js "https://github.com/moralesruizbrayan-create/avantiforms/blob/main/app.js"
click node_styles "https://github.com/moralesruizbrayan-create/avantiforms/blob/main/styles.css"
click node_auth_api "https://github.com/moralesruizbrayan-create/avantiforms/blob/main/api/auth.js"
click node_employees_api "https://github.com/moralesruizbrayan-create/avantiforms/blob/main/api/empleados.js"
click node_equipment_api "https://github.com/moralesruizbrayan-create/avantiforms/blob/main/api/obtener-equipo.js"
click node_save_acta_api "https://github.com/moralesruizbrayan-create/avantiforms/blob/main/api/guardar-acta.js"
click node_metrics_api "https://github.com/moralesruizbrayan-create/avantiforms/blob/main/api/obtener-metricas.js"
click node_delete_api "https://github.com/moralesruizbrayan-create/avantiforms/blob/main/api/eliminar-registro.js"
click node_node_runtime "https://github.com/moralesruizbrayan-create/avantiforms/blob/main/package.json"
click node_python_runtime "https://github.com/moralesruizbrayan-create/avantiforms/blob/main/requirements.txt"

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_landing,node_login,node_dashboard,node_actas,node_inventory,node_employee_admin,node_app_js,node_styles toneBlue
class node_auth_api,node_employees_api,node_equipment_api,node_save_acta_api,node_metrics_api,node_delete_api toneAmber
class node_node_runtime,node_python_runtime toneMint
```

## Components

### Browser application

- [Landing page](https://github.com/moralesruizbrayan-create/avantiforms/blob/main/index.html): HTML entry · `index.html`
- [Login](https://github.com/moralesruizbrayan-create/avantiforms/blob/main/login.html): unauthenticated view · `login.html`
- [Dashboard](https://github.com/moralesruizbrayan-create/avantiforms/blob/main/dashboard.html): operations view · `dashboard.html`
- [Acta management](https://github.com/moralesruizbrayan-create/avantiforms/blob/main/gestion-actas.html): handover view · `gestion-actas.html`
- [Inventory](https://github.com/moralesruizbrayan-create/avantiforms/blob/main/inventario.html): asset view · `inventario.html`
- [Employee administration](https://github.com/moralesruizbrayan-create/avantiforms/blob/main/admin-empleados.html): employee view · `admin-empleados.html`
- [Client integration](https://github.com/moralesruizbrayan-create/avantiforms/blob/main/app.js): shared browser logic · Primary browser-side API boundary. · `app.js`
- [Shared styles](https://github.com/moralesruizbrayan-create/avantiforms/blob/main/styles.css): CSS presentation · `styles.css`

### Node API handlers

- [Authentication](https://github.com/moralesruizbrayan-create/avantiforms/blob/main/api/auth.js): security endpoint · `api/auth.js`
- [Employees](https://github.com/moralesruizbrayan-create/avantiforms/blob/main/api/empleados.js): CRUD/query endpoint · `api/empleados.js`
- [Equipment lookup](https://github.com/moralesruizbrayan-create/avantiforms/blob/main/api/obtener-equipo.js): asset endpoint · `api/obtener-equipo.js`
- [Persist acta](https://github.com/moralesruizbrayan-create/avantiforms/blob/main/api/guardar-acta.js): transaction endpoint · Creates equipment-delivery records. · `api/guardar-acta.js`
- [Operational metrics](https://github.com/moralesruizbrayan-create/avantiforms/blob/main/api/obtener-metricas.js): reporting endpoint · Read-model boundary for dashboard aggregates. · `api/obtener-metricas.js`
- [Remove record](https://github.com/moralesruizbrayan-create/avantiforms/blob/main/api/eliminar-registro.js): destructive endpoint · Authorization-sensitive record removal. · `api/eliminar-registro.js`

### Runtime boundaries

- [Node.js dependencies](https://github.com/moralesruizbrayan-create/avantiforms/blob/main/package.json): runtime manifest · `package.json`
- [Python dependencies](https://github.com/moralesruizbrayan-create/avantiforms/blob/main/requirements.txt): runtime manifest · Indicates an additional Python runtime or service dependency. · `requirements.txt`

## Connections

- Landing page → Login: starts authentication
- Login → Client integration: uses
- Client integration → Authentication: authenticates
- Authentication → Dashboard: grants access to
- Dashboard → Client integration: uses
- Acta management → Client integration: uses
- Inventory → Client integration: uses
- Employee administration → Client integration: uses
- Client integration → Operational metrics: loads metrics
- Client integration → Employees: manages employees
- Client integration → Equipment lookup: resolves equipment
- Client integration → Persist acta: submits acta
- Client integration → Remove record: removes records
- Employees → Persist acta: supplies employee identity
- Equipment lookup → Persist acta: supplies equipment details
- Persist acta → Dashboard: returns to operations
- Node.js dependencies → Authentication: hosts handlers
- Shared styles → Login: styles
- Shared styles → Dashboard: styles
