# joshgrib/how-old-is-x architecture

> Architecture diagram of the GitHub repository joshgrib/how-old-is-x, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/joshgrib/how-old-is-x
- Repository: https://github.com/joshgrib/how-old-is-x

## Overview

Project Type Analysis:
This is a client-side only, static web application designed primarily for mobile use, with offline capabilities. The project is intentionally simple, consisting of a single HTML file that handles all functionality.

##### Main Components

a. Client-Side Components:
- HTML5 Frontend (Single Page)
- Local Storage (for saving birthday data)
- Service Worker (for offline functionality)
- UI Components (Mobile-optimized interface)

- [User Interface Layer]
- Mobile UI Components
- Desktop UI Components

- [Application Layer]
- Birthday Input Handler
- Age Calculator Logic
- Date Management

- [Data Persistence Layer]
- Browser Local Storage

- [Progressive Web App Features]
- Service Worker (Offline Capability)

- Blue: UI components
- Green: Core logic components
- Yellow: Data storage
- Purple: PWA features

##### Important Elements to Highlight

- Offline-first architecture
- Local storage integration
- Mobile-responsive UI components
- PWA capabilities

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph User_Interface_Layer
        UI[UI Components]:::ui
        MobileUI[Mobile UI Components]:::ui
        DesktopUI[Desktop UI Components]:::ui
        UI --> MobileUI
        UI --> DesktopUI
    end

    subgraph Application_Layer
        BirthdayInput[Birthday Input Handler]:::logic
        AgeCalc[Age Calculator Logic]:::logic
        DateMgmt[Date Management]:::logic
    end

    subgraph Data_Persistence_Layer
        LocalStorage[Browser Local Storage]:::storage
    end

    subgraph PWA_Features
        ServiceWorker[Service Worker]:::pwa
    end

    subgraph Deployment
        GHPages[GitHub Pages]:::deployment
    end

    %% Interactions
    UI --> BirthdayInput
    BirthdayInput --> AgeCalc
    BirthdayInput --> DateMgmt
    AgeCalc --> LocalStorage
    DateMgmt --> LocalStorage
    ServiceWorker -.-> UI
    GHPages -.-> ServiceWorker

    %% Click Events
    click UI "https://github.com/joshgrib/how-old-is-x/blob/main/index.html"
    click MobileUI "https://github.com/joshgrib/how-old-is-x/blob/main/index.html"
    click DesktopUI "https://github.com/joshgrib/how-old-is-x/blob/main/index.html"
    click BirthdayInput "https://github.com/joshgrib/how-old-is-x/blob/main/index.html"
    click AgeCalc "https://github.com/joshgrib/how-old-is-x/blob/main/index.html"
    click DateMgmt "https://github.com/joshgrib/how-old-is-x/blob/main/index.html"
    click LocalStorage "https://github.com/joshgrib/how-old-is-x/blob/main/index.html"
    click ServiceWorker "https://github.com/joshgrib/how-old-is-x/blob/main/index.html"
    click GHPages "https://github.com/joshgrib/how-old-is-x/blob/main/.github/workflows/static.yml"

    %% Styles
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef logic fill:#2ecc71,stroke:#27ae60,color:white
    classDef storage fill:#f1c40f,stroke:#f39c12,color:black
    classDef pwa fill:#9b59b6,stroke:#8e44ad,color:white
    classDef deployment fill:#e74c3c,stroke:#c0392b,color:white

    %% Legend
    subgraph Legend
        L1[UI Components]:::ui
        L2[Logic Components]:::logic
        L3[Storage]:::storage
        L4[PWA Features]:::pwa
        L5[Deployment]:::deployment
    end
```
