# mechtester/quizmaster architecture

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

- Interactive diagram: https://gitdiagram.com/mechtester/quizmaster
- Repository: https://github.com/mechtester/quizmaster

## Overview

The project “Quiz Master” is a lightweight, interactive web application built entirely with client-side technologies (HTML5, CSS3, and JavaScript) that allows users to both create and take custom quizzes. It leverages browser storage (IndexedDB) for persistent data and utilizes SheetJS for Excel file handling.

##### Project Components
- User Interface (UI): Represented primarily by index.html, script.js (which handles DOM manipulation and logic), and styles.css. The UI is responsible for rendering the quiz screens, navigation buttons, feedback messages, and other interactive elements.
- File Handling Component: The project uses SheetJS to enable Excel (.xlsx) file uploads and downloads. This component validates file structure, parses Excel data, and integrates the question information into the quiz logic.
- Data Storage Module: IndexedDB is used as the local storage solution to persist quiz progress, caching uploaded quiz data, and retaining state across sessions.
- Configuration/Deployment: A CNAME file is present for domain configuration, indicating deployment through a custom domain via js.org.

##### File Structure
- Since the file tree is flat and simple, note that the entire application is built as a single-page application. All front-end code is bundled as individual files without a dedicated backend folder.
- There is no server-side code, so the focus is on client-side interaction.
- The file tree indicates a clean and simple architecture that is entirely browser-driven.

##### README Insights
- The README details two core quiz formats (Q&A and MCQ), file upload flow, quiz navigation, and sample template downloads.
- It specifies using IndexedDB for persistent storage along with SheetJS for Excel file support, which suggests the importance of client-side storage and file parsing in the overall architecture.
- The README includes concrete technical features and expected interactions between components (e.g., file upload → Excel parsing → data validation → quiz execution).

##### Elements
- Use clear labels for all major components (UI, Quiz Engine, File Processing, Local Storage, External Libraries, and Domain Configuration).
- Rectangles for UI components.
- Ovals or circles for functional modules (Quiz Engine, File Processing).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interface Subgraph
    subgraph "User Interface (UI)"
        A1["index.html"]:::ui
        A2["styles.css"]:::ui
        A3["script.js (UI)"]:::ui
    end

    %% Application Logic Subgraph
    subgraph "Application Logic"
        B1["Quiz Engine"]:::logic
        B2["File Processing"]:::logic
    end

    %% Data Storage and External Dependencies
    LS["IndexedDB (Local Storage)"]:::storage
    E1["SheetJS (Excel Library)"]:::external
    C["CNAME (Domain Configuration)"]:::config

    %% Legend Subgraph
    subgraph "Legend"
        LEG1["UI Components (Light Blue)"]
        LEG2["Logic Modules (Light Green)"]
        LEG3["Data Storage (Yellow)"]
        LEG4["External Dependencies (Orange)"]
        LEG5["Configuration (Pink)"]
    end

    %% Connections
    A1 --> A3
    A3 --> B1
    A3 --> B2
    B2 -->|"passesData"| B1
    B1 -->|"usesStorage"| LS
    B2 -->|"integrates"| E1
    A1 -->|"deployedOn"| C

    %% Click Events
    click A1 "https://github.com/mechtester/quizmaster/blob/main/index.html"
    click A2 "https://github.com/mechtester/quizmaster/blob/main/styles.css"
    click A3 "https://github.com/mechtester/quizmaster/blob/main/script.js"
    click B1 "https://github.com/mechtester/quizmaster/blob/main/script.js"
    click B2 "https://github.com/mechtester/quizmaster/blob/main/script.js"
    click C "https://github.com/mechtester/quizmaster/tree/main/CNAME"

    %% Styles
    classDef ui fill:#AED6F1,stroke:#2E86C1,stroke-width:2px;
    classDef logic fill:#A9DFBF,stroke:#28B463,stroke-width:2px;
    classDef storage fill:#F9E79F,stroke:#F1C40F,stroke-width:2px;
    classDef external fill:#FAD7A0,stroke:#E67E22,stroke-width:2px;
    classDef config fill:#F5B7B1,stroke:#C0392B,stroke-width:2px;
```
