# redward42/flashcard-app architecture

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

- Interactive diagram: https://gitdiagram.com/redward42/flashcard-app
- Repository: https://github.com/redward42/flashcard-app

## Overview

Flashcard App is a browser-based React application for generating and studying flashcard sets. The user enters a topic; the app requests cards from Gemini, displays the resulting deck, and supports navigation, random selection, shuffling, answer guesses, and flipping cards. The main application component owns these workflows and renders both the current card and the full set. The README also describes card generation and study features; no persistent storage is shown. The map follows the sampled entry point and source; styling details are omitted.

Main entry points: [`src/App.tsx`](https://github.com/RedWARd42/flashcard-app/blob/main/src/App.tsx) (Flashcard workspace), [`src/api/generateFlashcards.js`](https://github.com/RedWARd42/flashcard-app/blob/main/src/api/generateFlashcards.js) (Card generator), [`src/main.tsx`](https://github.com/RedWARd42/flashcard-app/blob/main/src/main.tsx) (React entry), [`src/components/Card.tsx`](https://github.com/RedWARd42/flashcard-app/blob/main/src/components/Card.tsx) (Flashcard view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["App runtime"]
  node_entry["React entry<br/>[main.tsx]"]
end

subgraph group_study["Study experience"]
  node_workspace["Flashcard workspace<br/>[App.tsx]"]
  node_card["Flashcard view<br/>[Card.tsx]"]
end

subgraph group_generation["AI generation"]
  node_generator["Card generator"]
  node_gemini["Gemini API"]
end

node_learner(("Learner"))

node_learner -->|"opens app"| node_entry
node_entry -->|"renders"| node_workspace
node_workspace -->|"requests cards"| node_generator
node_generator -->|"sends prompt"| node_gemini
node_gemini -->|"returns response"| node_generator
node_workspace -->|"renders cards"| node_card

click node_entry "https://github.com/RedWARd42/flashcard-app/blob/main/src/main.tsx"
click node_workspace "https://github.com/RedWARd42/flashcard-app/blob/main/src/App.tsx"
click node_card "https://github.com/RedWARd42/flashcard-app/blob/main/src/components/Card.tsx"
click node_generator "https://github.com/RedWARd42/flashcard-app/blob/main/src/api/generateFlashcards.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 toneBlue
class node_workspace,node_card toneAmber
class node_generator,node_gemini toneMint
class node_learner toneIndigo
```

## Components

### App runtime

- [React entry](https://github.com/RedWARd42/flashcard-app/blob/main/src/main.tsx): `src/main.tsx`

### Study experience

- [Flashcard workspace](https://github.com/RedWARd42/flashcard-app/blob/main/src/App.tsx): `src/App.tsx`
- [Flashcard view](https://github.com/RedWARd42/flashcard-app/blob/main/src/components/Card.tsx): `src/components/Card.tsx`

### AI generation

- [Card generator](https://github.com/RedWARd42/flashcard-app/blob/main/src/api/generateFlashcards.js): `src/api/generateFlashcards.js`
- **Gemini API**

### Other components

- **Learner**

## Connections

- Learner → React entry: opens app (evidence: `src/main.tsx`)
- React entry → Flashcard workspace: renders (evidence: `src/main.tsx`)
- Flashcard workspace → Card generator: requests cards (evidence: `src/App.tsx`)
- Card generator → Gemini API: sends prompt (evidence: `src/api/generateFlashcards.js`)
- Gemini API → Card generator: returns response (evidence: `src/api/generateFlashcards.js`)
- Flashcard workspace → Flashcard view: renders cards (evidence: `src/App.tsx`)
