# bermatmods/yorchi architecture

> Architecture diagram of the GitHub repository bermatmods/yorchi, 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/bermatmods/yorchi
- Repository: https://github.com/bermatmods/yorchi

## Overview

##### Project Type and Purpose
- This is a single‐page, static frontend web application (“BerMa_Mods.html”) built with HTML, CSS, and vanilla JavaScript.
- Its purpose is to present a password‐protected celebratory page with interactive overlays (code entry, quiz), dynamic counters, a typewriter message, and a photo gallery.
- There is no backend service, database, or build pipeline; all logic and assets run entirely in the browser, with some assets (fonts, images, GIFs) loaded from external CDNs.

##### File Structure Analysis
- Only one file: README.md (which actually contains the full HTML/CSS/JS code).
- No separate “src/”, “backend/”, or configuration directories—everything lives in one HTML document.
- External dependencies:
- Google Fonts (CSS link)
- GIFs from Giphy (external URLs)
- Images from Postimg
- No build/deployment scripts—suitable for static hosting (e.g., GitHub Pages, Netlify, S3+CloudFront).

##### Key Architectural Components
a. Browser / Client
- HTML Document
- CSS (internal <style> block)
- JavaScript Logic (internal <script> block)
b. User Interface Overlays
1. Code Entry Screen
2. Question Overlay Screen
3. Modal Error Dialog
4. Main Content Container (counter, buttons, messages, gallery, dancing figures)
c. Client‐Side Logic
- Virtual keypad input & validation
- Quiz response handling
- Countdown timer (setInterval)
- Typewriter effect for romantic message
- Gallery show/hide toggle
d. External Services
- Font loading: Google Fonts CDN
- Image assets: Giphy and Postimg
e. Static Hosting
- Web server or CDN serving the HTML file

##### Relationships and Data Flows
- User interacts via browser UI components → JavaScript event handlers update the DOM.
- Browser requests external fonts and images from CDNs.
- No server‐side processing or database reads/writes.
- All timed/countdown logic runs in the browser’s JS engine.

##### Architectural Pattern & Design Principles
- Single‐Page Application (SPA) style but without a framework.
- UI state management via CSS classes (“.hidden”) and inline styles.
- Separation of concerns:
- Markup defines structure
- CSS for layout/themes
- JS for dynamic behavior
- Progressive enhancement: works on any static host.
- Accessibility considerations: role/aria attributes on modal and overlay.

- Clear text labels for each component.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External Actor
    User["User"]:::user

    %% Static Hosting
    subgraph "Static Hosting/CDN"
        Hosting["Static Hosting/CDN"]:::hosting
    end

    %% Browser Client
    subgraph "Browser (Client)"
        subgraph "HTML/CSS/JS Engine"
            HTML["HTML Document"]:::browser
            CSS["Internal CSS Styles"]:::browser
            JS["Internal JavaScript Logic"]:::browser
        end
        UI["UI Modules<br/>(Overlays & Main Content)"]:::browser
        Logic["Client Logic Modules<br/>(Keypad, Quiz, Timer, Typewriter, Gallery)"]:::browser
        DOM["DOM Updates"]:::browser
    end

    %% External CDNs
    subgraph "External CDNs"
        Fonts["Google Fonts CDN"]:::external
        Giphy["Giphy GIF URLs"]:::external
        Postimg["Postimg Image URLs"]:::external
    end

    %% Connections
    User -->|"click / input events"| UI
    UI -->|"triggers handlers"| Logic
    Logic -->|"updates"| DOM
    DOM -->|"reflects UI state"| UI

    Hosting -->|"HTML/CSS/JS over HTTPS"| HTML

    HTML -->|"loads fonts"| Fonts
    HTML -->|"loads images/GIFs"| Giphy
    HTML -->|"loads images"| Postimg

    Logic -->|"setInterval loops"| Logic

    %% Click Events
    click HTML "https://github.com/bermatmods/yorchi/blob/main/README.md"
    click CSS "https://github.com/bermatmods/yorchi/blob/main/README.md"
    click JS "https://github.com/bermatmods/yorchi/blob/main/README.md"
    click UI "https://github.com/bermatmods/yorchi/blob/main/README.md"
    click Logic "https://github.com/bermatmods/yorchi/blob/main/README.md"
    click Hosting "https://github.com/bermatmods/yorchi/blob/main/README.md"
    click Fonts "https://github.com/bermatmods/yorchi/blob/main/README.md"
    click Giphy "https://github.com/bermatmods/yorchi/blob/main/README.md"
    click Postimg "https://github.com/bermatmods/yorchi/blob/main/README.md"

    %% Styles
    classDef hosting fill:#D0E1FF,stroke:#333,stroke-width:1px
    classDef browser fill:#D0FFD8,stroke:#333,stroke-width:1px
    classDef external fill:#FFD8A8,stroke:#333,stroke-width:1px
    classDef user fill:#EFEFEF,stroke:#333,stroke-width:1pxendmodule
```
