# harishkumar1112001/online-test-application architecture

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

- Interactive diagram: https://gitdiagram.com/harishkumar1112001/online-test-application
- Repository: https://github.com/harishkumar1112001/online-test-application

## Overview

##### Project type and purpose
- This is a full‑stack web application (“Online Test Application”) that lets users sign up, read rules, answer a set of quiz questions, and then persists their final score to a MongoDB database.
- The frontend uses plain HTML/CSS/JavaScript (templates in `/templates`, CSS in `/style`, client scripts in `/modules`). The backend is Node.js (entrypoint `index.js`) serving pages and handling REST‑style endpoints. MongoDB stores user and score data.

##### File structure
- Top‑level:
- `index.js` (your Express server entrypoint; implied by README’s `node index.js`)
- `/templates` – HTML view files (about, signup, question pages, etc.)
- `/style` – CSS files for each page plus a global stylesheet
- `/modules` – server‑side modules (`signup.js` handles registration logic; `script.js` handles quiz logic and scoring)
- `/assets` (and `/Images`) – static images and screenshot/flowchart
- `package.json` / `package-lock.json` – Node dependencies
- Config/deployment: `.gitignore`, `.vscode`, `LICENSE`

##### README for additional insights
- Technology stack explicitly spelled out: HTML, CSS, JS frontend; Node.js/Javascript backend; MongoDB database.
- There’s a flowchart in `/assets` showing user signup → rules page → quiz questions → score display → DB update.

