# aossesdc/web_portafolio architecture

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

- Interactive diagram: https://gitdiagram.com/aossesdc/web_portafolio
- Repository: https://github.com/aossesdc/web_portafolio

## Overview

SLA Control is a web-based service-level agreement monitoring product with role-specific screens, ticket tracking, risk calculations, reporting, and global accessibility preferences. Its principal workflow accepts ticket data, enriches tickets with SLA consumption and risk, and exposes ticket and report APIs; critical-ticket email alerts are a separate action. The backend uses in-memory mock data rather than a persistent database. The README gives no capability details, so the frontend screens’ behavior is not mapped beyond the sampled scripts.

Main entry points: [`backend/src/app.js`](https://github.com/aossesdc/web_portafolio/blob/main/backend/src/app.js) (API routing), [`backend/src/routes/tickets.js`](https://github.com/aossesdc/web_portafolio/blob/main/backend/src/routes/tickets.js) (Ticket API), [`backend/src/routes/reports.js`](https://github.com/aossesdc/web_portafolio/blob/main/backend/src/routes/reports.js) (Report API), [`html`](https://github.com/aossesdc/web_portafolio/tree/main/html) (Role-based screens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web experience"]
  node_frontend_pages["Role-based screens"]
  node_browser_preferences["Global preferences"]
  node_report_downloads["Report downloads"]
end

subgraph group_api["Backend API"]
  node_server["HTTP server<br/>[server.js]"]
  node_api_app["API routing<br/>[app.js]"]
  node_authentication["Login<br/>[auth.js]"]
  node_ticket_api["Ticket API<br/>[tickets.js]"]
  node_report_api["Report API<br/>[reports.js]"]
end

subgraph group_domain["SLA domain"]
  node_mock_data[("Users and tickets<br/>[mockData.js]")]
  node_sla_metrics["SLA risk metrics<br/>[sla.js]"]
end

subgraph group_integrations["Notifications"]
  node_email_alerts["Critical email alerts<br/>[emailService.js]"]
end

node_users(("Platform users"))
node_smtp{{"SMTP service"}}

node_users -->|"uses"| node_frontend_pages
node_frontend_pages -.->|"requests"| node_server
node_server -->|"starts"| node_api_app
node_api_app -->|"routes auth"| node_authentication
node_api_app -->|"routes tickets"| node_ticket_api
node_api_app -->|"routes reports"| node_report_api
node_authentication -->|"reads users"| node_mock_data
node_ticket_api -->|"reads and adds tickets"| node_mock_data
node_report_api -->|"reads tickets"| node_mock_data
node_ticket_api -->|"calculates risk"| node_sla_metrics
node_report_api -->|"calculates metrics"| node_sla_metrics
node_ticket_api -->|"requests alert"| node_email_alerts
node_email_alerts -.->|"sends email"| node_smtp
node_users -->|"changes preferences"| node_browser_preferences
node_browser_preferences -->|"applies settings"| node_users
node_users -->|"downloads reports"| node_report_downloads
node_report_downloads -->|"reads report data"| node_frontend_pages

click node_frontend_pages "https://github.com/aossesdc/web_portafolio/tree/main/html"
click node_browser_preferences "https://github.com/aossesdc/web_portafolio/blob/main/js/preferencias-globales.js"
click node_report_downloads "https://github.com/aossesdc/web_portafolio/blob/main/js/reportes-exportacion.js"
click node_server "https://github.com/aossesdc/web_portafolio/blob/main/backend/server.js"
click node_api_app "https://github.com/aossesdc/web_portafolio/blob/main/backend/src/app.js"
click node_authentication "https://github.com/aossesdc/web_portafolio/blob/main/backend/src/routes/auth.js"
click node_ticket_api "https://github.com/aossesdc/web_portafolio/blob/main/backend/src/routes/tickets.js"
click node_report_api "https://github.com/aossesdc/web_portafolio/blob/main/backend/src/routes/reports.js"
click node_mock_data "https://github.com/aossesdc/web_portafolio/blob/main/backend/src/data/mockData.js"
click node_sla_metrics "https://github.com/aossesdc/web_portafolio/blob/main/backend/src/utils/sla.js"
click node_email_alerts "https://github.com/aossesdc/web_portafolio/blob/main/backend/src/services/emailService.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_frontend_pages,node_browser_preferences,node_report_downloads,node_users toneBlue
class node_server,node_api_app,node_authentication,node_ticket_api,node_report_api toneAmber
class node_mock_data,node_sla_metrics toneMint
class node_email_alerts toneRose
class node_smtp toneIndigo
```

## Components

### Web experience

- [Role-based screens](https://github.com/aossesdc/web_portafolio/tree/main/html): `html`
- [Global preferences](https://github.com/aossesdc/web_portafolio/blob/main/js/preferencias-globales.js): `js/preferencias-globales.js`
- [Report downloads](https://github.com/aossesdc/web_portafolio/blob/main/js/reportes-exportacion.js): `js/reportes-exportacion.js`

### Backend API

- [HTTP server](https://github.com/aossesdc/web_portafolio/blob/main/backend/server.js): `backend/server.js`
- [API routing](https://github.com/aossesdc/web_portafolio/blob/main/backend/src/app.js): `backend/src/app.js`
- [Login](https://github.com/aossesdc/web_portafolio/blob/main/backend/src/routes/auth.js): `backend/src/routes/auth.js`
- [Ticket API](https://github.com/aossesdc/web_portafolio/blob/main/backend/src/routes/tickets.js): `backend/src/routes/tickets.js`
- [Report API](https://github.com/aossesdc/web_portafolio/blob/main/backend/src/routes/reports.js): `backend/src/routes/reports.js`

### SLA domain

- [Users and tickets](https://github.com/aossesdc/web_portafolio/blob/main/backend/src/data/mockData.js): `backend/src/data/mockData.js`
- [SLA risk metrics](https://github.com/aossesdc/web_portafolio/blob/main/backend/src/utils/sla.js): `backend/src/utils/sla.js`

### Notifications

- [Critical email alerts](https://github.com/aossesdc/web_portafolio/blob/main/backend/src/services/emailService.js): `backend/src/services/emailService.js`

### Other components

- **Platform users**
- **SMTP service**

## Connections

- Platform users → Role-based screens: uses
- Role-based screens → HTTP server: requests
- HTTP server → API routing: starts (evidence: `backend/server.js`)
- API routing → Login: routes auth (evidence: `backend/src/app.js`)
- API routing → Ticket API: routes tickets (evidence: `backend/src/app.js`)
- API routing → Report API: routes reports (evidence: `backend/src/app.js`)
- Login → Users and tickets: reads users (evidence: `backend/src/routes/auth.js`)
- Ticket API → Users and tickets: reads and adds tickets (evidence: `backend/src/routes/tickets.js`)
- Report API → Users and tickets: reads tickets (evidence: `backend/src/routes/reports.js`)
- Ticket API → SLA risk metrics: calculates risk (evidence: `backend/src/routes/tickets.js`)
- Report API → SLA risk metrics: calculates metrics (evidence: `backend/src/routes/reports.js`)
- Ticket API → Critical email alerts: requests alert (evidence: `backend/src/routes/tickets.js`)
- Critical email alerts → SMTP service: sends email (evidence: `backend/src/services/emailService.js`)
- Platform users → Global preferences: changes preferences (evidence: `js/preferencias-globales.js`)
- Global preferences → Platform users: applies settings (evidence: `js/preferencias-globales.js`)
- Platform users → Report downloads: downloads reports (evidence: `js/reportes-exportacion.js`)
- Report downloads → Role-based screens: reads report data (evidence: `js/reportes-exportacion.js`)
