# neruvy/duckmath architecture

> Architecture diagram of the GitHub repository neruvy/duckmath, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/neruvy/duckmath
- Repository: https://github.com/neruvy/duckmath

## Overview

#### Purpose and Runtime
DuckMath is a static browser-games portal intended for deployment on GitHub Pages, Vercel, Cloudflare Pages, or another CDN-backed static host. The repository contains HTML, CSS, browser JavaScript, image assets, and one Python maintenance script; no backend, package manifest, serverless function, or game binaries are present in the supplied tree.

#### Primary Entry Points
- The public landing/catalog entry is `index.html`, with client behavior concentrated in `assets/js/index.js`.
- Game selection routes to the game player/catalog page at `g4m3s/index.html`, typically using a `title` query parameter.
- Site-wide browser initialization and reusable UI behavior are centered in `assets/js/main.js` and `assets/js/app_functions.js`.
- Fallback/loading entry documents are `404.html`, `g404.html`, and `loading.html`.

#### Catalog and Game-Launch Boundary
The site’s key product flow is: visitor opens the homepage, browses/searches catalog UI, then navigates to `g4m3s/index.html?title=<game>`. The README describes games as HTML5/WebGL content or iframe wrappers, so the player page is the boundary between first-party static portal UI and externally hosted or embedded game content. Relevant paths: `index.html`, `g4m3s/index.html`, `assets/js/index.js`.

#### Shared Presentation and Client State
Common navigation, styles, and interaction code are delivered directly to the browser rather than compiled from a framework. `assets/css/main.css` and `assets/css/topnav.css` define shared presentation; `assets/js/main.js` and `assets/js/app_functions.js` provide cross-page behavior. This makes each HTML page independently deployable but requires shared assets to remain path-compatible across root and nested directories.

#### Community and Ranking Surface
Leaderboard presentation is a separate page/client module: `leaderboard.html` and `assets/js/leaderboard.js`, styled by `assets/css/leaderboard.css`. The README claims score submission, verification, authentication, coins, and seasonal progression, but the visible tree does not include their backend/API implementation. Treat Supabase, moderation workflows, image scanning, and transaction storage as external or undisclosed service boundaries rather than repository-owned components.

#### Access, Cloaking, and External Integrations
Browser-side cloaking and alternate-access features are represented by `assets/js/ab-blank.js`, `more/tab-cloak.html`, and proxy-related app pages under `more/apps/` such as `more/apps/ram2.html`. The README also identifies third-party proxy backends and WidgetBot/Discord integration; these are external runtime dependencies configured or embedded by static pages, not local services in this tree.

#### Static Content, Discovery, and Operations
Informational and utility routes live as standalone documents, including `about.html`, `links/index.html`, and `more/index.html`. Search-engine exposure is controlled by `robots.txt` and `sitemap.xml`; advertising inventory is declared in `ads.txt` and supported by `advertise.html`. `backup_classes.json` is a repository data artifact, while `duck-to-ducky.py` is an offline Python utility, not part of the browser request path.

