# aamir-rafique/age-calculator-html-css-javascript architecture

> Architecture diagram of the GitHub repository aamir-rafique/age-calculator-html-css-javascript, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aamir-rafique/age-calculator-html-css-javascript
- Repository: https://github.com/aamir-rafique/age-calculator-html-css-javascript

## Overview

##### Project Type and Purpose
- This is a single-page, frontend-only web application (“Age Calculator”) built using plain HTML, CSS, and JavaScript.
- There is no backend, database, or external API—everything lives in the user’s browser.

##### File Structure Analysis
- Top-level files:
- index.html – the page entry point and DOM scaffold
- style.css & mobStyle.css – desktop + mobile styling layers
- script.js – the client-side logic that computes ages and updates the DOM
- A .vscode folder with editor settings (not part of runtime architecture).

##### Key Insights from README
- It’s a practice project, no server or data persistence.
- Core functionality: calculate age from user input (date picker or text fields) and display the result instantly.

a. Main Components
- Browser UI Container
– index.html (HTML structure)
– CSS Layers: style.css (desktop) + mobStyle.css (mobile)
– script.js (age-calculation logic)
– img assets
- User (interacts via browser)
b. Relationships & Data Flow
1. Browser loads index.html
2. HTML references style.css / mobStyle.css for layout & style
3. HTML includes script.js; at page-load it registers event listeners on form fields
4. User enters birthdate → triggers JavaScript function
5. script.js computes the age (current date – birthdate)
6. script.js updates the DOM to display the result
c. Architectural Patterns & Design Principles
- Single-Page Application (SPA) pattern in micro-form
- Separation of concerns:
- Markup (HTML)
- Presentation (CSS)
- Behavior (JavaScript)
d. Key Technologies
- HTML5 (semantic structure)
- CSS3 (desktop + responsive mobile styles)
- Vanilla JavaScript (ES6+) for logic
- No build tools or frameworks

##### Detail & Clarity
- Keep it simple—every piece (HTML, CSS, JS, img) counts as a component.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User and Browser
    User(["User"]):::user
    Browser(["Browser"]):::static

    %% Runtime Components
    subgraph "Browser UI Container"
        direction TB
        HTML(["index.html"]):::static
        subgraph "Styling"
            direction TB
            StyleDesktop(["style.css"]):::static
            StyleMobile(["mobStyle.css"]):::static
        end
        Logic(["script.js"]):::logic
        Assets(["img/"]):::static
    end

    %% Editor Config (non-runtime)
    EditorConfig[".vscode/"]:::config

    %% Data Flow
    User -->|"interacts"| Browser
    Browser -->|"loads HTML"| HTML
    HTML -->|"references CSS"| StyleDesktop
    HTML -->|"references CSS"| StyleMobile
    HTML -->|"includes JS"| Logic
    HTML -->|"loads assets"| Assets
    Logic -->|"onInput→calculateAge()"| HTML

    %% Click Events
    click HTML "https://github.com/aamir-rafique/age-calculator-html-css-javascript/blob/main/index.html"
    click StyleDesktop "https://github.com/aamir-rafique/age-calculator-html-css-javascript/blob/main/style.css"
    click StyleMobile "https://github.com/aamir-rafique/age-calculator-html-css-javascript/blob/main/mobStyle.css"
    click Logic "https://github.com/aamir-rafique/age-calculator-html-css-javascript/blob/main/script.js"
    click Assets "https://github.com/aamir-rafique/age-calculator-html-css-javascript/tree/main/img/"
    click EditorConfig "https://github.com/aamir-rafique/age-calculator-html-css-javascript/tree/main/.vscode/"

    %% Styles
    classDef static fill:#E0F7FA,stroke:#00838F
    classDef logic fill:#FFE0B2,stroke:#EF6C00
    classDef config fill:#F5F5F5,stroke:#9E9E9E,stroke-dasharray:5 5
    classDef user fill:#C8E6C9,stroke:#2E7D32,stroke-width:2px
```
