# samrat9x/questionmaker architecture

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

- Interactive diagram: https://gitdiagram.com/samrat9x/questionmaker
- Repository: https://github.com/samrat9x/questionmaker

## Overview

##### Main Components

a. Frontend Layer:
- HTML Interface (index.html)
- Styling Component (style.css)
- Application Logic (script.js)
- Static Assets (img directory)

b. Data Layer:
- JSON Data Store (data directory)
- Class-specific question banks
- Subject-specific content

**[User Interface Layer]**

- ▼
**[Application Logic Layer]**

- ▼
**[Data Storage Layer]**

##### Component Details

User Interface Layer:
- Components for:
- Question paper configuration interface
- Question display area
- Subject/Class selection controls

Application Logic Layer:
- Question selection algorithm
- Paper generation logic
- Data parsing and manipulation

Data Storage Layer:
- JSON data structure
- Separate containers for:
- Class 7 (Mathematics, Science)
- Class 11 (ICT)

##### Flow Representation

- User input flow → Application logic
- Data retrieval flow between JSON files and application logic
- Question paper output flow to the user interface

##### Additional Elements

Annotations for:
- File formats (.json, .html, .css, .js)
- Data flow direction
- User interaction points

##### Specific Implementation Notes

- The client-side nature of the application
- JSON data organization by class and subject
- The separation between presentation and data layers

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef ui fill:#e6f3ff,stroke:#3498db
    classDef logic fill:#e6ffe6,stroke:#2ecc71
    classDef data fill:#fff7e6,stroke:#f1c40f
    classDef static fill:#f5f5f5,stroke:#95a5a6

    %% Legend
    subgraph Legend
        L1[User Interface]:::ui
        L2[Application Logic]:::logic
        L3[Data Storage]:::data
        L4[Static Assets]:::static
    end

    %% User Interface Layer
    subgraph UI
        WebInterface[Web Interface]:::ui
        ConfigUI[Question Paper Configuration]:::ui
        DisplayArea[Question Display Area]:::ui
        SelectionControls[Subject/Class Selection]:::ui
    end

    %% Application Logic Layer
    subgraph Logic
        AppLogic[Question Paper Generator Logic]:::logic
        QuestionSelect[Question Selection Algorithm]:::logic
        DataParser[Data Parsing Module]:::logic
    end

    %% Data Storage Layer
    subgraph Data
        QuestionBank[Question Bank Root]:::data
        Class7[Class 7 Questions]:::data
        Class11[Class 11 Questions]:::data
        Math7[Mathematics]:::data
        Science7[Science]:::data
        ICT11[ICT]:::data
    end

    %% Static Assets
    StaticAssets[Static Assets]:::static

    %% Relationships
    WebInterface --> ConfigUI
    WebInterface --> DisplayArea
    WebInterface --> SelectionControls
    
    ConfigUI --> AppLogic
    SelectionControls --> AppLogic
    
    AppLogic --> QuestionSelect
    AppLogic --> DataParser
    
    DataParser --> QuestionBank
    QuestionBank --> Class7
    QuestionBank --> Class11
    
    Class7 --> Math7
    Class7 --> Science7
    Class11 --> ICT11
    
    QuestionSelect --> DisplayArea

    %% Click Events
    click WebInterface "https://github.com/samrat9x/QuestionMaker/blob/main/index.html"
    click AppLogic "https://github.com/samrat9x/QuestionMaker/blob/main/script.js"
    click StaticAssets "https://github.com/samrat9x/QuestionMaker/tree/main/img/"
    click QuestionBank "https://github.com/samrat9x/QuestionMaker/tree/main/data/"
    click Class7 "https://github.com/samrat9x/QuestionMaker/tree/main/data/class7/"
    click Class11 "https://github.com/samrat9x/QuestionMaker/tree/main/data/class11/"
    click Math7 "https://github.com/samrat9x/QuestionMaker/blob/main/data/class7/class7_math.json"
    click Science7 "https://github.com/samrat9x/QuestionMaker/blob/main/data/class7/class7_science.json"
    click ICT11 "https://github.com/samrat9x/QuestionMaker/blob/main/data/class11/class11_ict.json"
```
