# ferney/turno-de-estudio architecture

> Architecture diagram of the GitHub repository ferney/turno-de-estudio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ferney/turno-de-estudio
- Repository: https://github.com/ferney/turno-de-estudio

## Overview

##### Project Type and Purpose
- This is a static, client-side study tool website for nursing students and professionals.
- It delivers study content (HTML pages), quizzes (JSON question files), and interactivity (JavaScript) entirely in the browser.
- There is no server-side application logic beyond serving static assets.

##### File Structure Analysis
- Top-level files:
- index.html – landing page
- styles.css – global styling
- script.js – shared JavaScript utilities, site navigation, or common logic
- Content directory:
- content/*.html – standalone pages with notes (e.g., cateterismo.html, sondaje.html, welcome.html)
- JSON directory:
- json/preguntas-*.json – question banks for each quiz topic
- Quiz pages and scripts:
- quiz-cateterismo.html & script-cateterismo.js
- quiz-sondaje.html & script-sondaje.js
- No build scripts or server frameworks—pure static asset delivery.

##### Insights from README
- The site offers quizzes (“Preguntas”), notes, and tips.
- Content updates are static replacements of HTML or JSON.
- Intended for regular visits, self-assessment, and study reinforcement.

a. Main Components
- Client (Web Browser)
- Static Asset Server (e.g., Nginx, GitHub Pages)
- Static Assets:
– HTML pages (index, content, quizzes)
– CSS (styles.css)
– JavaScript (script.js, script-cateterismo.js, script-sondaje.js)
– JSON data (preguntas-cateterismo.json, preguntas-sondaje.json)
b. Relationships & Data Flows
1. Browser requests index.html → receives HTML + CSS + script.js
2. User clicks a link to a content or quiz page → browser fetches that HTML + its specific script
3. Quiz script issues an AJAX/fetch call to the appropriate JSON file
4. Browser parses JSON → dynamically renders questions and captures answers
c. Architectural Patterns & Principles
- Static Content Hosting: All resources are served as static files
- SPA-like Behavior on Quiz Pages: dynamic binding of JSON to HTML elements
- Separation of Concerns:
– Presentation (HTML/CSS)
– Data (JSON)
– Behavior (JavaScript)
d. Key Technologies
- HTML5 for structure
- CSS3 for styling
- Vanilla JavaScript (ES6+) for DOM manipulation + fetch API
- JSON as data interchange format
- Any static web server capable of hosting files (e.g., S3 + CloudFront, GitHub Pages)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Components
    Browser["Browser (Client)"]:::client
    Server["Static File Server"]:::server

    %% Root Assets
    subgraph "Root Assets"
        direction TB
        Index["index.html"]:::presentation
        Styles["styles.css"]:::presentation
        Script["script.js"]:::behavior
    end

    %% Content Pages
    subgraph "Content Pages"
        direction TB
        CatNotes["cateterismo.html"]:::presentation
        SonNotes["sondaje.html"]:::presentation
        Welcome["welcome.html"]:::presentation
    end

    %% Quiz Pages and Scripts
    subgraph "Quiz Pages & Scripts"
        direction TB
        QuizCat["quiz-cateterismo.html"]:::presentation
        ScriptCat["script-cateterismo.js"]:::behavior
        QuizSon["quiz-sondaje.html"]:::presentation
        ScriptSon["script-sondaje.js"]:::behavior
    end

    %% JSON Data Store
    subgraph "JSON Data Store"
        direction TB
        JSONCat["preguntas-cateterismo.json"]:::data
        JSONSon["preguntas-sondaje.json"]:::data
    end

    %% Documentation
    README["README.md"]:::documentation

    %% Requests for Landing
    Browser -->|"GET /index.html, /styles.css, /script.js"| Server
    Server -->|"200 OK: index.html, styles.css, script.js"| Browser

    %% Navigation to Content
    Browser -->|"GET /content/cateterismo.html"| Server
    Server -->|"200 OK: cateterismo.html"| Browser
    Browser -->|"GET /content/sondaje.html"| Server
    Server -->|"200 OK: sondaje.html"| Browser
    Browser -->|"GET /content/welcome.html"| Server
    Server -->|"200 OK: welcome.html"| Browser

    %% Navigation to Quiz Pages
    Browser -->|"GET /quiz-cateterismo.html, /script-cateterismo.js"| Server
    Server -->|"200 OK: quiz-cateterismo.html, script-cateterismo.js"| Browser
    Browser -->|"GET /quiz-sondaje.html, /script-sondaje.js"| Server
    Server -->|"200 OK: quiz-sondaje.html, script-sondaje.js"| Browser

    %% Fetching JSON Data
    Browser -->|"fetch 'json/preguntas-cateterismo.json'"| Server
    Server -->|"200 OK: preguntas-cateterismo.json"| Browser
    Browser -->|"fetch 'json/preguntas-sondaje.json'"| Server
    Server -->|"200 OK: preguntas-sondaje.json"| Browser

    %% Click Events
    click Index "https://github.com/ferney/turno-de-estudio/blob/main/index.html"
    click Styles "https://github.com/ferney/turno-de-estudio/blob/main/styles.css"
    click Script "https://github.com/ferney/turno-de-estudio/blob/main/script.js"
    click CatNotes "https://github.com/ferney/turno-de-estudio/blob/main/content/cateterismo.html"
    click SonNotes "https://github.com/ferney/turno-de-estudio/blob/main/content/sondaje.html"
    click Welcome "https://github.com/ferney/turno-de-estudio/blob/main/content/welcome.html"
    click QuizCat "https://github.com/ferney/turno-de-estudio/blob/main/quiz-cateterismo.html"
    click ScriptCat "https://github.com/ferney/turno-de-estudio/blob/main/script-cateterismo.js"
    click QuizSon "https://github.com/ferney/turno-de-estudio/blob/main/quiz-sondaje.html"
    click ScriptSon "https://github.com/ferney/turno-de-estudio/blob/main/script-sondaje.js"
    click JSONCat "https://github.com/ferney/turno-de-estudio/blob/main/json/preguntas-cateterismo.json"
    click JSONSon "https://github.com/ferney/turno-de-estudio/blob/main/json/preguntas-sondaje.json"
    click README "https://github.com/ferney/turno-de-estudio/blob/main/README.md"

    %% Styles
    classDef client fill:#D6EAF8,stroke:#2980B9,stroke-width:2px
    classDef server fill:#F2F3F4,stroke:#7F8C8D,stroke-width:2px
    classDef presentation fill:#EBF5FB,stroke:#3498DB,stroke-width:2px
    classDef behavior fill:#FEF9E7,stroke:#F1C40F,stroke-width:2px
    classDef data fill:#E8F8F5,stroke:#1ABC9C,stroke-width:2px
    classDef documentation fill:#FDEDEC,stroke:#E74C3C,stroke-width:2px
```
