# rubenleon/rpttai architecture

> Architecture diagram of the GitHub repository rubenleon/rpttai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rubenleon/rpttai
- Repository: https://github.com/rubenleon/rpttai

## Overview

##### Project type and purpose
- This is a static “single-page”/multi-page website (“RPT de Informática”) that displays the “Relación de Puestos de Trabajo” information.
- There is no dynamic backend or database—assets live in the `docs/` folder and are served by an HTTP server inside a Docker container.

##### File structure
- Top level:
- README.md – project description and run instructions
- dockerfile – builds a Docker image (likely based on nginx or httpd) pointing at `docs/`
- docker-compose.yml – orchestrates local container startup (exposes port 80/8080)
- docs/ – published site (HTML, CSS, JS, CNAME, ads.txt, sitemap.xml)
- No `src/` or `backend/` folder: this is a purely front-end, static asset project.

##### Key insights from README
- Live production site hosted at https://rpt.ovh.

##### Main components and interactions
a. User Browser
b. (Optional) Load Balancer or CDN – for production, you may front the container with a CDN or LB.
c. Docker Host / VM – runs Docker Engine.
d. Container – runs a lightweight HTTP server (nginx/apache) serving the static `docs/` assets.
e. Static Asset Store – the `docs/` directory baked into the image at build time.

Interactions:
- User → DNS → (CDN/LB) → HTTP request → Docker Host → Container → HTTP server → static files → Response back.

##### Architectural patterns and principles
- Containerization: isolates web server and assets.
- Immutable build: static assets baked at image build.
- Twelve-factor “build, release, run” separation:
- Build → dockerfile
- Release → tagged image (`rpttai:latest`)
- Run → docker run / compose
- Optional: place a CDN or reverse proxy in front for caching.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External User
    User["User Browser"]:::external

    %% Network Layer
    DNS["DNS / CDN / Load Balancer"]:::network

    %% Build & Release
    Build["Build: dockerfile"]:::compute
    click Build "https://github.com/rubenleon/rpttai/tree/gh-pages/dockerfile"

    %% Runtime Host
    DockerHost["Docker Host (VM/Server)"]:::compute

    %% Local Development
    subgraph "Local Development"
        DockerCompose["Run: docker-compose up"]:::compute
        click DockerCompose "https://github.com/rubenleon/rpttai/blob/gh-pages/docker-compose.yml"
        DockerCompose -->|starts| Container
    end

    %% Container
    Container["Container: Nginx HTTP Server<br/>rpttai:latest"]:::compute

    %% Static Assets
    subgraph "Static Assets (docs/)" 
        StaticDir["docs/"]:::data
        click StaticDir "https://github.com/rubenleon/rpttai/tree/gh-pages/docs/"
        Index["index.html"]:::data
        click Index "https://github.com/rubenleon/rpttai/blob/gh-pages/docs/index.html"
        CSS["assets/index-B_eT7X7p.css"]:::data
        click CSS "https://github.com/rubenleon/rpttai/blob/gh-pages/docs/assets/index-B_eT7X7p.css"
        JS["assets/index-BwJUQg5d.js"]:::data
        click JS "https://github.com/rubenleon/rpttai/blob/gh-pages/docs/assets/index-BwJUQg5d.js"
        CNAME["CNAME"]:::data
        click CNAME "https://github.com/rubenleon/rpttai/tree/gh-pages/docs/CNAME"
        Ads["ads.txt"]:::data
        click Ads "https://github.com/rubenleon/rpttai/blob/gh-pages/docs/ads.txt"
        Sitemap["sitemap.xml"]:::data
        click Sitemap "https://github.com/rubenleon/rpttai/blob/gh-pages/docs/sitemap.xml"
        StaticDir --> Index
        StaticDir --> CSS
        StaticDir --> JS
        StaticDir --> CNAME
        StaticDir --> Ads
        StaticDir --> Sitemap
    end

    %% Connections
    User -->|HTTP GET /index.html| DNS
    DNS -->|Forward request| DockerHost
    DockerHost -->|Dispatch to container| Container
    Build -->|Build image| Container
    Container -->|Serves static files| StaticDir
    StaticDir -->|200 OK| Container
    Container -->|200 OK| DNS
    DNS -->|200 OK| User

    %% README
    README["Project README"]:::external
    click README "https://github.com/rubenleon/rpttai/blob/gh-pages/README.md"
    README --> Build

    %% Styles
    classDef compute fill:#AEDFF7,stroke:#0366d6,color:#000;
    classDef network fill:#FFDDA0,stroke:#d57a00,color:#000;
    classDef data fill:#A0DFA0,stroke:#028A02,color:#000;
    classDef external fill:#E0E0E0,stroke:#888888,color:#000;
```
