# pragy10/gre-flashcards architecture

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

- Interactive diagram: https://gitdiagram.com/pragy10/gre-flashcards
- Repository: https://github.com/pragy10/gre-flashcards

## Overview

Lexicon is a React GRE vocabulary deck manager and study companion. A learner manages themed daily sessions and cards, then studies them with a flashcard player or tests synonym recall; sessions can also be explored by calendar. The App coordinates views, editing, and persistence. The API service prefers cloud data and falls back to browser storage and sample decks. Source excerpts show the main UI, API, and MongoDB path; calendar, modal, and quiz details are only partially sampled, so their links reflect documented or indexed wiring.

Main entry points: [`src/App.jsx`](https://github.com/pragy10/gre-flashcards/blob/main/src/App.jsx) (App Coordinator), [`src/services/api.js`](https://github.com/pragy10/gre-flashcards/blob/main/src/services/api.js) (Data API Service), [`api/days.js`](https://github.com/pragy10/gre-flashcards/blob/main/api/days.js) (Days API), [`src/components/DayView.jsx`](https://github.com/pragy10/gre-flashcards/blob/main/src/components/DayView.jsx) (Day View)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Deck Management"]
  node_application["App Coordinator<br/>[App.jsx]"]
  node_day_view["Day View<br/>[DayView.jsx]"]
  node_calendar["Calendar View<br/>[CalendarView.jsx]"]
  node_card_modal["Card Editor<br/>[CardModal.jsx]"]
  node_day_modal["Day Editor<br/>[DayModal.jsx]"]
  node_confirm_modal["Confirm Dialog<br/>[ConfirmModal.jsx]"]
end

subgraph group_learning["Study and Practice"]
  node_flashcards["Flashcard Player"]
  node_quiz["Synonym Quiz<br/>[QuizModal.jsx]"]
end

subgraph group_persistence["Storage and Sync"]
  node_sample_decks["Sample GRE Decks<br/>[sampleData.js]"]
  node_api_service["Data API Service<br/>[api.js]"]
  node_local_storage[("Browser Storage")]
  node_days_api["Days API<br/>[days.js]"]
  node_mongo_client["Mongo Client<br/>[mongodb.js]"]
end

subgraph group_integrations["External Services"]
  node_atlas[("MongoDB Atlas")]
  node_dictionary["Dictionary API"]
  node_speech["Browser Speech"]
end

node_learner(("Learner"))

node_learner -->|"uses"| node_application
node_application -->|"renders"| node_day_view
node_application -->|"renders"| node_calendar
node_application -->|"renders"| node_card_modal
node_application -->|"renders"| node_day_modal
node_application -->|"renders"| node_confirm_modal
node_application -->|"renders"| node_flashcards
node_application -->|"renders"| node_quiz
node_day_view -->|"sends actions"| node_application
node_calendar -->|"sends selections"| node_application
node_card_modal -->|"looks up words"| node_dictionary
node_flashcards -->|"speaks words"| node_speech
node_application -->|"loads and saves"| node_api_service
node_api_service -->|"uses fallback"| node_sample_decks
node_api_service -->|"reads and writes"| node_local_storage
node_api_service -->|"requests days"| node_days_api
node_days_api -->|"gets client"| node_mongo_client
node_mongo_client -->|"connects to"| node_atlas
node_days_api -->|"reads and writes days"| node_atlas

click node_application "https://github.com/pragy10/gre-flashcards/blob/main/src/App.jsx"
click node_day_view "https://github.com/pragy10/gre-flashcards/blob/main/src/components/DayView.jsx"
click node_calendar "https://github.com/pragy10/gre-flashcards/blob/main/src/components/CalendarView.jsx"
click node_card_modal "https://github.com/pragy10/gre-flashcards/blob/main/src/components/CardModal.jsx"
click node_day_modal "https://github.com/pragy10/gre-flashcards/blob/main/src/components/DayModal.jsx"
click node_confirm_modal "https://github.com/pragy10/gre-flashcards/blob/main/src/components/ConfirmModal.jsx"
click node_flashcards "https://github.com/pragy10/gre-flashcards/blob/main/src/components/FlashcardPlayer.jsx"
click node_quiz "https://github.com/pragy10/gre-flashcards/blob/main/src/components/QuizModal.jsx"
click node_sample_decks "https://github.com/pragy10/gre-flashcards/blob/main/src/data/sampleData.js"
click node_api_service "https://github.com/pragy10/gre-flashcards/blob/main/src/services/api.js"
click node_days_api "https://github.com/pragy10/gre-flashcards/blob/main/api/days.js"
click node_mongo_client "https://github.com/pragy10/gre-flashcards/blob/main/api/lib/mongodb.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_application,node_day_view,node_calendar,node_card_modal,node_day_modal,node_confirm_modal toneBlue
class node_flashcards,node_quiz toneAmber
class node_sample_decks,node_api_service,node_local_storage,node_days_api,node_mongo_client toneMint
class node_atlas,node_dictionary,node_speech toneRose
class node_learner toneIndigo
```

## Components

### Deck Management

- [App Coordinator](https://github.com/pragy10/gre-flashcards/blob/main/src/App.jsx): `src/App.jsx`
- [Day View](https://github.com/pragy10/gre-flashcards/blob/main/src/components/DayView.jsx): `src/components/DayView.jsx`
- [Calendar View](https://github.com/pragy10/gre-flashcards/blob/main/src/components/CalendarView.jsx): `src/components/CalendarView.jsx`
- [Card Editor](https://github.com/pragy10/gre-flashcards/blob/main/src/components/CardModal.jsx): `src/components/CardModal.jsx`
- [Day Editor](https://github.com/pragy10/gre-flashcards/blob/main/src/components/DayModal.jsx): `src/components/DayModal.jsx`
- [Confirm Dialog](https://github.com/pragy10/gre-flashcards/blob/main/src/components/ConfirmModal.jsx): `src/components/ConfirmModal.jsx`

### Study and Practice

- [Flashcard Player](https://github.com/pragy10/gre-flashcards/blob/main/src/components/FlashcardPlayer.jsx): `src/components/FlashcardPlayer.jsx`
- [Synonym Quiz](https://github.com/pragy10/gre-flashcards/blob/main/src/components/QuizModal.jsx): `src/components/QuizModal.jsx`

### Storage and Sync

- [Sample GRE Decks](https://github.com/pragy10/gre-flashcards/blob/main/src/data/sampleData.js): `src/data/sampleData.js`
- [Data API Service](https://github.com/pragy10/gre-flashcards/blob/main/src/services/api.js): `src/services/api.js`
- **Browser Storage**
- [Days API](https://github.com/pragy10/gre-flashcards/blob/main/api/days.js): `api/days.js`
- [Mongo Client](https://github.com/pragy10/gre-flashcards/blob/main/api/lib/mongodb.js): `api/lib/mongodb.js`

### External Services

- **MongoDB Atlas**
- **Dictionary API**
- **Browser Speech**

### Other components

- **Learner**

## Connections

- Learner → App Coordinator: uses
- App Coordinator → Day View: renders (evidence: `src/App.jsx`)
- App Coordinator → Calendar View: renders (evidence: `src/App.jsx`)
- App Coordinator → Card Editor: renders (evidence: `src/App.jsx`)
- App Coordinator → Day Editor: renders (evidence: `src/App.jsx`)
- App Coordinator → Confirm Dialog: renders (evidence: `src/App.jsx`)
- App Coordinator → Flashcard Player: renders (evidence: `src/App.jsx`)
- App Coordinator → Synonym Quiz: renders (evidence: `src/App.jsx`)
- Day View → App Coordinator: sends actions (evidence: `src/components/DayView.jsx`)
- Calendar View → App Coordinator: sends selections (evidence: `src/components/CalendarView.jsx`)
- Card Editor → Dictionary API: looks up words (evidence: `src/components/CardModal.jsx`)
- Flashcard Player → Browser Speech: speaks words (evidence: `src/components/FlashcardPlayer.jsx`)
- App Coordinator → Data API Service: loads and saves (evidence: `src/App.jsx`)
- Data API Service → Sample GRE Decks: uses fallback (evidence: `src/services/api.js`)
- Data API Service → Browser Storage: reads and writes (evidence: `src/services/api.js`)
- Data API Service → Days API: requests days (evidence: `src/services/api.js`)
- Days API → Mongo Client: gets client (evidence: `api/days.js`)
- Mongo Client → MongoDB Atlas: connects to (evidence: `api/lib/mongodb.js`)
- Days API → MongoDB Atlas: reads and writes days (evidence: `api/days.js`)
