# hsuchen1/misquizapp architecture

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

- Interactive diagram: https://gitdiagram.com/hsuchen1/misquizapp
- Repository: https://github.com/hsuchen1/misquizapp

## Overview

##### Project type and purpose
- This is a single‐page PWA frontend application built with React + Vite + TypeScript.
- It’s an AI‐powered interactive game/app (“AI Studio app”) that calls the external Gemini API for AI functionality.

##### File structure
- Top level:
- App.tsx, index.tsx/js, index.html → entry points for React/Vite
- service-worker.js, manifest.json, metadata.json → PWA & offline support
- components/ → UI screens (Start, Game, Review, GameOver)
- constants.ts, types.ts → shared types and constants
- package.json, tsconfig.json, vite.config.ts → build & tooling config
- No backend folder → purely client-side; external API used for AI calls.

##### README
- Confirms Node.js + Vite dev server locally
- Requires GEMINI_API_KEY in .env.local → calls external Gemini API

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Developer & Build Tools"
        NPM["Node.js & npm"]:::dev
        VITE["Vite Dev Server"]:::dev
    end
    NPM -->|"npm run dev"| VITE

    subgraph "Build & Config"
        VITEConfig["vite.config.ts"]:::client
        TSConfig["tsconfig.json"]:::client
        Package["package.json"]:::client
        Icons["icons/"]:::client
    end
    VITE --> VITEConfig
    VITE --> TSConfig
    VITE --> Package

    subgraph "Static Hosting / CDN"
        CDN["CDN / Static Host"]:::external
    end

    subgraph "Browser & PWA Runtime"
        BROWSER["User's Browser"]:::client
        SW["service-worker.js"]:::client
        CACHE["Cache Storage"]:::client
    end
    BROWSER --> SW
    SW --> CACHE
    BROWSER -->|"GET bundles"| CDN
    CDN --> BROWSER

    subgraph "Frontend Application"
        IndexHTML["index.html"]:::client
        IndexJS["index.tsx"]:::client
        App["App.tsx"]:::client
        subgraph "UI Components"
            Start["StartScreen.tsx"]:::client
            Game["GameScreen.tsx"]:::client
            Review["ReviewModal.tsx"]:::client
            Over["GameOverScreen.tsx"]:::client
        end
        Types["types.ts"]:::client
        Consts["constants.ts"]:::client
        Manifest["manifest.json"]:::client
        Metadata["metadata.json"]:::client
    end
    BROWSER --> IndexHTML
    IndexHTML --> IndexJS
    IndexJS --> App
    App --> Start
    App --> Game
    App --> Review
    App --> Over
    App --> Types
    App --> Consts
    App --> Manifest
    App --> Metadata

    App -->|"POST/GET API calls"| GEMINI["Gemini API Service"]:::external

    classDef client fill:#D0E8FF,stroke:#333,stroke-width:1px
    classDef dev fill:#EEEEEE,stroke:#333,stroke-width:1px
    classDef external fill:#DFFFD0,stroke:#333,stroke-width:1px

    click App "https://github.com/hsuchen1/misquizapp/blob/main/App.tsx"
    click IndexHTML "https://github.com/hsuchen1/misquizapp/blob/main/index.html"
    click IndexJS "https://github.com/hsuchen1/misquizapp/blob/main/index.tsx"
    click SW "https://github.com/hsuchen1/misquizapp/blob/main/service-worker.js"
    click Manifest "https://github.com/hsuchen1/misquizapp/blob/main/manifest.json"
    click Metadata "https://github.com/hsuchen1/misquizapp/blob/main/metadata.json"
    click Start "https://github.com/hsuchen1/misquizapp/blob/main/components/StartScreen.tsx"
    click Game "https://github.com/hsuchen1/misquizapp/blob/main/components/GameScreen.tsx"
    click Review "https://github.com/hsuchen1/misquizapp/blob/main/components/ReviewModal.tsx"
    click Over "https://github.com/hsuchen1/misquizapp/blob/main/components/GameOverScreen.tsx"
    click Types "https://github.com/hsuchen1/misquizapp/blob/main/types.ts"
    click Consts "https://github.com/hsuchen1/misquizapp/blob/main/constants.ts"
    click VITEConfig "https://github.com/hsuchen1/misquizapp/blob/main/vite.config.ts"
    click TSConfig "https://github.com/hsuchen1/misquizapp/blob/main/tsconfig.json"
    click Package "https://github.com/hsuchen1/misquizapp/blob/main/package.json"
    click Icons "https://github.com/hsuchen1/misquizapp/tree/main/icons/"
```
