# gannu11/test architecture

> Architecture diagram of the GitHub repository gannu11/test, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gannu11/test
- Repository: https://github.com/gannu11/test

## Overview

##### Project type and purpose
- This is a static, front-end–only JavaScript quiz game.
- There is no server or database; all logic, data, and presentation live in the browser.

##### File structure
- index.html, restaurant.html – two entry-point pages.
- script.js, restaurant.js – the JavaScript modules containing game logic and page-specific code.
- data.js – the questions, answers, or other static data.
- style.css, rest.css – presentation layers for each page.

##### README for additional insights
- Confirms it’s “A simple javascript quiz game.”
- No mention of external services or build steps.

##### Main components
a. Browser Client
– Renders HTML, applies CSS, executes JS.
b. HTML Pages
– index.html (main quiz UI)
– restaurant.html (secondary quiz or themed page)
c. CSS Files
– style.css (styling for index.html)
– rest.css (styling for restaurant.html)
d. JavaScript Modules
– script.js (quiz logic, event handlers, DOM updates)
– restaurant.js (page-specific logic)
– data.js (quiz data provider)
e. User
– Interacts via clicks, inputs, views feedback

##### Relationships and interactions
- Browser → fetches → HTML pages
- HTML pages → reference → CSS & JS files
- script.js / restaurant.js → import/use → data.js
- JS modules → update → DOM in HTML
- User ↔ interacts with ↔ rendered UI
- (No external API calls or databases)

##### Architectural patterns & design principles
- Separation of concerns:
– HTML for structure, CSS for style, JS for logic and data.
- Data module (data.js) decoupled from UI logic.
- Single-page logic per HTML for simplicity, no routing framework.

##### Detail without over-segmentation
- You don’t need to break script.js into individual functions unless they form separate subsystems.
- Flow: resource loading → data access → UI rendering → user interaction.

## Diagram (Mermaid)

```mermaid
flowchart TD
    User((User)):::actor
    subgraph "Browser Client"
        Index["index.html"]:::html
        Restaurant["restaurant.html"]:::html
        styleCSS["style.css"]:::css
        restCSS["rest.css"]:::css
        Script["script.js"]:::js
        RestaurantJS["restaurant.js"]:::js
        Data["data.js"]:::data
    end

    User -->|"interacts"| Index
    User -->|"interacts"| Restaurant

    Index -->|"loads"| styleCSS
    Index -->|"loads"| Script
    Restaurant -->|"loads"| restCSS
    Restaurant -->|"loads"| RestaurantJS

    Script -->|"reads"| Data
    RestaurantJS -->|"reads"| Data

    Script -->|"manipulates DOM"| Index
    RestaurantJS -->|"manipulates DOM"| Restaurant

    click Index "https://github.com/gannu11/test/blob/master/index.html"
    click Restaurant "https://github.com/gannu11/test/blob/master/restaurant.html"
    click styleCSS "https://github.com/gannu11/test/blob/master/style.css"
    click restCSS "https://github.com/gannu11/test/blob/master/rest.css"
    click Script "https://github.com/gannu11/test/blob/master/script.js"
    click RestaurantJS "https://github.com/gannu11/test/blob/master/restaurant.js"
    click Data "https://github.com/gannu11/test/blob/master/data.js"

    classDef html fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef js fill:#90EE90,stroke:#333,stroke-width:1px
    classDef css fill:#FFA500,stroke:#333,stroke-width:1px
    classDef data fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef actor fill:#FFFFFF,stroke:#333,stroke-width:1px,shape:circle
    classDef browser fill:#F0F0F0,stroke:#333,stroke-width:2px,stroke-dasharray: 5 5
```
