# jagratadeb/quiz-fiveq-ai architecture

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

- Interactive diagram: https://gitdiagram.com/jagratadeb/quiz-fiveq-ai
- Repository: https://github.com/jagratadeb/quiz-fiveq-ai

## Overview

Quiz FiveQ is a React quiz-generation app backed by an Express API and Google Gemini. The main flow is topic/configuration selection, quiz generation, answering questions, and reviewing results; the client also keeps quiz-related state in local storage. The sampled code shows the API request, server dispatch, and model fallback. The README documents additional usage-limit and history behavior; unsampled details and the version endpoint’s client wiring are not inferred.

Main entry points: [`src/App.jsx`](https://github.com/jagratadeb/quiz-fiveq-ai/blob/main/src/App.jsx) (Quiz interface), [`api/chat.js`](https://github.com/jagratadeb/quiz-fiveq-ai/blob/main/api/chat.js) (Quiz API), [`server.js`](https://github.com/jagratadeb/quiz-fiveq-ai/blob/main/server.js) (Express server), [`src/main.jsx`](https://github.com/jagratadeb/quiz-fiveq-ai/blob/main/src/main.jsx) (React entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Quiz client"]
  node_entry["React entry<br/>[main.jsx]"]
  node_quiz_app["Quiz interface<br/>[App.jsx]"]
  node_setup["Quiz setup<br/>[App.jsx]"]
  node_session["Quiz session<br/>[App.jsx]"]
  node_results["Results history<br/>[App.jsx]"]
end

subgraph group_api["API services"]
  node_express["Express server<br/>[server.js]"]
  node_quiz_api["Quiz API<br/>[chat.js]"]
  node_version_api["Version API<br/>[version.js]"]
end

subgraph group_state["Client persistence"]
  node_local_store[("Local storage")]
end

subgraph group_external["External services"]
  node_gemini["Gemini AI"]
end

node_user(("Quiz taker"))

node_user -->|"uses"| node_quiz_app
node_entry -->|"renders"| node_quiz_app
node_quiz_app -->|"shows setup"| node_setup
node_quiz_app -->|"shows quiz"| node_session
node_quiz_app -->|"shows results"| node_results
node_quiz_app -->|"requests quiz"| node_express
node_express -->|"dispatches"| node_quiz_api
node_quiz_api -->|"generates quiz"| node_gemini
node_gemini -->|"returns content"| node_quiz_api
node_quiz_api -->|"returns quiz"| node_quiz_app
node_quiz_app -->|"caches and tracks"| node_local_store

click node_entry "https://github.com/jagratadeb/quiz-fiveq-ai/blob/main/src/main.jsx"
click node_quiz_app "https://github.com/jagratadeb/quiz-fiveq-ai/blob/main/src/App.jsx"
click node_setup "https://github.com/jagratadeb/quiz-fiveq-ai/blob/main/src/App.jsx"
click node_session "https://github.com/jagratadeb/quiz-fiveq-ai/blob/main/src/App.jsx"
click node_results "https://github.com/jagratadeb/quiz-fiveq-ai/blob/main/src/App.jsx"
click node_express "https://github.com/jagratadeb/quiz-fiveq-ai/blob/main/server.js"
click node_quiz_api "https://github.com/jagratadeb/quiz-fiveq-ai/blob/main/api/chat.js"
click node_version_api "https://github.com/jagratadeb/quiz-fiveq-ai/blob/main/api/version.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_quiz_app,node_setup,node_session,node_results toneBlue
class node_express,node_quiz_api,node_version_api toneAmber
class node_local_store toneMint
class node_gemini toneRose
class node_user toneIndigo
```

## Components

### Quiz client

- [React entry](https://github.com/jagratadeb/quiz-fiveq-ai/blob/main/src/main.jsx): `src/main.jsx`
- [Quiz interface](https://github.com/jagratadeb/quiz-fiveq-ai/blob/main/src/App.jsx): `src/App.jsx`
- [Quiz setup](https://github.com/jagratadeb/quiz-fiveq-ai/blob/main/src/App.jsx): `src/App.jsx`
- [Quiz session](https://github.com/jagratadeb/quiz-fiveq-ai/blob/main/src/App.jsx): `src/App.jsx`
- [Results history](https://github.com/jagratadeb/quiz-fiveq-ai/blob/main/src/App.jsx): `src/App.jsx`

### API services

- [Express server](https://github.com/jagratadeb/quiz-fiveq-ai/blob/main/server.js): `server.js`
- [Quiz API](https://github.com/jagratadeb/quiz-fiveq-ai/blob/main/api/chat.js): `api/chat.js`
- [Version API](https://github.com/jagratadeb/quiz-fiveq-ai/blob/main/api/version.js): `api/version.js`

### Client persistence

- **Local storage**

### External services

- **Gemini AI**

### Other components

- **Quiz taker**

## Connections

- Quiz taker → Quiz interface: uses (evidence: `README.md`)
- React entry → Quiz interface: renders (evidence: `src/main.jsx`)
- Quiz interface → Quiz setup: shows setup (evidence: `README.md`)
- Quiz interface → Quiz session: shows quiz (evidence: `README.md`)
- Quiz interface → Results history: shows results (evidence: `README.md`)
- Quiz interface → Express server: requests quiz (evidence: `src/App.jsx`)
- Express server → Quiz API: dispatches (evidence: `server.js`)
- Quiz API → Gemini AI: generates quiz (evidence: `api/chat.js`)
- Gemini AI → Quiz API: returns content (evidence: `api/chat.js`)
- Quiz API → Quiz interface: returns quiz (evidence: `README.md`)
- Quiz interface → Local storage: caches and tracks (evidence: `src/App.jsx`)
