# evavic44/quiznote architecture

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

- Interactive diagram: https://gitdiagram.com/evavic44/quiznote
- Repository: https://github.com/evavic44/quiznote

## Overview

##### Project type and purpose
- Quiznote is a cloud‑hosted, full‑stack web application built with Next.js.
- Its purpose is to transform user‐provided notes into interactive quizzes via Google’s Gemini AI (Vertex AI) API, helping users retain what they learn.

##### File structure
- Top level:
- next.config.mjs, tsconfig.json, tailwind.config.ts → Next.js & TypeScript + Tailwind CSS configs
- public/ → static assets (images, logo) served by Vercel CDN
- data/ → sample input files (PDF, text, JSON templates) used by developers
- src/app/ → Next.js “app·directory” routes:
- page.tsx, layout.tsx, globals.css, not‑found.tsx → UI shell & global styles
- api/generate/route.ts → serverless API endpoint that calls Gemini
- src/components/ → React UI components:
- global (Navbar, Footer, mobile menu)
- pages (FormContainer, QuizContainer, Summary, etc.)
- shared (buttons, loading indicators, progress bars)
- src/store/ → client‐side state stores (likely Zustand or Context): form data, quiz data, timer
- src/actions/graph.ts → business logic that may transform AI output into the quiz graph/structure

