# duchai283/my-quiz-app architecture

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

- Interactive diagram: https://gitdiagram.com/duchai283/my-quiz-app
- Repository: https://github.com/duchai283/my-quiz-app

## Overview

##### Project type and purpose
- This is a single-page frontend web application (“ReMemorize”) built with React, TypeScript, Vite, and Tailwind CSS.
- Its goal is to let the user store personal learning points in JSON and quiz themselves on that material.

##### File structure
Top-level files and directories
- index.html + public/        → static assets and entry point
- package.json, pnpm-lock.json → build & dependency config (Vite, React, TypeScript)
- tailwind.config.js, postcss.config.js → CSS utility framework setup
- src/
– main.tsx                  → React app bootstrap (mount to DOM)
– App.tsx                   → root component, router container
– pages/                    → route-driven views (journal, quizzes)
– components/               → reusable UI (Sidebar, HeroSection, DarkmodeToggle, etc.)
– utils/                    → helper functions and Tailwind class generators
– assets/                   → static media (videos)
– journal-data.json, mock.json, sample-journal-data.json → quiz data sources
– global.css                → base styles

##### README insights
- Core features: list questions, display options, submit/validate answers, navigate next question.
- Optional features: localStorage caching, randomization.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Static Hosting Layer
    subgraph "Static Hosting Layer" 
        direction TB
        HOST_INDEX["index.html"]:::build
        HOST_PUBLIC["public/"]:::build
    end

    %% Build Pipeline
    subgraph "Build Pipeline"
        direction TB
        VITE_CFG["vite.config.ts"]:::build
        PKG_JSON["package.json"]:::build
        PNPM_LOCK["pnpm-lock.yaml"]:::build
        TAILWIND_CFG["tailwind.config.js"]:::build
        POSTCSS_CFG["postcss.config.js"]:::build
    end

    %% Frontend Bootstrap
    subgraph "Frontend Bootstrap"
        direction TB
        ENTRY["src/main.tsx"]:::ui
        ROOT_APP["src/App.tsx"]:::ui
    end

    %% Pages
    subgraph "Pages"
        direction TB
        JOURNAL_PAGE["src/pages/journal/index.tsx"]:::ui
        QUIZZES_PAGE["src/pages/quizzes/index.tsx"]:::ui
    end

    %% UI Components
    subgraph "UI Components"
        direction TB
        SIDEBAR["src/components/Sidebar.tsx"]:::ui
        HERO["src/components/HeroSection.tsx"]:::ui
        JOURNAL_ANS["src/components/JournalAnswer.tsx"]:::ui
        DARK_TOGGLE["src/components/DarkmodeToggle.tsx"]:::ui
    end

    %% Utilities
    subgraph "Utilities"
        direction TB
        UTILS_INDEX["src/utils/index.ts"]:::build
        TAILWIND_UTILS["src/utils/tailwindUtils.ts"]:::build
    end

    %% Data Sources
    subgraph "Data Sources"
        direction TB
        DATA_JOURNAL["src/journal-data.json"]:::data
        DATA_MOCK["src/mock.json"]:::data
        DATA_SAMPLE["src/sample-journal-data.json"]:::data
        LOCAL_STORAGE["localStorage"]:::data
    end

    %% Assets & Styles
    subgraph "Assets & Styles"
        direction TB
        VIDEOS["src/assets/videos/*.mp4"]:::asset
        GLOBAL_CSS["src/global.css"]:::asset
    end

    %% Browser Environment
    BROWSER["User Browser"]:::ui

    %% Relationships
    VITE_CFG -->|builds| HOST_INDEX
    PKG_JSON -->|defines scripts| VITE_CFG
    PNPM_LOCK -->|locks deps| PKG_JSON
    TAILWIND_CFG -->|processes CSS| POSTCSS_CFG
    POSTCSS_CFG -->|generates| HOST_INDEX

    HOST_INDEX -->|serves| BROWSER
    HOST_PUBLIC -->|serves assets| BROWSER

    BROWSER -->|loads| ENTRY
    ENTRY -->|renders| ROOT_APP
    ROOT_APP -->|routes to| JOURNAL_PAGE
    ROOT_APP -->|routes to| QUIZZES_PAGE

    JOURNAL_PAGE -->|uses| SIDEBAR
    JOURNAL_PAGE -->|uses| HERO
    JOURNAL_PAGE -->|uses| JOURNAL_ANS
    JOURNAL_PAGE -->|uses| DARK_TOGGLE

    QUIZZES_PAGE -->|uses| SIDEBAR
    QUIZZES_PAGE -->|uses| HERO
    QUIZZES_PAGE -->|uses| DARK_TOGGLE

    JOURNAL_PAGE -->|loads data via| UTILS_INDEX
    QUIZZES_PAGE -->|loads data via| UTILS_INDEX
    UTILS_INDEX -->|uses| TAILWIND_UTILS

    UTILS_INDEX -->|reads| DATA_JOURNAL
    UTILS_INDEX -->|reads| DATA_MOCK
    UTILS_INDEX -->|reads| DATA_SAMPLE
    UTILS_INDEX -->|reads/writes| LOCAL_STORAGE

    ROOT_APP -->|imports styles| GLOBAL_CSS
    ROOT_APP -->|imports assets| VIDEOS

    %% Click Events
    click HOST_INDEX "https://github.com/duchai283/my-quiz-app/blob/main/index.html"
    click HOST_PUBLIC "https://github.com/duchai283/my-quiz-app/tree/main/public/"
    click VITE_CFG "https://github.com/duchai283/my-quiz-app/blob/main/vite.config.ts"
    click PKG_JSON "https://github.com/duchai283/my-quiz-app/blob/main/package.json"
    click PNPM_LOCK "https://github.com/duchai283/my-quiz-app/blob/main/pnpm-lock.yaml"
    click TAILWIND_CFG "https://github.com/duchai283/my-quiz-app/blob/main/tailwind.config.js"
    click POSTCSS_CFG "https://github.com/duchai283/my-quiz-app/blob/main/postcss.config.js"
    click ENTRY "https://github.com/duchai283/my-quiz-app/blob/main/src/main.tsx"
    click ROOT_APP "https://github.com/duchai283/my-quiz-app/blob/main/src/App.tsx"
    click JOURNAL_PAGE "https://github.com/duchai283/my-quiz-app/blob/main/src/pages/journal/index.tsx"
    click QUIZZES_PAGE "https://github.com/duchai283/my-quiz-app/blob/main/src/pages/quizzes/index.tsx"
    click SIDEBAR "https://github.com/duchai283/my-quiz-app/blob/main/src/components/Sidebar.tsx"
    click HERO "https://github.com/duchai283/my-quiz-app/blob/main/src/components/HeroSection.tsx"
    click JOURNAL_ANS "https://github.com/duchai283/my-quiz-app/blob/main/src/components/JournalAnswer.tsx"
    click DARK_TOGGLE "https://github.com/duchai283/my-quiz-app/blob/main/src/components/DarkmodeToggle.tsx"
    click UTILS_INDEX "https://github.com/duchai283/my-quiz-app/blob/main/src/utils/index.ts"
    click TAILWIND_UTILS "https://github.com/duchai283/my-quiz-app/blob/main/src/utils/tailwindUtils.ts"
    click DATA_JOURNAL "https://github.com/duchai283/my-quiz-app/blob/main/src/journal-data.json"
    click DATA_MOCK "https://github.com/duchai283/my-quiz-app/blob/main/src/mock.json"
    click DATA_SAMPLE "https://github.com/duchai283/my-quiz-app/blob/main/src/sample-journal-data.json"
    click VIDEOS "https://github.com/duchai283/my-quiz-app/tree/main/src/assets/videos/"
    click GLOBAL_CSS "https://github.com/duchai283/my-quiz-app/blob/main/src/global.css"

    %% Styles
    classDef ui fill:#b3d1ff,stroke:#036,stroke-width:1px
    classDef build fill:#d1ffd1,stroke:#063,stroke-width:1px
    classDef data fill:#fff2b3,stroke:#663,stroke-width:1px
    classDef asset fill:#ffd1d1,stroke:#630,stroke-width:1px
```
