# sebin3/grupo-4-mini-calculadora-de-edad- architecture

> Architecture diagram of the GitHub repository sebin3/grupo-4-mini-calculadora-de-edad-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sebin3/grupo-4-mini-calculadora-de-edad-
- Repository: https://github.com/sebin3/grupo-4-mini-calculadora-de-edad-

## Overview

##### Project type and purpose
- This is a small, client-side web application (“Mini Calculadora de Edad”) that runs entirely in the browser.
- Its purpose is to let users calculate their exact age from a birthdate and maintain a session-long history of those calculations.

##### File structure
- Top-level files only—no separate frontend/backend directories:
- index.html → page structure and entry point
- style.css  → presentation layer (UI styling)
- script.js  → main application logic (event handlers, DOM updates)
- api.js     → simulated API module (in-memory storage of history)
- No real server or database; “api.js” abstracts data store operations.

##### README for additional insights
- Confirms use of HTML5, CSS3, ES6 modules.
- Describes key features: age calculation, in-memory history, UI updates.

##### Main components
a. Browser / Client Environment
b. UI Layer (HTML5 + CSS3)
c. Front-end Logic (script.js)
d. Simulated API Module (api.js)
e. In-Memory Data Store (inside api.js)
f. User (actor interacting with UI)

##### Relationships and data flows
- User → clicks “Calculate” → UI Layer (index.html)
- UI Layer → invokes → script.js (business logic)
- script.js → calls → api.js methods (store/retrieve history)
- api.js → reads/writes → In-Memory Data Store
- api.js → returns data → script.js → updates UI Layer

##### Architectural patterns and design principles
- Separation of concerns:
- Presentation (HTML/CSS)
- Business Logic (script.js)
- Data Access Layer (api.js simulating REST calls)
- Modular JavaScript using ES6 imports/exports.

##### Relevant technologies and frameworks
- HTML5 → static page
- CSS3 → styling
- JavaScript ES6 Modules → script.js and api.js
- No external frameworks (vanilla JS)

## Diagram (Mermaid)

```mermaid
flowchart TB
    User["User"]:::actor

    subgraph "UI Layer"
        HTML["index.html"]:::ui
        CSS["style.css"]:::ui
    end

    Script["script.js (Business Logic)"]:::logic
    API["api.js (Data API)"]:::boundary
    Store["In-Memory Data Store"]:::data

    User -->|"click Calculate"| HTML
    HTML -->|"invoke calculateAge()"| Script
    Script -->|"saveHistory()/getHistory()"| API
    API -->|"reads/writes"| Store
    Store -->|"returns data"| API
    API -->|"returns data"| Script
    Script -->|"update DOM"| HTML
    HTML -->|"display age/history"| User

    click HTML "https://github.com/sebin3/grupo-4-mini-calculadora-de-edad-/blob/main/index.html"
    click CSS "https://github.com/sebin3/grupo-4-mini-calculadora-de-edad-/blob/main/style.css"
    click Script "https://github.com/sebin3/grupo-4-mini-calculadora-de-edad-/blob/main/script.js"
    click API "https://github.com/sebin3/grupo-4-mini-calculadora-de-edad-/blob/main/api.js"

    classDef ui fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef logic fill:#d4edda,stroke:#333,stroke-width:1px
    classDef data fill:#ffeeba,stroke:#333,stroke-width:1px
    classDef boundary stroke-dasharray:5 5,stroke:#333
    classDef actor fill:#f8f9fa,stroke:#333,stroke-width:1px
```
