# akshatkardak/quiz-application architecture

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

- Interactive diagram: https://gitdiagram.com/akshatkardak/quiz-application
- Repository: https://github.com/akshatkardak/quiz-application

## Overview

##### Project type and purpose
- This is a static, client-side web application: a simple quiz built with HTML, CSS and JavaScript.
- Purpose: present a series of questions (from questions.js), allow the user to select answers, track the score, and provide feedback.

##### File structure
- index.html: the single entry point, contains the markup and references to style.css, script.js and questions.js.
- style.css: all styling rules for layout and visual feedback.
- questions.js: a module or JSON-like structure that holds the quiz questions, choices and correct answers.
- script.js: contains the core application logic—event handlers, state management (current question index, score), DOM updates.

##### Extract insights from the README
- Describes features: “Start Quiz” button, answer selection, “Next” button, score display.
- No backend or external services—everything runs in the browser.
- Technology stack: HTML, CSS, JavaScript.

a. Main components to represent
- User (browser)
- UI layer (HTML + CSS)
- Quiz Logic module (script.js)
- Data Store (questions.js)
- Feedback & Score Display
b. Relationships and data flow
- User → interacts with UI (click Start/Next, select an answer)
- UI events → Quiz Logic
- Quiz Logic ↔ Data Store (fetch question, validate answer)
- Quiz Logic → UI (render question, update score, show feedback)
c. Architectural patterns & principles
- Separation of concerns: data (questions.js), presentation (index.html + style.css), logic (script.js).
- Event-driven flow: click events drive state transitions.
d. Technologies & frameworks
- Native browser APIs (DOM, events)
- No frameworks—plain JavaScript modules.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User entity
    User((User)):::user

    %% Presentation/UI Layer
    subgraph "Presentation/UI Layer"
        HTML["index.html"]:::frontend
        CSS["style.css"]:::frontend
    end

    %% Logic Layer
    subgraph "Logic Layer"
        Logic["script.js"]:::logic
    end

    %% Data Layer
    subgraph "Data Layer"
        Data["questions.js"]:::data
    end

    %% Documentation
    README["README.md"]:::doc

    %% Connections
    User -->|"interacts with UI"| HTML
    User -->|"interacts with UI"| CSS
    HTML -->|"triggers events"| Logic
    CSS -->|"styles UI"| HTML
    Logic -->|"loads questions"| Data
    Data -->|"provides data"| Logic
    Logic -->|"updates UI"| HTML

    %% Click Events
    click HTML "https://github.com/akshatkardak/quiz-application/blob/main/index.html"
    click CSS "https://github.com/akshatkardak/quiz-application/blob/main/style.css"
    click Logic "https://github.com/akshatkardak/quiz-application/blob/main/script.js"
    click Data "https://github.com/akshatkardak/quiz-application/blob/main/questions.js"
    click README "https://github.com/akshatkardak/quiz-application/blob/main/README.md"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef logic fill:#90EE90,stroke:#333,stroke-width:1px
    classDef data fill:#FFA500,stroke:#333,stroke-width:1px
    classDef user fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef doc fill:#E6E6FA,stroke:#333,stroke-width:1px
```
