# optikus-tech/web-data-viz-optikus architecture

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

- Interactive diagram: https://gitdiagram.com/optikus-tech/web-data-viz-optikus
- Repository: https://github.com/optikus-tech/web-data-viz-optikus

## Overview

Optikus is a web data-visualization and monitoring application. Its user-facing workflow runs from the browser interface through Express routes and controllers to models and MySQL; the sampled server-management API also validates provisioned equipment and supports server and locality listing, registration, and deletion. The README identifies user, alert (aviso), and measurement (medida) as product resources, but their implementations are not present in the supplied tree. Connections among unsampled UI features and API resources are therefore omitted unless documented.

Main entry points: [`app.js`](https://github.com/optikus-tech/web-data-viz-optikus/blob/main/app.js) (Express application), [`src/database/config.js`](https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/database/config.js) (MySQL access), [`public/index.html`](https://github.com/optikus-tech/web-data-viz-optikus/blob/main/public/index.html) (Web interface), [`src/routes/usuarios.js`](https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/routes/usuarios.js) (User routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_web["Web interface<br/>[index.html]"]
  node_dashboards["Dashboards and mural<br/>[dashboard.html]"]
  node_server_ui["Server management UI<br/>[servidores.js]"]
end

subgraph group_api["API and domain"]
  node_app["Express application<br/>[app.js]"]
  node_user_routes["User routes<br/>[usuarios.js]"]
  node_user_controller["User operations"]
  node_user_model["User data model<br/>[usuarioModel.js]"]
  node_company_routes["Company routes<br/>[empresas.js]"]
  node_company_controller["Company operations"]
  node_company_model["Company data model<br/>[empresaModel.js]"]
  node_server_routes["Server routes<br/>[servidores.js]"]
  node_server_controller["Server operations"]
  node_server_model["Server data model<br/>[servidorModel.js]"]
  node_alerts_measurements["Alerts and measurements"]
end

subgraph group_persistence["Persistence"]
  node_database["MySQL access<br/>[config.js]"]
end

node_visitor(("User"))
node_mysql[("MySQL database")]

node_visitor -->|"uses"| node_web
node_web -->|"requests API"| node_app
node_app -->|"mounts routes"| node_user_routes
node_app -->|"mounts routes"| node_company_routes
node_app -->|"mounts routes"| node_server_routes
node_user_routes -->|"dispatches to"| node_user_controller
node_company_routes -->|"dispatches to"| node_company_controller
node_server_routes -->|"dispatches to"| node_server_controller
node_user_controller -->|"calls"| node_user_model
node_company_controller -->|"calls"| node_company_model
node_server_controller -->|"calls"| node_server_model
node_user_model -->|"queries through"| node_database
node_company_model -->|"queries through"| node_database
node_server_model -->|"queries through"| node_database
node_database -->|"executes SQL"| node_mysql
node_visitor -->|"views"| node_dashboards
node_visitor -->|"manages servers"| node_server_ui
node_web -->|"resource workflow"| node_alerts_measurements

click node_web "https://github.com/optikus-tech/web-data-viz-optikus/blob/main/public/index.html"
click node_dashboards "https://github.com/optikus-tech/web-data-viz-optikus/blob/main/public/dashboard/dashboard.html"
click node_server_ui "https://github.com/optikus-tech/web-data-viz-optikus/blob/main/public/js/servidores.js"
click node_app "https://github.com/optikus-tech/web-data-viz-optikus/blob/main/app.js"
click node_user_routes "https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/routes/usuarios.js"
click node_user_controller "https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/controllers/usuarioController.js"
click node_user_model "https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/models/usuarioModel.js"
click node_company_routes "https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/routes/empresas.js"
click node_company_controller "https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/controllers/empresaController.js"
click node_company_model "https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/models/empresaModel.js"
click node_server_routes "https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/routes/servidores.js"
click node_server_controller "https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/controllers/servidorController.js"
click node_server_model "https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/models/servidorModel.js"
click node_alerts_measurements "https://github.com/optikus-tech/web-data-viz-optikus/tree/main/src/routes"
click node_database "https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/database/config.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_web,node_dashboards,node_server_ui,node_visitor toneBlue
class node_app,node_user_routes,node_user_controller,node_user_model,node_company_routes,node_company_controller,node_company_model,node_server_routes,node_server_controller,node_server_model,node_alerts_measurements,node_mysql toneAmber
class node_database toneMint
```

## Components

### Web experience

- [Web interface](https://github.com/optikus-tech/web-data-viz-optikus/blob/main/public/index.html): `public/index.html`
- [Dashboards and mural](https://github.com/optikus-tech/web-data-viz-optikus/blob/main/public/dashboard/dashboard.html): `public/dashboard/dashboard.html`
- [Server management UI](https://github.com/optikus-tech/web-data-viz-optikus/blob/main/public/js/servidores.js): `public/js/servidores.js`

### API and domain

- [Express application](https://github.com/optikus-tech/web-data-viz-optikus/blob/main/app.js): `app.js`
- [User routes](https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/routes/usuarios.js): `src/routes/usuarios.js`
- [User operations](https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/controllers/usuarioController.js): `src/controllers/usuarioController.js`
- [User data model](https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/models/usuarioModel.js): `src/models/usuarioModel.js`
- [Company routes](https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/routes/empresas.js): `src/routes/empresas.js`
- [Company operations](https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/controllers/empresaController.js): `src/controllers/empresaController.js`
- [Company data model](https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/models/empresaModel.js): `src/models/empresaModel.js`
- [Server routes](https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/routes/servidores.js): `src/routes/servidores.js`
- [Server operations](https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/controllers/servidorController.js): `src/controllers/servidorController.js`
- [Server data model](https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/models/servidorModel.js): `src/models/servidorModel.js`
- [Alerts and measurements](https://github.com/optikus-tech/web-data-viz-optikus/tree/main/src/routes): `src/routes`

### Persistence

- [MySQL access](https://github.com/optikus-tech/web-data-viz-optikus/blob/main/src/database/config.js): `src/database/config.js`

### Other components

- **User**
- **MySQL database**

## Connections

- User → Web interface: uses (evidence: `README.md`)
- Web interface → Express application: requests API (evidence: `README.md`)
- Express application → User routes: mounts routes (evidence: `app.js`)
- Express application → Company routes: mounts routes (evidence: `app.js`)
- Express application → Server routes: mounts routes (evidence: `app.js`)
- User routes → User operations: dispatches to (evidence: `src/routes/usuarios.js`)
- Company routes → Company operations: dispatches to (evidence: `src/routes/empresas.js`)
- Server routes → Server operations: dispatches to (evidence: `src/routes/servidores.js`)
- User operations → User data model: calls (evidence: `src/controllers/usuarioController.js`)
- Company operations → Company data model: calls (evidence: `src/controllers/empresaController.js`)
- Server operations → Server data model: calls (evidence: `src/controllers/servidorController.js`)
- User data model → MySQL access: queries through (evidence: `src/models/usuarioModel.js`)
- Company data model → MySQL access: queries through (evidence: `src/models/empresaModel.js`)
- Server data model → MySQL access: queries through (evidence: `src/models/servidorModel.js`)
- MySQL access → MySQL database: executes SQL (evidence: `src/database/config.js`)
- User → Dashboards and mural: views (evidence: `README.md`)
- User → Server management UI: manages servers (evidence: `README.md`)
- Web interface → Alerts and measurements: resource workflow (evidence: `README.md`)
