# mnjay20/proto-2 architecture

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

- Interactive diagram: https://gitdiagram.com/mnjay20/proto-2
- Repository: https://github.com/mnjay20/proto-2

## Overview

##### Project type and purpose
- From the README (“only frontend”) and the file tree, this is a purely static front-end prototype (“proto-2”) consisting of multiple HTML pages (index.html, chemistry.html, game.html, teacher.html), each with their own stylesheets and JavaScript modules.
- The goal appears to be an educational web app with distinct “Chemistry” and “Game” experiences, plus a “Teacher” interface.

##### File structure
- Top-level:
- README.md
- proto/
- Inside proto/:
- HTML pages: index.html, chemistry.html, game.html, teacher.html
- Styles: style.css (global), chemistry.css, gameStyle.css, teacherdhs.css
- JS folder: chemistry.js, game.js, script.js (likely shared logic), teacher.js
- assets folder (if populated) for images, media, etc.
- No backend or server code—everything is client-side.

##### Key architectural observations
- Pattern: multiple single-page HTML “modules,” each wired to its own CSS and JS.
- A “shared core” script.js likely provides common utilities or navigation code.
- Page-specific JS handles domain logic (experiment simulation, game mechanics, teacher controls).
- CSS split into global vs. page-specific theming.

##### Components
a. UI Layer
- Four HTML pages (Index, Chemistry, Game, Teacher)
- Global CSS (style.css)
- Page CSS modules (chemistry.css, gameStyle.css, teacherdhs.css)
b. Client-side Logic
- Shared logic module (script.js)
- Page logic modules (chemistry.js, game.js, teacher.js)
c. Static Assets
- /assets (images, media)
d. Hosting/Delivery (optional)
- Static Web Host or CDN (e.g., GitHub Pages, S3 + CloudFront)

##### Relationships and data flows
- The Browser loads an HTML page →
- Reads its linked CSS → renders styles
- Loads required JS modules → executes page logic
- script.js may expose shared functions that chemistry.js, game.js, and teacher.js invoke.
- Assets are fetched by HTML/CSS/JS as needed.

##### Architectural patterns / design principles
- Separation of concerns: each page keeps its layout (HTML), style (CSS), and logic (JS) distinct.
- DRY for shared utilities: one script.js.
- Modular CSS and JS per feature/page.

##### What to label
- Each HTML, CSS, and JS file or logical bundle.
- The asset directory.
- The CDN/hosting service.
- File delivery flow
- In-browser dependency loading
- Shared logic calls

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Browser / Client"
        direction TB
        IndexPage["Index Page\nindex.html"]:::htmlclass
        ChemistryPage["Chemistry Page\nchemistry.html"]:::htmlclass
        GamePage["Game Page\ngame.html"]:::htmlclass
        TeacherPage["Teacher Page\nteacher.html"]:::htmlclass
        GlobalCSS["Global Stylesheet\nstyle.css"]:::cssclass
        ChemCSS["Chemistry Stylesheet\nchemistry.css"]:::cssclass
        GameCSS["Game Stylesheet\ngameStyle.css"]:::cssclass
        TeachCSS["Teacher Stylesheet\nteacherdhs.css"]:::cssclass
        SharedJS["Shared Logic Module\nscript.js"]:::jsclass
        ChemJS["Chemistry Logic Module\nchemistry.js"]:::jsclass
        GameJS["Game Logic Module\ngame.js"]:::jsclass
        TeacherJS["Teacher Logic Module\nteacher.js"]:::jsclass
        Assets["Static Assets Directory"]:::assetclass

        IndexPage -->|"loads CSS"| GlobalCSS
        IndexPage -->|"loads JS"| SharedJS

        ChemistryPage -->|"loads CSS"| GlobalCSS
        ChemistryPage -->|"loads CSS"| ChemCSS
        ChemistryPage -->|"loads JS"| SharedJS
        ChemistryPage -->|"loads JS"| ChemJS

        GamePage -->|"loads CSS"| GlobalCSS
        GamePage -->|"loads CSS"| GameCSS
        GamePage -->|"loads JS"| SharedJS
        GamePage -->|"loads JS"| GameJS

        TeacherPage -->|"loads CSS"| GlobalCSS
        TeacherPage -->|"loads CSS"| TeachCSS
        TeacherPage -->|"loads JS"| SharedJS
        TeacherPage -->|"loads JS"| TeacherJS

        ChemJS -->|"calls shared functions"| SharedJS
        GameJS -->|"calls shared functions"| SharedJS
        TeacherJS -->|"calls shared functions"| SharedJS

        ChemistryPage -->|"fetches assets"| Assets
        GamePage -->|"fetches assets"| Assets
        TeacherPage -->|"fetches assets"| Assets
    end

    Hosting["Static Hosting / CDN"]:::hostclass
    Hosting --> IndexPage
    Hosting --> ChemistryPage
    Hosting --> GamePage
    Hosting --> TeacherPage
    Hosting --> GlobalCSS
    Hosting --> ChemCSS
    Hosting --> GameCSS
    Hosting --> TeachCSS
    Hosting --> SharedJS
    Hosting --> ChemJS
    Hosting --> GameJS
    Hosting --> TeacherJS
    Hosting --> Assets

    classDef htmlclass fill:#D0E7FF,stroke:#0366d6,stroke-width:1px
    classDef cssclass fill:#E8F5D4,stroke:#228B22,stroke-width:1px
    classDef jsclass fill:#FFE5B4,stroke:#FF8C00,stroke-width:1px
    classDef assetclass fill:#F0F0F0,stroke:#A9A9A9,stroke-width:1px
    classDef hostclass fill:#F4E1FF,stroke:#800080,stroke-width:1px

    click IndexPage "https://github.com/mnjay20/proto-2/blob/main/proto/index.html"
    click ChemistryPage "https://github.com/mnjay20/proto-2/blob/main/proto/chemistry.html"
    click GamePage "https://github.com/mnjay20/proto-2/blob/main/proto/game.html"
    click TeacherPage "https://github.com/mnjay20/proto-2/blob/main/proto/teacher.html"
    click GlobalCSS "https://github.com/mnjay20/proto-2/blob/main/proto/style.css"
    click ChemCSS "https://github.com/mnjay20/proto-2/blob/main/proto/chemistry.css"
    click GameCSS "https://github.com/mnjay20/proto-2/blob/main/proto/gameStyle.css"
    click TeachCSS "https://github.com/mnjay20/proto-2/blob/main/proto/teacherdhs.css"
    click SharedJS "https://github.com/mnjay20/proto-2/blob/main/proto/js/script.js"
    click ChemJS "https://github.com/mnjay20/proto-2/blob/main/proto/js/chemistry.js"
    click GameJS "https://github.com/mnjay20/proto-2/blob/main/proto/js/game.js"
    click TeacherJS "https://github.com/mnjay20/proto-2/blob/main/proto/js/teacher.js"
    click Assets "https://github.com/mnjay20/proto-2/tree/main/proto/assets"
```
