# jackgarrus/flashy architecture

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

- Interactive diagram: https://gitdiagram.com/jackgarrus/flashy
- Repository: https://github.com/jackgarrus/flashy

## Overview

##### Project type and purpose
- This is a single-page front-end application (built with Create React App) that implements a flashcard/quiz tool for practicing verbs.
- There is no separate backend or external API; all data is stored locally (verbs.json, localStorage via hooks).

##### File structure
- Top level:
- public/ – static assets & HTML shell
- src/ – application source code
- tailwind.config.js, tsconfig.json – build/tooling configs
- src/ contains:
- components/ – UI components (Quiz, FlashcardViewer, ControlPanel, etc)
- hooks/ – custom React hooks for state & persistence (useQuizState, useFavorites)
- data/ – static JSON data (verbs.json)
- utils/ – pure helper functions (checkAnswer, filters)
- index.tsx & App.tsx – application entry point & root component
- tests alongside relevant components/hooks
- build pipeline is provided by Create React App (webpack, Babel, PostCSS/Tailwind).

##### README for additional insights
- Standard CRA project; no custom architecture docs or server interactions described.
- Emphasis on typical npm scripts (start, test, build, eject).

## Diagram (Mermaid)

```mermaid
flowchart TD
  subgraph "Build & Deployment"
    direction TB
    Webpack["Webpack/Babel"]:::build
    TailwindConfig["tailwind.config.js"]:::build
    TSConfig["tsconfig.json"]:::build
    Webpack --> Bundle["Production Bundle"]:::build
    Bundle --> StaticHost["Static Host (CDN/Web Server)"]:::build
  end

  StaticHost --> Browser["Browser/Client"]:::runtime

  subgraph "React Application"
    direction TB
    HTML["public/index.html"]:::runtime
    Entry["src/index.tsx"]:::runtime
    Root["src/App.tsx"]:::runtime
    HTML --> Entry
    Entry --> Root

    subgraph "UI Components"
      direction TB
      ControlPanel["ControlPanel"]:::code
      FlashcardViewer["FlashcardViewer"]:::code
      Flashcard["Flashcard"]:::code
      QuizComp["Quiz"]:::code
      QuestionForm["QuestionForm"]:::code
      QuizModeSelector["QuizModeSelector"]:::code
      MistakeList["MistakeList"]:::code
    end

    subgraph "Hooks (State & Persistence)"
      direction TB
      useQuizState["useQuizState"]:::code
      useFavorites["useFavorites"]:::code
      useCategoryFilter["useCategoryFilter"]:::code
      useFlashcardNavigator["useFlashcardNavigator"]:::code
      LocalStorage["localStorage"]:::runtime
    end

    subgraph "Data Layer"
      direction TB
      VerbsData["verbs.json"]:::code
    end

    subgraph "Business Logic"
      direction TB
      CheckAnswer["checkAnswer"]:::code
      Filters["filters"]:::code
    end

    subgraph "Styling & Global CSS"
      direction TB
      IndexCSS["src/index.css"]:::code
      AppCSS["src/App.css"]:::code
    end

    Browser --> HTML
    Root --> ControlPanel
    Root --> FlashcardViewer
    Root --> QuizComp
    ControlPanel --> useQuizState
    FlashcardViewer --> useFlashcardNavigator
    QuizComp --> useQuizState
    QuizComp --> useFavorites
    QuizComp --> useCategoryFilter
    useQuizState --> VerbsData
    useFavorites --> LocalStorage
    useCategoryFilter --> VerbsData
    useFlashcardNavigator --> VerbsData
    useQuizState --> CheckAnswer
    useCategoryFilter --> Filters
    IndexCSS --> Root
    AppCSS --> Root
  end

  subgraph Tests
    direction TB
    ComponentTests["Component Tests"]:::test
    HookTests["Hook Tests"]:::test
    TestSetup["Setup & Reporting"]:::test
    ComponentTests -.-> ControlPanel
    ComponentTests -.-> FlashcardViewer
    ComponentTests -.-> Flashcard
    ComponentTests -.-> QuizComp
    ComponentTests -.-> QuestionForm
    ComponentTests -.-> QuizModeSelector
    ComponentTests -.-> MistakeList
    HookTests -.-> useQuizState
    TestSetup -.-> Entry
    TestSetup -.-> Root
  end

  click HTML "https://github.com/jackgarrus/flashy/blob/main/public/index.html"
  click Entry "https://github.com/jackgarrus/flashy/blob/main/src/index.tsx"
  click Root "https://github.com/jackgarrus/flashy/blob/main/src/App.tsx"
  click ControlPanel "https://github.com/jackgarrus/flashy/blob/main/src/components/ControlPanel.tsx"
  click FlashcardViewer "https://github.com/jackgarrus/flashy/blob/main/src/components/FlashcardViewer.tsx"
  click Flashcard "https://github.com/jackgarrus/flashy/blob/main/src/components/Flashcard.tsx"
  click QuizComp "https://github.com/jackgarrus/flashy/blob/main/src/components/Quiz.tsx"
  click QuestionForm "https://github.com/jackgarrus/flashy/blob/main/src/components/QuestionForm.tsx"
  click QuizModeSelector "https://github.com/jackgarrus/flashy/blob/main/src/components/QuizModeSelector.tsx"
  click MistakeList "https://github.com/jackgarrus/flashy/blob/main/src/components/MistakeList.tsx"
  click useQuizState "https://github.com/jackgarrus/flashy/blob/main/src/hooks/useQuizState.ts"
  click useFavorites "https://github.com/jackgarrus/flashy/blob/main/src/hooks/useFavorites.ts"
  click useCategoryFilter "https://github.com/jackgarrus/flashy/blob/main/src/hooks/useCategoryFilter.ts"
  click useFlashcardNavigator "https://github.com/jackgarrus/flashy/blob/main/src/hooks/useFlashcardNavigator.ts"
  click VerbsData "https://github.com/jackgarrus/flashy/blob/main/src/data/verbs.json"
  click CheckAnswer "https://github.com/jackgarrus/flashy/blob/main/src/utils/checkAnswer.ts"
  click Filters "https://github.com/jackgarrus/flashy/blob/main/src/utils/filters.ts"
  click IndexCSS "https://github.com/jackgarrus/flashy/blob/main/src/index.css"
  click AppCSS "https://github.com/jackgarrus/flashy/blob/main/src/App.css"
  click TailwindConfig "https://github.com/jackgarrus/flashy/blob/main/tailwind.config.js"
  click TSConfig "https://github.com/jackgarrus/flashy/blob/main/tsconfig.json"

  classDef build fill:#f9d3b4,stroke:#c76c00,stroke-width:1px
  classDef runtime fill:#c5dbf3,stroke:#0b63c5,stroke-width:1px
  classDef code fill:#d8f0d8,stroke:#0a7d00,stroke-width:1px
  classDef test fill:none,stroke:#888,stroke-dasharray:5 5
```