Main entry points: [`index.html`](https://github.com/neruvy/duckmath/blob/main/index.html) (Catalog landing), [`leaderboard.html`](https://github.com/neruvy/duckmath/blob/main/leaderboard.html) (Leaderboard page), [`more/tab-cloak.html`](https://github.com/neruvy/duckmath/blob/main/more/tab-cloak.html) (Cloaking and alternate access), [`g4m3s/index.html`](https://github.com/neruvy/duckmath/blob/main/g4m3s/index.html) (Game player)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Static portal"]
  node_static_host{{"CDN static host<br/>deployment"}}
  node_home["Catalog landing<br/>HTML entry<br/>[index.html]"]
  node_catalog_client["Catalog UI<br/>browser JavaScript<br/>[index.js]"]
  node_shared_client["Shared UI behavior<br/>browser JavaScript<br/>[main.js]"]
  node_ui_helpers["UI helpers<br/>browser JavaScript<br/>[app_functions.js]"]
  node_shared_styles["Shared styles<br/>CSS<br/>[main.css]"]
  node_top_navigation["Top navigation styles<br/>CSS<br/>[topnav.css]"]
  node_fallback_pages["Fallback and loading pages<br/>static documents<br/>[404.html]"]
end

subgraph group_features["Feature surfaces"]
  node_game_player["Game player<br/>HTML entry<br/>[index.html]"]
  node_leaderboard["Leaderboard page<br/>HTML entry<br/>[leaderboard.html]"]
  node_leaderboard_client["Leaderboard UI<br/>browser JavaScript<br/>[leaderboard.js]"]
  node_leaderboard_styles["Leaderboard styles<br/>CSS<br/>[leaderboard.css]"]
  node_cloak_access["Cloaking and alternate access<br/>static feature pages<br/>[tab-cloak.html]"]
  node_cloak_client["Blank-tab cloaking<br/>browser JavaScript<br/>[ab-blank.js]"]
  node_proxy_apps["Proxy app pages<br/>static app pages<br/>[ram2.html]"]
  node_utility_routes["Info and utility routes<br/>static documents<br/>[index.html]"]
end

subgraph group_external["External boundaries"]
  node_embedded_games{{"Hosted game content<br/>external game runtime"}}
  node_community_services{{"Community services<br/>external service boundary"}}
  node_proxy_backends{{"Proxy and community integrations<br/>external integrations"}}
end

subgraph group_operations["Discovery and maintenance"]
  node_search_discovery["Search discovery<br/>crawl metadata<br/>[robots.txt]"]
  node_ad_inventory["Advertising inventory<br/>ad metadata<br/>[ads.txt]"]
  node_backup_data[("Class backup data<br/>repository data")]
  node_maintenance_script["Offline maintenance utility<br/>Python script<br/>[duck-to-ducky.py]"]
end

node_static_host -->|"serves"| node_home
node_static_host -->|"serves"| node_game_player
node_static_host -->|"serves"| node_leaderboard
node_static_host -->|"serves"| node_cloak_access
node_static_host -->|"serves"| node_utility_routes
node_static_host -->|"serves"| node_fallback_pages
node_home -->|"loads"| node_catalog_client
node_home -->|"loads"| node_shared_client
node_home -->|"uses"| node_ui_helpers
node_home -->|"styles"| node_shared_styles
node_home -->|"styles"| node_top_navigation
node_catalog_client -->|"navigates with title"| node_game_player
node_game_player -->|"loads or embeds"| node_embedded_games
node_leaderboard -->|"loads"| node_leaderboard_client
node_leaderboard -->|"styles"| node_leaderboard_styles
node_leaderboard_client -.->|"depends on"| node_community_services
node_cloak_access -->|"uses"| node_cloak_client
node_cloak_access -->|"links to"| node_proxy_apps
node_proxy_apps -.->|"connects to"| node_proxy_backends
node_static_host -->|"publishes"| node_search_discovery
node_static_host -->|"publishes"| node_ad_inventory
node_maintenance_script -.->|"maintains"| node_backup_data

click node_home "https://github.com/neruvy/duckmath/blob/main/index.html"
click node_catalog_client "https://github.com/neruvy/duckmath/blob/main/assets/js/index.js"
click node_shared_client "https://github.com/neruvy/duckmath/blob/main/assets/js/main.js"
click node_ui_helpers "https://github.com/neruvy/duckmath/blob/main/assets/js/app_functions.js"
click node_shared_styles "https://github.com/neruvy/duckmath/blob/main/assets/css/main.css"
click node_top_navigation "https://github.com/neruvy/duckmath/blob/main/assets/css/topnav.css"
click node_game_player "https://github.com/neruvy/duckmath/blob/main/g4m3s/index.html"
click node_leaderboard "https://github.com/neruvy/duckmath/blob/main/leaderboard.html"
click node_leaderboard_client "https://github.com/neruvy/duckmath/blob/main/assets/js/leaderboard.js"
click node_leaderboard_styles "https://github.com/neruvy/duckmath/blob/main/assets/css/leaderboard.css"
click node_cloak_access "https://github.com/neruvy/duckmath/blob/main/more/tab-cloak.html"
click node_cloak_client "https://github.com/neruvy/duckmath/blob/main/assets/js/ab-blank.js"
click node_proxy_apps "https://github.com/neruvy/duckmath/blob/main/more/apps/ram2.html"
click node_utility_routes "https://github.com/neruvy/duckmath/blob/main/more/index.html"
click node_fallback_pages "https://github.com/neruvy/duckmath/blob/main/404.html"
click node_search_discovery "https://github.com/neruvy/duckmath/blob/main/robots.txt"
click node_ad_inventory "https://github.com/neruvy/duckmath/blob/main/ads.txt"
click node_backup_data "https://github.com/neruvy/duckmath/blob/main/backup_classes.json"
click node_maintenance_script "https://github.com/neruvy/duckmath/blob/main/duck-to-ducky.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_static_host,node_home,node_catalog_client,node_shared_client,node_ui_helpers,node_shared_styles,node_top_navigation,node_fallback_pages toneBlue
class node_game_player,node_leaderboard,node_leaderboard_client,node_leaderboard_styles,node_cloak_access,node_cloak_client,node_proxy_apps,node_utility_routes toneAmber
class node_embedded_games,node_community_services,node_proxy_backends toneMint
class node_search_discovery,node_ad_inventory,node_backup_data,node_maintenance_script toneRose
```

## Components

### Static portal

Browser-delivered pages and shared assets.

- **CDN static host**: deployment · Serves independently deployable static files.
- [Catalog landing](https://github.com/neruvy/duckmath/blob/main/index.html): HTML entry · `index.html`
- [Catalog UI](https://github.com/neruvy/duckmath/blob/main/assets/js/index.js): browser JavaScript · Provides browsing and search behavior. · `assets/js/index.js`
- [Shared UI behavior](https://github.com/neruvy/duckmath/blob/main/assets/js/main.js): browser JavaScript · `assets/js/main.js`
- [UI helpers](https://github.com/neruvy/duckmath/blob/main/assets/js/app_functions.js): browser JavaScript · `assets/js/app_functions.js`
- [Shared styles](https://github.com/neruvy/duckmath/blob/main/assets/css/main.css): CSS · `assets/css/main.css`
- [Top navigation styles](https://github.com/neruvy/duckmath/blob/main/assets/css/topnav.css): CSS · `assets/css/topnav.css`
- [Fallback and loading pages](https://github.com/neruvy/duckmath/blob/main/404.html): static documents · `404.html`

### Feature surfaces

- [Game player](https://github.com/neruvy/duckmath/blob/main/g4m3s/index.html): HTML entry · Receives the selected game through the title query parameter. · `g4m3s/index.html`
- [Leaderboard page](https://github.com/neruvy/duckmath/blob/main/leaderboard.html): HTML entry · `leaderboard.html`
- [Leaderboard UI](https://github.com/neruvy/duckmath/blob/main/assets/js/leaderboard.js): browser JavaScript · `assets/js/leaderboard.js`
- [Leaderboard styles](https://github.com/neruvy/duckmath/blob/main/assets/css/leaderboard.css): CSS · `assets/css/leaderboard.css`
- [Cloaking and alternate access](https://github.com/neruvy/duckmath/blob/main/more/tab-cloak.html): static feature pages · `more/tab-cloak.html`
- [Blank-tab cloaking](https://github.com/neruvy/duckmath/blob/main/assets/js/ab-blank.js): browser JavaScript · `assets/js/ab-blank.js`
- [Proxy app pages](https://github.com/neruvy/duckmath/blob/main/more/apps/ram2.html): static app pages · `more/apps/ram2.html`
- [Info and utility routes](https://github.com/neruvy/duckmath/blob/main/more/index.html): static documents · `more/index.html`

### External boundaries

Dependencies not implemented in this repository.

- **Hosted game content**: external game runtime · HTML5, WebGL, or iframe game content.
- **Community services**: external service boundary · Auth, scores, verification, coins, and seasons are undisclosed.
- **Proxy and community integrations**: external integrations · Third-party proxy and WidgetBot/Discord services.

### Discovery and maintenance

- [Search discovery](https://github.com/neruvy/duckmath/blob/main/robots.txt): crawl metadata · `robots.txt`
- [Advertising inventory](https://github.com/neruvy/duckmath/blob/main/ads.txt): ad metadata · `ads.txt`
- [Class backup data](https://github.com/neruvy/duckmath/blob/main/backup_classes.json): repository data · `backup_classes.json`
- [Offline maintenance utility](https://github.com/neruvy/duckmath/blob/main/duck-to-ducky.py): Python script · Not part of the browser request path. · `duck-to-ducky.py`

## Connections

- CDN static host → Catalog landing: serves
- CDN static host → Game player: serves
- CDN static host → Leaderboard page: serves
- CDN static host → Cloaking and alternate access: serves
- CDN static host → Info and utility routes: serves
- CDN static host → Fallback and loading pages: serves
- Catalog landing → Catalog UI: loads
- Catalog landing → Shared UI behavior: loads
- Catalog landing → UI helpers: uses
- Catalog landing → Shared styles: styles
- Catalog landing → Top navigation styles: styles
- Catalog UI → Game player: navigates with title
- Game player → Hosted game content: loads or embeds
- Leaderboard page → Leaderboard UI: loads
- Leaderboard page → Leaderboard styles: styles
- Leaderboard UI → Community services: depends on
- Cloaking and alternate access → Blank-tab cloaking: uses
- Cloaking and alternate access → Proxy app pages: links to
- Proxy app pages → Proxy and community integrations: connects to
- CDN static host → Search discovery: publishes
- CDN static host → Advertising inventory: publishes
- Offline maintenance utility → Class backup data: maintains
