# leak1415/quiz-website architecture

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

- Interactive diagram: https://gitdiagram.com/leak1415/quiz-website
- Repository: https://github.com/leak1415/quiz-website

## Overview

Quiz Website is a static browser app for taking subject quizzes, viewing results and rankings, and managing an account. The main user journey runs from the landing page through sign-in and the interactive quiz to feedback; users can also visit their profile and the leaderboard. Authentication, quiz progress, and results use browser storage rather than a backend. The README documents the major pages and capabilities; implementation detail is based on the supplied excerpts, so some page-to-page links are documented rather than verified in code.

Main entry points: [`js/quiz.js`](https://github.com/leak1415/quiz-website/blob/main/js/quiz.js) (Quiz engine), [`index.html`](https://github.com/leak1415/quiz-website/blob/main/index.html) (Home dashboard), [`pages/contact.html`](https://github.com/leak1415/quiz-website/blob/main/pages/contact.html) (Contact page), [`auth/register.html`](https://github.com/leak1415/quiz-website/blob/main/auth/register.html) (Registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Site pages"]
  node_home["Home dashboard<br/>[index.html]"]
  node_navigation["Responsive navigation<br/>[nav.js]"]
  node_about["About page<br/>[aboutUs.html]"]
  node_contact["Contact page<br/>[contact.html]"]
  node_contact_logic["Contact form<br/>[contact.js]"]
end

subgraph group_account["Accounts"]
  node_register["Registration<br/>[register.html]"]
  node_register_logic["Registration logic<br/>[register.js]"]
  node_login["Login<br/>[login.html]"]
  node_login_logic["Login logic<br/>[login.js]"]
  node_auth_guard["Session guard<br/>[auth-guard.js]"]
  node_storage[("Browser app data")]
end

subgraph group_quiz["Quiz experience"]
  node_quiz_page["Quiz page<br/>[quiz.html]"]
  node_quiz_engine["Quiz engine<br/>[quiz.js]"]
  node_quiz_sharing["Quiz sharing<br/>[quiz-share.js]"]
  node_results["Results page<br/>[result.html]"]
  node_results_logic["Result feedback<br/>[result.js]"]
end

subgraph group_engagement["Progress and community"]
  node_profile["User profile<br/>[profile.js]"]
  node_leaderboard["Leaderboard<br/>[leaderBoard.js]"]
  node_leaderboard_page["Leaderboard page<br/>[leaderBoard.html]"]
  node_leaderboard_data["Demo rankings<br/>[leaderBoard.json]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens site"| node_home
node_home -->|"offers sign-in"| node_login
node_visitor -->|"creates account"| node_register
node_register -->|"submits form"| node_register_logic
node_register_logic -->|"writes account"| node_storage
node_login -->|"submits credentials"| node_login_logic
node_login_logic -->|"reads and writes"| node_storage
node_home -.->|"uses navigation"| node_navigation
node_visitor -->|"starts quiz"| node_quiz_page
node_quiz_page -->|"runs quiz"| node_quiz_engine
node_quiz_engine -->|"checks session"| node_auth_guard
node_auth_guard -->|"checks session data"| node_storage
node_quiz_engine -->|"parses shared session"| node_quiz_sharing
node_quiz_engine -->|"shows feedback"| node_results
node_results -->|"loads results"| node_results_logic
node_results_logic -->|"reads saved results"| node_storage
node_visitor -->|"manages profile"| node_profile
node_profile -->|"reads and updates"| node_storage
node_visitor -->|"views rankings"| node_leaderboard_page
node_leaderboard_page -.->|"displays rankings"| node_leaderboard
node_leaderboard -->|"loads demo scores"| node_leaderboard_data
node_visitor -->|"visits contact"| node_contact
node_contact -->|"validates form"| node_contact_logic
node_visitor -->|"reads information"| node_about

click node_home "https://github.com/leak1415/quiz-website/blob/main/index.html"
click node_navigation "https://github.com/leak1415/quiz-website/blob/main/js/nav.js"
click node_about "https://github.com/leak1415/quiz-website/blob/main/pages/aboutUs.html"
click node_contact "https://github.com/leak1415/quiz-website/blob/main/pages/contact.html"
click node_contact_logic "https://github.com/leak1415/quiz-website/blob/main/js/contact.js"
click node_register "https://github.com/leak1415/quiz-website/blob/main/auth/register.html"
click node_register_logic "https://github.com/leak1415/quiz-website/blob/main/js/register.js"
click node_login "https://github.com/leak1415/quiz-website/blob/main/auth/login.html"
click node_login_logic "https://github.com/leak1415/quiz-website/blob/main/js/login.js"
click node_auth_guard "https://github.com/leak1415/quiz-website/blob/main/js/auth-guard.js"
click node_quiz_page "https://github.com/leak1415/quiz-website/blob/main/pages/quiz.html"
click node_quiz_engine "https://github.com/leak1415/quiz-website/blob/main/js/quiz.js"
click node_quiz_sharing "https://github.com/leak1415/quiz-website/blob/main/js/quiz-share.js"
click node_results "https://github.com/leak1415/quiz-website/blob/main/pages/result.html"
click node_results_logic "https://github.com/leak1415/quiz-website/blob/main/js/result.js"
click node_profile "https://github.com/leak1415/quiz-website/blob/main/js/profile.js"
click node_leaderboard "https://github.com/leak1415/quiz-website/blob/main/js/leaderBoard.js"
click node_leaderboard_page "https://github.com/leak1415/quiz-website/blob/main/pages/leaderBoard.html"
click node_leaderboard_data "https://github.com/leak1415/quiz-website/blob/main/data/leaderBoard.json"

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_home,node_navigation,node_about,node_contact,node_contact_logic toneBlue
class node_register,node_register_logic,node_login,node_login_logic,node_auth_guard,node_storage toneAmber
class node_quiz_page,node_quiz_engine,node_quiz_sharing,node_results,node_results_logic toneMint
class node_profile,node_leaderboard,node_leaderboard_page,node_leaderboard_data toneRose
class node_visitor toneIndigo
```

## Components

### Site pages

- [Home dashboard](https://github.com/leak1415/quiz-website/blob/main/index.html): `index.html`
- [Responsive navigation](https://github.com/leak1415/quiz-website/blob/main/js/nav.js): `js/nav.js`
- [About page](https://github.com/leak1415/quiz-website/blob/main/pages/aboutUs.html): `pages/aboutUs.html`
- [Contact page](https://github.com/leak1415/quiz-website/blob/main/pages/contact.html): `pages/contact.html`
- [Contact form](https://github.com/leak1415/quiz-website/blob/main/js/contact.js): `js/contact.js`

### Accounts

- [Registration](https://github.com/leak1415/quiz-website/blob/main/auth/register.html): `auth/register.html`
- [Registration logic](https://github.com/leak1415/quiz-website/blob/main/js/register.js): `js/register.js`
- [Login](https://github.com/leak1415/quiz-website/blob/main/auth/login.html): `auth/login.html`
- [Login logic](https://github.com/leak1415/quiz-website/blob/main/js/login.js): `js/login.js`
- [Session guard](https://github.com/leak1415/quiz-website/blob/main/js/auth-guard.js): `js/auth-guard.js`
- **Browser app data**

### Quiz experience

- [Quiz page](https://github.com/leak1415/quiz-website/blob/main/pages/quiz.html): `pages/quiz.html`
- [Quiz engine](https://github.com/leak1415/quiz-website/blob/main/js/quiz.js): `js/quiz.js`
- [Quiz sharing](https://github.com/leak1415/quiz-website/blob/main/js/quiz-share.js): `js/quiz-share.js`
- [Results page](https://github.com/leak1415/quiz-website/blob/main/pages/result.html): `pages/result.html`
- [Result feedback](https://github.com/leak1415/quiz-website/blob/main/js/result.js): `js/result.js`

### Progress and community

- [User profile](https://github.com/leak1415/quiz-website/blob/main/js/profile.js): `js/profile.js`
- [Leaderboard](https://github.com/leak1415/quiz-website/blob/main/js/leaderBoard.js): `js/leaderBoard.js`
- [Leaderboard page](https://github.com/leak1415/quiz-website/blob/main/pages/leaderBoard.html): `pages/leaderBoard.html`
- [Demo rankings](https://github.com/leak1415/quiz-website/blob/main/data/leaderBoard.json): `data/leaderBoard.json`

### Other components

- **Visitor**

## Connections

- Visitor → Home dashboard: opens site (evidence: `README.md`)
- Home dashboard → Login: offers sign-in (evidence: `README.md`)
- Visitor → Registration: creates account (evidence: `README.md`)
- Registration → Registration logic: submits form (evidence: `README.md`)
- Registration logic → Browser app data: writes account (evidence: `js/register.js`)
- Login → Login logic: submits credentials (evidence: `js/login.js`)
- Login logic → Browser app data: reads and writes (evidence: `js/login.js`)
- Home dashboard → Responsive navigation: uses navigation
- Visitor → Quiz page: starts quiz (evidence: `README.md`)
- Quiz page → Quiz engine: runs quiz (evidence: `README.md`)
- Quiz engine → Session guard: checks session (evidence: `js/quiz.js`)
- Session guard → Browser app data: checks session data (evidence: `js/auth-guard.js`)
- Quiz engine → Quiz sharing: parses shared session (evidence: `js/quiz.js`)
- Quiz engine → Results page: shows feedback (evidence: `README.md`)
- Results page → Result feedback: loads results (evidence: `js/result.js`)
- Result feedback → Browser app data: reads saved results (evidence: `js/result.js`)
- Visitor → User profile: manages profile (evidence: `README.md`)
- User profile → Browser app data: reads and updates (evidence: `js/profile.js`)
- Visitor → Leaderboard page: views rankings (evidence: `README.md`)
- Leaderboard page → Leaderboard: displays rankings
- Leaderboard → Demo rankings: loads demo scores (evidence: `js/leaderBoard.js`)
- Visitor → Contact page: visits contact (evidence: `README.md`)
- Contact page → Contact form: validates form (evidence: `js/contact.js`)
- Visitor → About page: reads information (evidence: `README.md`)