##### Elements
- Clear, descriptive labels for each component (e.g., “Express App (index.js)”, “Signup Module”, “Quiz Module”, “MongoDB Atlas”)
- Browser → Server (HTTP GET/POST)
- Server → Database (CRUD operations)
- Server → Browser (HTML/JSON responses)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        Browser["Browser"]:::client
    end

    %% Frontend Assets
    subgraph "HTML Templates"
        About_HTML["about.html"]:::templates
        Index_HTML["index.html"]:::templates
        QuestionCss_HTML["questionCss.html"]:::templates
        QuestionHtml_HTML["questionHtml.html"]:::templates
        QuestionJs_HTML["questionJavaScript.html"]:::templates
        Signup_HTML["signup.html"]:::templates
    end

    subgraph "Static CSS Assets"
        About_CSS["about.css"]:::css
        Home_CSS["home.css"]:::css
        Signup_CSS["signup.css"]:::css
        Global_CSS["style.css"]:::css
    end

    subgraph "Static Images & Flowchart"
        Assets_Flowchart["flowChartOfTheApplication.png"]:::assets
        Assets_Dir["assets/"]:::assets
        Images_Dir["Images/"]:::assets
    end

    %% Server Layer
    subgraph "Server Layer"
        ExpressApp["Express App (index.js)"]:::server
        SignupModule["Signup Module"]:::module
        QuizModule["Quiz Module"]:::module
        StaticMiddleware["Static Middleware"]:::server
        TemplateEngine["Template Engine"]:::server
    end

    %% Data Layer
    MongoDB[(MongoDB Atlas)]:::db

    %% Config & Metadata
    subgraph "Package Configuration"
        PackageJSON["package.json"]:::config
        PackageLock["package-lock.json"]:::config
    end

    subgraph "Project Metadata & Config"
        README["README.md"]:::meta
        LICENSE["LICENSE"]:::meta
        Gitignore[".gitignore"]:::meta
        VSCode[".vscode/"]:::meta
    end

    %% Connections
    Browser -->|"HTTP GET /signup, /quiz"| ExpressApp
    Browser -->|"loads HTML/CSS/JS"| TemplateEngine
    TemplateEngine -->|"renders HTML"| ExpressApp
    ExpressApp -->|"uses signup logic"| SignupModule
    ExpressApp -->|"uses quiz logic"| QuizModule
    ExpressApp -->|"serves static files"| StaticMiddleware
    StaticMiddleware --> About_CSS
    StaticMiddleware --> Home_CSS
    StaticMiddleware --> Signup_CSS
    StaticMiddleware --> Global_CSS
    StaticMiddleware --> Assets_Flowchart
    StaticMiddleware --> Assets_Dir
    StaticMiddleware --> Images_Dir
    ExpressApp --> About_HTML
    ExpressApp --> Index_HTML
    ExpressApp --> QuestionCss_HTML
    ExpressApp --> QuestionHtml_HTML
    ExpressApp --> QuestionJs_HTML
    ExpressApp --> Signup_HTML
    SignupModule -->|"DB insert user"| MongoDB
    QuizModule -->|"DB update score"| MongoDB
    MongoDB -->|"response"| SignupModule
    MongoDB -->|"response"| QuizModule

    %% Click Events
    click ExpressApp "https://github.com/harishkumar1112001/online-test-application/blob/main/index.js"
    click SignupModule "https://github.com/harishkumar1112001/online-test-application/blob/main/modules/signup.js"
    click QuizModule "https://github.com/harishkumar1112001/online-test-application/blob/main/modules/script.js"
    click About_HTML "https://github.com/harishkumar1112001/online-test-application/blob/main/templates/about.html"
    click Index_HTML "https://github.com/harishkumar1112001/online-test-application/blob/main/templates/index.html"
    click QuestionCss_HTML "https://github.com/harishkumar1112001/online-test-application/blob/main/templates/questionCss.html"
    click QuestionHtml_HTML "https://github.com/harishkumar1112001/online-test-application/blob/main/templates/questionHtml.html"
    click QuestionJs_HTML "https://github.com/harishkumar1112001/online-test-application/blob/main/templates/questionJavaScript.html"
    click Signup_HTML "https://github.com/harishkumar1112001/online-test-application/blob/main/templates/signup.html"
    click About_CSS "https://github.com/harishkumar1112001/online-test-application/blob/main/style/about.css"
    click Home_CSS "https://github.com/harishkumar1112001/online-test-application/blob/main/style/home.css"
    click Signup_CSS "https://github.com/harishkumar1112001/online-test-application/blob/main/style/signup.css"
    click Global_CSS "https://github.com/harishkumar1112001/online-test-application/blob/main/style/style.css"
    click Assets_Flowchart "https://github.com/harishkumar1112001/online-test-application/blob/main/assets/flowChartOfTheApplication.png"
    click Assets_Dir "https://github.com/harishkumar1112001/online-test-application/tree/main/assets/"
    click Images_Dir "https://github.com/harishkumar1112001/online-test-application/tree/main/Images/"
    click PackageJSON "https://github.com/harishkumar1112001/online-test-application/blob/main/package.json"
    click PackageLock "https://github.com/harishkumar1112001/online-test-application/blob/main/package-lock.json"
    click README "https://github.com/harishkumar1112001/online-test-application/blob/main/README.md"
    click LICENSE "https://github.com/harishkumar1112001/online-test-application/tree/main/LICENSE"
    click Gitignore "https://github.com/harishkumar1112001/online-test-application/blob/main/.gitignore"
    click VSCode "https://github.com/harishkumar1112001/online-test-application/tree/main/.vscode/"

    %% Styles
    classDef client fill:#fff2cc,stroke:#e2c08d
    classDef server fill:#d0e1f9,stroke:#88a3c1
    classDef module fill:#aaccee,stroke:#6699bb
    classDef templates fill:#d9ead3,stroke:#a4c2a5
    classDef css fill:#d9ead3,stroke:#a4c2a5
    classDef assets fill:#f4cccc,stroke:#dd7e6b
    classDef db fill:#c9daf8,stroke:#6d9eeb,stroke-width:2px
    classDef config fill:#f3f3f3,stroke:#cccccc
    classDef meta fill:#f3f3f3,stroke:#bbbbbb
```
