# mapledevstack/language-learning-app architecture

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

- Interactive diagram: https://gitdiagram.com/mapledevstack/language-learning-app
- Repository: https://github.com/mapledevstack/language-learning-app

## Overview

This is a full-stack Japanese-learning platform: learners use a web client for dictionary lookup, grammar, flashcard study, immersion, and account management; the client communicates with an Express REST API, with MongoDB holding user data and imported language datasets. The graph shows documented product capabilities and backend route wiring. Several feature services and frontend-to-endpoint mappings were not excerpted, so uncertain internal calls are omitted rather than inferred.

Main entry points: [`backend/src/app.ts`](https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/app.ts) (Express REST API), [`backend/src/features/auth/auth.service.ts`](https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/features/auth/auth.service.ts) (Auth workflows), [`frontend/src/features`](https://github.com/mapledevstack/language-learning-app/tree/main/frontend/src/features) (Learning interface), [`frontend/src/features/decks/pages/DeckStudyPage.tsx`](https://github.com/mapledevstack/language-learning-app/blob/main/frontend/src/features/decks/pages/DeckStudyPage.tsx) (Deck study UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_client["Learning interface"]
  node_dashboard["Study dashboard<br/>[DashboardPage.tsx]"]
  node_decksui["Deck study UI<br/>[DeckStudyPage.tsx]"]
  node_dictionaryui["Dictionary UI<br/>[DictionaryPage.tsx]"]
  node_grammarui["Grammar UI<br/>[GrammarPage.tsx]"]
  node_immersionui["Immersion UI"]
end

subgraph group_api["API foundation"]
  node_api["Express REST API<br/>[app.ts]"]
  node_middleware["Authentication middleware<br/>[authenticate.ts]"]
  node_config["Runtime configuration<br/>[env.ts]"]
end

subgraph group_learning["Learning features"]
  node_deckflow["Deck management<br/>[deck.service.ts]"]
  node_flashcards["Flashcard reviews"]
  node_dictionary["Dictionary search"]
  node_grammar["Grammar resources<br/>[grammar.service.ts]"]
  node_immersion["Immersion services"]
end

subgraph group_identity["Identity and profile"]
  node_authroutes["Auth routes<br/>[auth.routes.ts]"]
  node_authflow["Auth workflows<br/>[auth.service.ts]"]
  node_users["User services<br/>[user.service.ts]"]
  node_email["Email delivery"]
end

subgraph group_data["Persistence"]
  node_mongo[("MongoDB")]
end

node_learner(("Learner"))

node_learner -->|"uses"| node_client
node_client -->|"calls REST API"| node_api
node_api -->|"mounts routes"| node_authroutes
node_api -->|"uses auth"| node_middleware
node_api -->|"reads settings"| node_config
node_authroutes -->|"dispatches to"| node_authflow
node_authflow -->|"reads and writes"| node_mongo
node_authflow -->|"sends messages"| node_email
node_api -->|"mounts user routes"| node_users
node_api -->|"mounts deck routes"| node_deckflow
node_api -->|"mounts card routes"| node_flashcards
node_api -->|"mounts dictionary routes"| node_dictionary
node_api -->|"mounts grammar routes"| node_grammar
node_api -->|"mounts immersion routes"| node_immersion
node_decksui -.->|"reviews cards"| node_flashcards
node_dashboard -.->|"offers study entry"| node_decksui

click node_client "https://github.com/mapledevstack/language-learning-app/tree/main/frontend/src/features"
click node_dashboard "https://github.com/mapledevstack/language-learning-app/blob/main/frontend/src/features/dashboard/pages/DashboardPage.tsx"
click node_decksui "https://github.com/mapledevstack/language-learning-app/blob/main/frontend/src/features/decks/pages/DeckStudyPage.tsx"
click node_dictionaryui "https://github.com/mapledevstack/language-learning-app/blob/main/frontend/src/features/dictionary/pages/DictionaryPage.tsx"
click node_grammarui "https://github.com/mapledevstack/language-learning-app/blob/main/frontend/src/features/grammar/pages/GrammarPage.tsx"
click node_immersionui "https://github.com/mapledevstack/language-learning-app/blob/main/frontend/src/features/immersion/pages/ImmersionWatchPage.tsx"
click node_api "https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/app.ts"
click node_authroutes "https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/features/auth/auth.routes.ts"
click node_authflow "https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/features/auth/auth.service.ts"
click node_users "https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/features/users/user.service.ts"
click node_deckflow "https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/features/decks/deck.service.ts"
click node_flashcards "https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/features/flashcards/flashcard.service.ts"
click node_dictionary "https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/features/dictionary/dictionary.service.ts"
click node_grammar "https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/features/grammar/grammar.service.ts"
click node_immersion "https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/features/immersion/immersion.service.ts"
click node_middleware "https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/middleware/authenticate.ts"
click node_config "https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/constants/env.ts"

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_client,node_dashboard,node_decksui,node_dictionaryui,node_grammarui,node_immersionui toneBlue
class node_api,node_middleware,node_config toneAmber
class node_deckflow,node_flashcards,node_dictionary,node_grammar,node_immersion toneMint
class node_authroutes,node_authflow,node_users,node_email toneRose
class node_mongo,node_learner toneIndigo
```

## Components

### Web client

- [Learning interface](https://github.com/mapledevstack/language-learning-app/tree/main/frontend/src/features): `frontend/src/features`
- [Study dashboard](https://github.com/mapledevstack/language-learning-app/blob/main/frontend/src/features/dashboard/pages/DashboardPage.tsx): `frontend/src/features/dashboard/pages/DashboardPage.tsx`
- [Deck study UI](https://github.com/mapledevstack/language-learning-app/blob/main/frontend/src/features/decks/pages/DeckStudyPage.tsx): `frontend/src/features/decks/pages/DeckStudyPage.tsx`
- [Dictionary UI](https://github.com/mapledevstack/language-learning-app/blob/main/frontend/src/features/dictionary/pages/DictionaryPage.tsx): `frontend/src/features/dictionary/pages/DictionaryPage.tsx`
- [Grammar UI](https://github.com/mapledevstack/language-learning-app/blob/main/frontend/src/features/grammar/pages/GrammarPage.tsx): `frontend/src/features/grammar/pages/GrammarPage.tsx`
- [Immersion UI](https://github.com/mapledevstack/language-learning-app/blob/main/frontend/src/features/immersion/pages/ImmersionWatchPage.tsx): `frontend/src/features/immersion/pages/ImmersionWatchPage.tsx`

### API foundation

- [Express REST API](https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Authentication middleware](https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/middleware/authenticate.ts): `backend/src/middleware/authenticate.ts`
- [Runtime configuration](https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/constants/env.ts): `backend/src/constants/env.ts`

### Learning features

- [Deck management](https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/features/decks/deck.service.ts): `backend/src/features/decks/deck.service.ts`
- [Flashcard reviews](https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/features/flashcards/flashcard.service.ts): `backend/src/features/flashcards/flashcard.service.ts`
- [Dictionary search](https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/features/dictionary/dictionary.service.ts): `backend/src/features/dictionary/dictionary.service.ts`
- [Grammar resources](https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/features/grammar/grammar.service.ts): `backend/src/features/grammar/grammar.service.ts`
- [Immersion services](https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/features/immersion/immersion.service.ts): `backend/src/features/immersion/immersion.service.ts`

### Identity and profile

- [Auth routes](https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/features/auth/auth.routes.ts): `backend/src/features/auth/auth.routes.ts`
- [Auth workflows](https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/features/auth/auth.service.ts): `backend/src/features/auth/auth.service.ts`
- [User services](https://github.com/mapledevstack/language-learning-app/blob/main/backend/src/features/users/user.service.ts): `backend/src/features/users/user.service.ts`
- **Email delivery**

### Persistence

- **MongoDB**

### Other components

- **Learner**

## Connections

- Learner → Learning interface: uses
- Learning interface → Express REST API: calls REST API
- Express REST API → Auth routes: mounts routes (evidence: `backend/src/app.ts`)
- Express REST API → Authentication middleware: uses auth (evidence: `backend/src/app.ts`)
- Express REST API → Runtime configuration: reads settings (evidence: `backend/src/app.ts`)
- Auth routes → Auth workflows: dispatches to (evidence: `backend/src/features/auth/auth.routes.ts`)
- Auth workflows → MongoDB: reads and writes (evidence: `backend/src/features/auth/auth.service.ts`)
- Auth workflows → Email delivery: sends messages (evidence: `backend/src/features/auth/auth.service.ts`)
- Express REST API → User services: mounts user routes (evidence: `backend/src/app.ts`)
- Express REST API → Deck management: mounts deck routes (evidence: `backend/src/app.ts`)
- Express REST API → Flashcard reviews: mounts card routes (evidence: `backend/src/app.ts`)
- Express REST API → Dictionary search: mounts dictionary routes (evidence: `backend/src/app.ts`)
- Express REST API → Grammar resources: mounts grammar routes (evidence: `backend/src/app.ts`)
- Express REST API → Immersion services: mounts immersion routes (evidence: `backend/src/app.ts`)
- Deck study UI → Flashcard reviews: reviews cards
- Study dashboard → Deck study UI: offers study entry