##### README for additional insights
- Integration file: route.ts is the bridge to Gemini AI
- UI framework: Next.js + TailwindCSS
- Hosted on Vercel, no external database—state is in memory

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Side
    subgraph "Client (Browser)"
        direction TB
        Browser["Browser"]:::browser
        subgraph "Next.js Frontend" 
            direction TB
            subgraph "App Shell & Routes" 
                direction TB
                Page["page.tsx"]:::frontend
                Layout["layout.tsx"]:::frontend
                NotFound["not-found.tsx"]:::frontend
                GlobalsCSS["globals.css"]:::frontend
            end
            subgraph "UI Components"
                direction TB
                subgraph Global
                    Navbar["Navbar.tsx"]:::frontend
                    Footer["Footer.tsx"]:::frontend
                    MobileMenu["MobileMenu.tsx"]:::frontend
                    Hamburger["Hamburger.tsx"]:::frontend
                    BugReport["BugReport.tsx"]:::frontend
                end
                subgraph Pages
                    FormContainer["FormContainer.tsx"]:::frontend
                    QuizContainer["QuizContainer.tsx"]:::frontend
                    Summary["Summary.tsx"]:::frontend
                    Form["Form.tsx"]:::frontend
                    FileNote["FileNote.tsx"]:::frontend
                    TextNote["TextNote.tsx"]:::frontend
                    Quiz["Quiz.tsx"]:::frontend
                end
                subgraph Shared
                    Button["Button.tsx"]:::frontend
                    Loading["Loading.tsx"]:::frontend
                    ProgressBar["ProgressBar.tsx"]:::frontend
                    CountdownTimer["CountdownTimer.tsx"]:::frontend
                    Container["Container.tsx"]:::frontend
                    Header["Header.tsx"]:::frontend
                    TabComponent["TabComponent.tsx"]:::frontend
                    GeminiBadge["GeminiBadge.tsx"]:::frontend
                    Social["Social.tsx"]:::frontend
                end
                subgraph Icons
                    GeminiIcon["Gemini.tsx"]:::frontend
                end
            end
            subgraph "Client State Store"
                direction TB
                FormStore["form.ts"]:::store
                QuizStore["quiz.ts"]:::store
                TimerStore["timer.ts"]:::store
            end
            Actions["graph.ts"]:::logic
        end
    end

    %% Server Side
    subgraph "Server (Vercel Serverless)"
        direction TB
        APIRoute["route.ts"]:::server
    end

    %% External Services
    Gemini["Gemini AI (Vertex AI)"]:::external
    CDN["Static Assets & CDN"]:::cdn

    %% Interactions
    Browser -->|"renders"| Page
    Page -->|uses| UIComponents
    UIComponents -->|reads/writes| FormStore
    UIComponents -->|reads/writes| QuizStore
    UIComponents -->|reads/writes| TimerStore
    UIComponents -->|onGenerateQuiz| APIRoute
    APIRoute -->|"calls API"| Gemini
    Gemini -->|"returns quiz JSON"| APIRoute
    APIRoute -->|"returns JSON"| QuizStore
    QuizStore -->|updates UI| UIComponents
    CDN -->|serves assets| Browser

    %% Environment Variable
    subgraph "Environment"
        direction TB
        Env["GOOGLE_SERVICE_KEY"]:::env
    end
    Env --> APIRoute

    %% Click Events
    click Page "https://github.com/evavic44/quiznote/blob/main/src/app/page.tsx"
    click Layout "https://github.com/evavic44/quiznote/blob/main/src/app/layout.tsx"
    click NotFound "https://github.com/evavic44/quiznote/blob/main/src/app/not-found.tsx"
    click GlobalsCSS "https://github.com/evavic44/quiznote/blob/main/src/app/globals.css"
    click APIRoute "https://github.com/evavic44/quiznote/blob/main/src/app/api/generate/route.ts"
    click FormStore "https://github.com/evavic44/quiznote/blob/main/src/store/form.ts"
    click QuizStore "https://github.com/evavic44/quiznote/blob/main/src/store/quiz.ts"
    click TimerStore "https://github.com/evavic44/quiznote/blob/main/src/store/timer.ts"
    click Actions "https://github.com/evavic44/quiznote/blob/main/src/actions/graph.ts"
    click Navbar "https://github.com/evavic44/quiznote/blob/main/src/components/global/Navbar.tsx"
    click Footer "https://github.com/evavic44/quiznote/blob/main/src/components/global/Footer.tsx"
    click MobileMenu "https://github.com/evavic44/quiznote/blob/main/src/components/global/MobileMenu.tsx"
    click Hamburger "https://github.com/evavic44/quiznote/blob/main/src/components/global/Hamburger.tsx"
    click BugReport "https://github.com/evavic44/quiznote/blob/main/src/components/global/BugReport.tsx"
    click FormContainer "https://github.com/evavic44/quiznote/blob/main/src/components/pages/FormContainer.tsx"
    click QuizContainer "https://github.com/evavic44/quiznote/blob/main/src/components/pages/QuizContainer.tsx"
    click Summary "https://github.com/evavic44/quiznote/blob/main/src/components/pages/Summary.tsx"
    click Form "https://github.com/evavic44/quiznote/blob/main/src/components/pages/Form.tsx"
    click FileNote "https://github.com/evavic44/quiznote/blob/main/src/components/pages/FileNote.tsx"
    click TextNote "https://github.com/evavic44/quiznote/blob/main/src/components/pages/TextNote.tsx"
    click Quiz "https://github.com/evavic44/quiznote/blob/main/src/components/pages/Quiz.tsx"
    click Button "https://github.com/evavic44/quiznote/blob/main/src/components/shared/Button.tsx"
    click Loading "https://github.com/evavic44/quiznote/blob/main/src/components/shared/Loading.tsx"
    click ProgressBar "https://github.com/evavic44/quiznote/blob/main/src/components/shared/ProgressBar.tsx"
    click CountdownTimer "https://github.com/evavic44/quiznote/blob/main/src/components/shared/CountdownTimer.tsx"
    click Container "https://github.com/evavic44/quiznote/blob/main/src/components/shared/Container.tsx"
    click Header "https://github.com/evavic44/quiznote/blob/main/src/components/shared/Header.tsx"
    click TabComponent "https://github.com/evavic44/quiznote/blob/main/src/components/shared/TabComponent.tsx"
    click GeminiBadge "https://github.com/evavic44/quiznote/blob/main/src/components/shared/GeminiBadge.tsx"
    click Social "https://github.com/evavic44/quiznote/blob/main/src/components/shared/Social.tsx"
    click GeminiIcon "https://github.com/evavic44/quiznote/blob/main/src/components/icons/Gemini.tsx"
    click CDN "https://github.com/evavic44/quiznote/tree/main/public/"
    click CDN "https://github.com/evavic44/quiznote/tree/main/src/assets/font/"
    click CDN "https://github.com/evavic44/quiznote/blob/main/src/assets/data/navlinks.ts"
    click CDN "https://github.com/evavic44/quiznote/blob/main/src/assets/data/socialLinks.ts"
    click data_pdf "https://github.com/evavic44/quiznote/blob/main/data/iteration-in-python.pdf"
    click data_txt "https://github.com/evavic44/quiznote/blob/main/data/note.txt"
    click data_quiz "https://github.com/evavic44/quiznote/blob/main/data/quiz.ts"
    click data_template "https://github.com/evavic44/quiznote/blob/main/data/template.json"
    click nextConfig "https://github.com/evavic44/quiznote/blob/main/next.config.mjs"
    click tailwindConfig "https://github.com/evavic44/quiznote/blob/main/tailwind.config.ts"
    click tsconfig "https://github.com/evavic44/quiznote/blob/main/tsconfig.json"
    click types "https://github.com/evavic44/quiznote/blob/main/types/index.ts"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366d6,stroke-width:1px;
    classDef server fill:#D6F5D6,stroke:#228B22,stroke-width:1px;
    classDef external fill:#FFDDA0,stroke:#FF8C00,stroke-width:1px;
    classDef cdn fill:#F0F0F0,stroke:#A9A9A9,stroke-width:1px;
    classDef browser fill:#E8E8F0,stroke:#6A5ACD,stroke-width:1px;
    classDef store fill:#FFF5BA,stroke:#DAA520,stroke-width:1px;
    classDef logic fill:#FFE6E6,stroke:#FF4500,stroke-width:1px;
    classDef env fill:#E0FFFF,stroke:#20B2AA,stroke-width:1px;
```
