# nawjanimri/opoviable-tfm architecture

> Architecture diagram of the GitHub repository nawjanimri/opoviable-tfm, 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/nawjanimri/opoviable-tfm
- Repository: https://github.com/nawjanimri/opoviable-tfm

## Overview

OpoViable is a study-time planning simulator: users enter weekly hours, a preparation deadline, and the constraint they want to preserve; the browser presents a rule-based recommendation and, when run locally, can request a natural-language explanation. The README describes the simulator and recommendation, but the HTML and client-side source were not sampled, so their internal stages and browser-to-server wiring are not shown. The server’s routing, scenario validation, recommendation text, and optional AI-provider request are evidenced in the sampled server file.

Main entry points: [`servidor-tfm.mjs`](https://github.com/nawjanimri/opoviable-tfm/blob/main/servidor-tfm.mjs) (HTTP server and routes), [`index.html`](https://github.com/nawjanimri/opoviable-tfm/blob/main/index.html) (Study simulator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_product["Planning simulator"]
  node_simulator["Study simulator<br/>[index.html]"]
  node_recommendation["Rule recommendation<br/>[index.html]"]
  node_privacy["Privacy information<br/>[privacidad.html]"]
end

subgraph group_server["Local explanation service"]
  node_web_server["HTTP server and routes<br/>[servidor-tfm.mjs]"]
  node_scenario["Scenario validation<br/>[servidor-tfm.mjs]"]
  node_explanation["Explanation generation<br/>[servidor-tfm.mjs]"]
end

node_user(("Person planning study"))
node_ai_provider["Groq or OpenAI"]

node_user -.->|"enters scenario"| node_simulator
node_simulator -.->|"shows recommendation"| node_recommendation
node_user -.->|"requests explanation"| node_web_server
node_web_server -->|"validates input"| node_scenario
node_web_server -->|"builds explanation"| node_explanation
node_explanation -->|"requests text"| node_ai_provider
node_web_server -->|"returns explanation"| node_user

click node_simulator "https://github.com/nawjanimri/opoviable-tfm/blob/main/index.html"
click node_recommendation "https://github.com/nawjanimri/opoviable-tfm/blob/main/index.html"
click node_web_server "https://github.com/nawjanimri/opoviable-tfm/blob/main/servidor-tfm.mjs"
click node_scenario "https://github.com/nawjanimri/opoviable-tfm/blob/main/servidor-tfm.mjs"
click node_explanation "https://github.com/nawjanimri/opoviable-tfm/blob/main/servidor-tfm.mjs"
click node_privacy "https://github.com/nawjanimri/opoviable-tfm/blob/main/privacidad.html"

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_simulator,node_recommendation,node_privacy toneBlue
class node_web_server,node_scenario,node_explanation toneAmber
class node_user,node_ai_provider toneIndigo
```

## Components

### Planning simulator

- [Study simulator](https://github.com/nawjanimri/opoviable-tfm/blob/main/index.html): `index.html`
- [Rule recommendation](https://github.com/nawjanimri/opoviable-tfm/blob/main/index.html): `index.html`
- [Privacy information](https://github.com/nawjanimri/opoviable-tfm/blob/main/privacidad.html): `privacidad.html`

### Local explanation service

- [HTTP server and routes](https://github.com/nawjanimri/opoviable-tfm/blob/main/servidor-tfm.mjs): `servidor-tfm.mjs`
- [Scenario validation](https://github.com/nawjanimri/opoviable-tfm/blob/main/servidor-tfm.mjs): `servidor-tfm.mjs`
- [Explanation generation](https://github.com/nawjanimri/opoviable-tfm/blob/main/servidor-tfm.mjs): `servidor-tfm.mjs`

### Other components

- **Person planning study**
- **Groq or OpenAI**

## Connections

- Person planning study → Study simulator: enters scenario (evidence: `README.md`)
- Study simulator → Rule recommendation: shows recommendation (evidence: `README.md`)
- Person planning study → HTTP server and routes: requests explanation (evidence: `README.md`)
- HTTP server and routes → Scenario validation: validates input (evidence: `servidor-tfm.mjs`)
- HTTP server and routes → Explanation generation: builds explanation (evidence: `servidor-tfm.mjs`)
- Explanation generation → Groq or OpenAI: requests text (evidence: `servidor-tfm.mjs`)
- HTTP server and routes → Person planning study: returns explanation (evidence: `servidor-tfm.mjs`)
