# mhentuniverse/mhent-study architecture

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

- Interactive diagram: https://gitdiagram.com/mhentuniverse/mhent-study
- Repository: https://github.com/mhentuniverse/mhent-study

## Overview

MHEnt. Study is a multilingual learning application for Korean, Japanese, Chinese, and English, delivered as a web app with desktop and mobile shells. Learners choose a language and practice vocabulary through recall, review tracking, and quizzes; they can also create, share, clone, and study decks offline. The graph preserves documented AI, dictionary, lyrics, and desktop-presence capabilities. Source excerpts show selected storage, offline, quiz, cloud, and desktop wiring; other feature links are omitted where implementation wiring was not shown.

Main entry points: [`js/vocab-sheet.js`](https://github.com/mhentuniverse/mhent-study/blob/main/js/vocab-sheet.js) (Vocabulary Practice), [`js/storage.js`](https://github.com/mhentuniverse/mhent-study/blob/main/js/storage.js) (Deck Storage), [`ko/index.html`](https://github.com/mhentuniverse/mhent-study/blob/main/ko/index.html) (Language Hubs), [`js/supabase-client.js`](https://github.com/mhentuniverse/mhent-study/blob/main/js/supabase-client.js) (Cloud Sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Language Learning"]
  node_language_hubs["Language Hubs<br/>[index.html]"]
  node_vocabulary_practice["Vocabulary Practice<br/>[vocab-sheet.js]"]
  node_quiz_engine["Quiz Engine<br/>[quiz-engine.js]"]
  node_sample_curricula["Sample Curricula<br/>[sample-en.js]"]
end

subgraph group_decks["Decks and Sync"]
  node_deck_storage["Deck Storage<br/>[storage.js]"]
  node_cloud_sync["Cloud Sync<br/>[supabase-client.js]"]
  node_offline_vault["Offline Vault<br/>[offline-manager.js]"]
  node_shared_decks["Shared Deck Portal<br/>[index.html]"]
  node_auth["Authentication<br/>[auth.js]"]
end

subgraph group_features["Study Features"]
  node_ai_deck_creator["AI Deck Creator<br/>[ai-deck-creator.js]"]
  node_ai_dictionary["AI Dictionary<br/>[ai-dictionary.js]"]
  node_aisa_widget["AISA Widget<br/>[aisa-widget.js]"]
  node_lyrics_hub["Lyrics Hub<br/>[lyrics-hub.js]"]
  node_speech["Speech Engine<br/>[speech.js]"]
end

subgraph group_apps["App Integrations"]
  node_desktop_shell["Desktop Shell<br/>[main.js]"]
  node_desktop_discord["Desktop Discord RPC<br/>[discord-manager.js]"]
  node_companion_shell["Companion App<br/>[main.js]"]
  node_companion_discord["Companion Discord RPC<br/>[discord-manager.js]"]
end

node_learner(("Learner"))
node_discord_client["Discord Client"]
node_supabase_service[("Supabase")]
node_web_speech["Web Speech API"]

node_learner -->|"chooses language"| node_language_hubs
node_language_hubs -.->|"opens practice"| node_vocabulary_practice
node_learner -->|"reviews words"| node_vocabulary_practice
node_learner -.->|"takes quizzes"| node_quiz_engine
node_sample_curricula -.->|"supplies words"| node_vocabulary_practice
node_vocabulary_practice -.->|"saves progress"| node_deck_storage
node_deck_storage -->|"syncs decks"| node_cloud_sync
node_offline_vault -->|"stores offline decks"| node_deck_storage
node_learner -->|"opens shared link"| node_shared_decks
node_shared_decks -.->|"clones deck"| node_deck_storage
node_learner -.->|"creates study decks"| node_ai_deck_creator
node_learner -.->|"looks up words"| node_ai_dictionary
node_learner -.->|"uses widget"| node_aisa_widget
node_learner -.->|"uses lyrics"| node_lyrics_hub
node_learner -->|"requests pronunciation"| node_speech
node_speech -->|"uses synthesis"| node_web_speech
node_learner -.->|"signs in"| node_auth
node_desktop_shell -->|"dispatches presence"| node_desktop_discord
node_companion_shell -->|"connects presence"| node_companion_discord
node_desktop_discord -->|"sends activity"| node_discord_client
node_companion_discord -->|"sends activity"| node_discord_client
node_cloud_sync -->|"reads and writes"| node_supabase_service

click node_language_hubs "https://github.com/mhentuniverse/mhent-study/blob/main/ko/index.html"
click node_vocabulary_practice "https://github.com/mhentuniverse/mhent-study/blob/main/js/vocab-sheet.js"
click node_quiz_engine "https://github.com/mhentuniverse/mhent-study/blob/main/js/quiz-engine.js"
click node_sample_curricula "https://github.com/mhentuniverse/mhent-study/blob/main/data/sample-en.js"
click node_deck_storage "https://github.com/mhentuniverse/mhent-study/blob/main/js/storage.js"
click node_cloud_sync "https://github.com/mhentuniverse/mhent-study/blob/main/js/supabase-client.js"
click node_offline_vault "https://github.com/mhentuniverse/mhent-study/blob/main/js/offline-manager.js"
click node_shared_decks "https://github.com/mhentuniverse/mhent-study/blob/main/shared/index.html"
click node_ai_deck_creator "https://github.com/mhentuniverse/mhent-study/blob/main/js/ai-deck-creator.js"
click node_ai_dictionary "https://github.com/mhentuniverse/mhent-study/blob/main/js/ai-dictionary.js"
click node_aisa_widget "https://github.com/mhentuniverse/mhent-study/blob/main/js/aisa-widget.js"
click node_lyrics_hub "https://github.com/mhentuniverse/mhent-study/blob/main/js/lyrics-hub.js"
click node_speech "https://github.com/mhentuniverse/mhent-study/blob/main/js/speech.js"
click node_auth "https://github.com/mhentuniverse/mhent-study/blob/main/js/auth.js"
click node_desktop_shell "https://github.com/mhentuniverse/mhent-study/blob/main/desktop/main.js"
click node_desktop_discord "https://github.com/mhentuniverse/mhent-study/blob/main/desktop/discord-manager.js"
click node_companion_shell "https://github.com/mhentuniverse/mhent-study/blob/main/companion/main.js"
click node_companion_discord "https://github.com/mhentuniverse/mhent-study/blob/main/companion/discord-manager.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_language_hubs,node_vocabulary_practice,node_quiz_engine,node_sample_curricula,node_discord_client toneBlue
class node_deck_storage,node_cloud_sync,node_offline_vault,node_shared_decks,node_auth,node_supabase_service toneAmber
class node_ai_deck_creator,node_ai_dictionary,node_aisa_widget,node_lyrics_hub,node_speech,node_web_speech toneMint
class node_desktop_shell,node_desktop_discord,node_companion_shell,node_companion_discord toneRose
class node_learner toneIndigo
```

## Components

### Language Learning

- [Language Hubs](https://github.com/mhentuniverse/mhent-study/blob/main/ko/index.html): `ko/index.html`
- [Vocabulary Practice](https://github.com/mhentuniverse/mhent-study/blob/main/js/vocab-sheet.js): `js/vocab-sheet.js`
- [Quiz Engine](https://github.com/mhentuniverse/mhent-study/blob/main/js/quiz-engine.js): `js/quiz-engine.js`
- [Sample Curricula](https://github.com/mhentuniverse/mhent-study/blob/main/data/sample-en.js): `data/sample-en.js`

### Decks and Sync

- [Deck Storage](https://github.com/mhentuniverse/mhent-study/blob/main/js/storage.js): `js/storage.js`
- [Cloud Sync](https://github.com/mhentuniverse/mhent-study/blob/main/js/supabase-client.js): `js/supabase-client.js`
- [Offline Vault](https://github.com/mhentuniverse/mhent-study/blob/main/js/offline-manager.js): `js/offline-manager.js`
- [Shared Deck Portal](https://github.com/mhentuniverse/mhent-study/blob/main/shared/index.html): `shared/index.html`
- [Authentication](https://github.com/mhentuniverse/mhent-study/blob/main/js/auth.js): `js/auth.js`

### Study Features

- [AI Deck Creator](https://github.com/mhentuniverse/mhent-study/blob/main/js/ai-deck-creator.js): `js/ai-deck-creator.js`
- [AI Dictionary](https://github.com/mhentuniverse/mhent-study/blob/main/js/ai-dictionary.js): `js/ai-dictionary.js`
- [AISA Widget](https://github.com/mhentuniverse/mhent-study/blob/main/js/aisa-widget.js): `js/aisa-widget.js`
- [Lyrics Hub](https://github.com/mhentuniverse/mhent-study/blob/main/js/lyrics-hub.js): `js/lyrics-hub.js`
- [Speech Engine](https://github.com/mhentuniverse/mhent-study/blob/main/js/speech.js): `js/speech.js`

### App Integrations

- [Desktop Shell](https://github.com/mhentuniverse/mhent-study/blob/main/desktop/main.js): `desktop/main.js`
- [Desktop Discord RPC](https://github.com/mhentuniverse/mhent-study/blob/main/desktop/discord-manager.js): `desktop/discord-manager.js`
- [Companion App](https://github.com/mhentuniverse/mhent-study/blob/main/companion/main.js): `companion/main.js`
- [Companion Discord RPC](https://github.com/mhentuniverse/mhent-study/blob/main/companion/discord-manager.js): `companion/discord-manager.js`

### Other components

- **Learner**
- **Discord Client**
- **Supabase**
- **Web Speech API**

## Connections

- Learner → Language Hubs: chooses language (evidence: `README.md`)
- Language Hubs → Vocabulary Practice: opens practice
- Learner → Vocabulary Practice: reviews words (evidence: `README.md`)
- Learner → Quiz Engine: takes quizzes
- Sample Curricula → Vocabulary Practice: supplies words
- Vocabulary Practice → Deck Storage: saves progress
- Deck Storage → Cloud Sync: syncs decks (evidence: `js/storage.js`)
- Offline Vault → Deck Storage: stores offline decks (evidence: `js/offline-manager.js`)
- Learner → Shared Deck Portal: opens shared link (evidence: `README.md`)
- Shared Deck Portal → Deck Storage: clones deck
- Learner → AI Deck Creator: creates study decks
- Learner → AI Dictionary: looks up words
- Learner → AISA Widget: uses widget
- Learner → Lyrics Hub: uses lyrics
- Learner → Speech Engine: requests pronunciation (evidence: `README.md`)
- Speech Engine → Web Speech API: uses synthesis (evidence: `README.md`)
- Learner → Authentication: signs in
- Desktop Shell → Desktop Discord RPC: dispatches presence (evidence: `desktop/main.js`)
- Companion App → Companion Discord RPC: connects presence (evidence: `companion/main.js`)
- Desktop Discord RPC → Discord Client: sends activity (evidence: `desktop/discord-manager.js`)
- Companion Discord RPC → Discord Client: sends activity (evidence: `companion/discord-manager.js`)
- Cloud Sync → Supabase: reads and writes (evidence: `js/supabase-client.js`)
