# praveen7230/simple-quiz-app architecture

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

- Interactive diagram: https://gitdiagram.com/praveen7230/simple-quiz-app
- Repository: https://github.com/praveen7230/simple-quiz-app

## Overview

##### Project type and purpose
- This is a simple client-server prototype web application consisting of:
- A static front-end (HTML, CSS, vanilla JS, images)
- A mock JSON REST API backend served by JSON Server (Node.js)
- Purpose: Demonstrate front-end interactions with a REST API backed by a JSON file (db.json).

##### File structure
- Top-level assets:
- index.html – entry point for the UI
- styles/bootstrapcss.css – styling (Bootstrap)
- scripts/script.js – front-end logic & HTTP calls
- images/ – static assets
- readme.txt – usage instructions
- .vscode/ – IDE configs (ignore in architecture)
- Backend (“localserver” folder):
- package.json / package-lock.json – JSON Server dependencies
- node_modules/ – installed modules
- db.json – the JSON file acting as the data store
- No additional microservices or build scripts; it is a simple two-component system.

##### README for additional insights
- Instructs to run `npm start` inside localserver → starts JSON Server on default port (3000)
- Then open index.html directly in browser to consume API endpoints
- No build step for the front-end (static files served from local file system)

##### Elements
- Clear labels:
- “Front-end (Browser)” – index.html, script.js, styles/
- “JSON Server (Node.js/Express)” – localserver/package.json
- “Data Store” – localserver/db.json

##### Final advice
- Be as detailed as possible: label ports, HTTP methods, file locations
- Moving parts: static assets, JS logic, runtime server, data file
- Keep it simple: two main components plus data store, connected by HTTP

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Front-end (Browser)"
        Browser["Browser UI"]:::frontend
        HTML["index.html"]:::frontend
        Script["script.js"]:::frontend
        CSS["bootstrapcss.css"]:::frontend
        Images["images/"]:::frontend
    end

    subgraph "JSON Server (Node.js/Express)"
        JSONServer["JSON Server\nlocalhost:3000"]:::backend
        PG["package.json"]:::backend
        NL["node_modules/"]:::backend
        PL["package-lock.json"]:::backend
    end

    DB[(db.json)]:::database

    Doc["readme.txt"]:::docs

    Browser -->|"HTTP GET/POST requests"| JSONServer
    JSONServer -->|"read/write JSON"| DB
    DB -->|"JSON data"| JSONServer
    JSONServer -->|"JSON responses"| Browser

    click HTML "https://github.com/praveen7230/simple-quiz-app/blob/master/index.html"
    click Script "https://github.com/praveen7230/simple-quiz-app/blob/master/scripts/script.js"
    click CSS "https://github.com/praveen7230/simple-quiz-app/blob/master/styles/bootstrapcss.css"
    click Images "https://github.com/praveen7230/simple-quiz-app/tree/master/images/"
    click PG "https://github.com/praveen7230/simple-quiz-app/blob/master/localserver/package.json"
    click NL "https://github.com/praveen7230/simple-quiz-app/tree/master/localserver/node_modules/"
    click PL "https://github.com/praveen7230/simple-quiz-app/blob/master/localserver/package-lock.json"
    click DB "https://github.com/praveen7230/simple-quiz-app/blob/master/localserver/db.json"
    click Doc "https://github.com/praveen7230/simple-quiz-app/blob/master/readme.txt"

    classDef frontend fill:#D0E8FF,stroke:#0366d6;
    classDef backend fill:#D0FFD6,stroke:#28a745;
    classDef database fill:#FFF5D7,stroke:#dbab09;
    classDef docs fill:#F0F0F0,stroke:#888888;
```
