# soroush-mohammadi/study-room architecture

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

- Interactive diagram: https://gitdiagram.com/soroush-mohammadi/study-room
- Repository: https://github.com/soroush-mohammadi/study-room

## Overview

Word-Sync Transcript Player lets a user upload audio, request a word-timestamped transcript, play the audio with synchronized word highlighting, and build a translated vocabulary list. The frontend coordinates these steps through App; the backend validates and caches requests before calling external transcription or translation services. The README documents the upload-to-playback workflow and animation-frame synchronization. Some frontend API wiring and translation HTTP details were not excerpted, so those links are left unverified rather than inferred.

Main entry points: [`client/src/App.jsx`](https://github.com/soroush-mohammadi/study-room/blob/main/client/src/App.jsx) (Workflow state), [`server/src/routes/transcribe.js`](https://github.com/soroush-mohammadi/study-room/blob/main/server/src/routes/transcribe.js) (Transcription route), [`client/src/api.js`](https://github.com/soroush-mohammadi/study-room/blob/main/client/src/api.js) (API client), [`server/src/routes/translate.js`](https://github.com/soroush-mohammadi/study-room/blob/main/server/src/routes/translate.js) (Translation route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_app["Workflow state<br/>[App.jsx]"]
  node_upload["Audio selection<br/>[UploadPanel.jsx]"]
  node_player["Audio player<br/>[AudioPlayer.jsx]"]
  node_sync["Word sync<br/>[useAudioSync.js]"]
  node_transcript["Transcript view<br/>[Transcript.jsx]"]
  node_wordcount["Word count<br/>[WordCount.jsx]"]
  node_mobile["Mobile menu<br/>[MobileMenu.jsx]"]
  node_wordpage["Vocabulary page<br/>[WordListPage.jsx]"]
  node_wordlist["Vocabulary list<br/>[WordList.jsx]"]
  node_language["Language choice<br/>[LanguageSelect.jsx]"]
  node_clientapi["API client<br/>[api.js]"]
end

subgraph group_api["Express API"]
  node_server["HTTP server<br/>[index.js]"]
  node_transcriberoute["Transcription route<br/>[transcribe.js]"]
  node_transcache[("Transcript cache<br/>[cache.js]")]
  node_translateroute["Translation route<br/>[translate.js]"]
  node_translatecache[("Translation cache<br/>[translateCache.js]")]
end

subgraph group_services["External services"]
  node_assembly["Transcription service<br/>[assemblyai.js]"]
  node_mymemory["Translation provider<br/>[mymemory.js]"]
  node_assemblyexternal["AssemblyAI"]
  node_mymemoryexternal["MyMemory"]
end

node_user(("Audio learner"))

node_user -->|"selects audio"| node_upload
node_upload -->|"reports selection"| node_app
node_user -->|"requests transcription"| node_app
node_app -->|"requests transcription"| node_clientapi
node_clientapi -.->|"posts audio"| node_transcriberoute
node_server -->|"mounts route"| node_transcriberoute
node_transcriberoute -->|"hashes and caches"| node_transcache
node_transcriberoute -->|"transcribes file"| node_assembly
node_assembly -->|"uploads and polls"| node_assemblyexternal
node_transcriberoute -.->|"returns word timings"| node_app
node_app -->|"sets audio source"| node_player
node_app -->|"tracks playback"| node_sync
node_app -->|"passes active word"| node_transcript
node_sync -->|"reads playback time"| node_player
node_app -->|"renders vocabulary"| node_wordlist
node_app -->|"handles language choice"| node_language
node_app -->|"requests translation"| node_clientapi
node_clientapi -.->|"posts word"| node_translateroute
node_server -->|"mounts route"| node_translateroute
node_translateroute -->|"reads and writes"| node_translatecache
node_translateroute -->|"translates text"| node_mymemory
node_mymemory -->|"queries provider"| node_mymemoryexternal
node_app -->|"passes vocabulary"| node_mobile
node_mobile -->|"renders count"| node_wordcount
node_app -->|"shows vocabulary page"| node_wordpage

click node_app "https://github.com/soroush-mohammadi/study-room/blob/main/client/src/App.jsx"
click node_upload "https://github.com/soroush-mohammadi/study-room/blob/main/client/src/components/UploadPanel.jsx"
click node_player "https://github.com/soroush-mohammadi/study-room/blob/main/client/src/components/AudioPlayer.jsx"
click node_sync "https://github.com/soroush-mohammadi/study-room/blob/main/client/src/hooks/useAudioSync.js"
click node_transcript "https://github.com/soroush-mohammadi/study-room/blob/main/client/src/components/Transcript.jsx"
click node_wordcount "https://github.com/soroush-mohammadi/study-room/blob/main/client/src/components/WordCount.jsx"
click node_mobile "https://github.com/soroush-mohammadi/study-room/blob/main/client/src/components/MobileMenu.jsx"
click node_wordpage "https://github.com/soroush-mohammadi/study-room/blob/main/client/src/components/WordListPage.jsx"
click node_wordlist "https://github.com/soroush-mohammadi/study-room/blob/main/client/src/components/WordList.jsx"
click node_language "https://github.com/soroush-mohammadi/study-room/blob/main/client/src/components/LanguageSelect.jsx"
click node_clientapi "https://github.com/soroush-mohammadi/study-room/blob/main/client/src/api.js"
click node_server "https://github.com/soroush-mohammadi/study-room/blob/main/server/src/index.js"
click node_transcriberoute "https://github.com/soroush-mohammadi/study-room/blob/main/server/src/routes/transcribe.js"
click node_transcache "https://github.com/soroush-mohammadi/study-room/blob/main/server/src/cache.js"
click node_assembly "https://github.com/soroush-mohammadi/study-room/blob/main/server/src/services/assemblyai.js"
click node_translateroute "https://github.com/soroush-mohammadi/study-room/blob/main/server/src/routes/translate.js"
click node_translatecache "https://github.com/soroush-mohammadi/study-room/blob/main/server/src/translateCache.js"
click node_mymemory "https://github.com/soroush-mohammadi/study-room/blob/main/server/src/services/mymemory.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_app,node_upload,node_player,node_sync,node_transcript,node_wordcount,node_mobile,node_wordpage,node_wordlist,node_language,node_clientapi toneBlue
class node_server,node_transcriberoute,node_transcache,node_translateroute,node_translatecache toneAmber
class node_assembly,node_mymemory,node_assemblyexternal,node_mymemoryexternal toneMint
class node_user toneIndigo
```

## Components

### React client

- [Workflow state](https://github.com/soroush-mohammadi/study-room/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Audio selection](https://github.com/soroush-mohammadi/study-room/blob/main/client/src/components/UploadPanel.jsx): `client/src/components/UploadPanel.jsx`
- [Audio player](https://github.com/soroush-mohammadi/study-room/blob/main/client/src/components/AudioPlayer.jsx): `client/src/components/AudioPlayer.jsx`
- [Word sync](https://github.com/soroush-mohammadi/study-room/blob/main/client/src/hooks/useAudioSync.js): `client/src/hooks/useAudioSync.js`
- [Transcript view](https://github.com/soroush-mohammadi/study-room/blob/main/client/src/components/Transcript.jsx): `client/src/components/Transcript.jsx`
- [Word count](https://github.com/soroush-mohammadi/study-room/blob/main/client/src/components/WordCount.jsx): `client/src/components/WordCount.jsx`
- [Mobile menu](https://github.com/soroush-mohammadi/study-room/blob/main/client/src/components/MobileMenu.jsx): `client/src/components/MobileMenu.jsx`
- [Vocabulary page](https://github.com/soroush-mohammadi/study-room/blob/main/client/src/components/WordListPage.jsx): `client/src/components/WordListPage.jsx`
- [Vocabulary list](https://github.com/soroush-mohammadi/study-room/blob/main/client/src/components/WordList.jsx): `client/src/components/WordList.jsx`
- [Language choice](https://github.com/soroush-mohammadi/study-room/blob/main/client/src/components/LanguageSelect.jsx): `client/src/components/LanguageSelect.jsx`
- [API client](https://github.com/soroush-mohammadi/study-room/blob/main/client/src/api.js): `client/src/api.js`

### Express API

- [HTTP server](https://github.com/soroush-mohammadi/study-room/blob/main/server/src/index.js): `server/src/index.js`
- [Transcription route](https://github.com/soroush-mohammadi/study-room/blob/main/server/src/routes/transcribe.js): `server/src/routes/transcribe.js`
- [Transcript cache](https://github.com/soroush-mohammadi/study-room/blob/main/server/src/cache.js): `server/src/cache.js`
- [Translation route](https://github.com/soroush-mohammadi/study-room/blob/main/server/src/routes/translate.js): `server/src/routes/translate.js`
- [Translation cache](https://github.com/soroush-mohammadi/study-room/blob/main/server/src/translateCache.js): `server/src/translateCache.js`

### External services

- [Transcription service](https://github.com/soroush-mohammadi/study-room/blob/main/server/src/services/assemblyai.js): `server/src/services/assemblyai.js`
- [Translation provider](https://github.com/soroush-mohammadi/study-room/blob/main/server/src/services/mymemory.js): `server/src/services/mymemory.js`
- **AssemblyAI**
- **MyMemory**

### Other components

- **Audio learner**

## Connections

- Audio learner → Audio selection: selects audio (evidence: `README.md`)
- Audio selection → Workflow state: reports selection (evidence: `client/src/App.jsx`)
- Audio learner → Workflow state: requests transcription (evidence: `README.md`)
- Workflow state → API client: requests transcription (evidence: `client/src/App.jsx`)
- API client → Transcription route: posts audio
- HTTP server → Transcription route: mounts route (evidence: `server/src/index.js`)
- Transcription route → Transcript cache: hashes and caches (evidence: `server/src/routes/transcribe.js`)
- Transcription route → Transcription service: transcribes file (evidence: `server/src/routes/transcribe.js`)
- Transcription service → AssemblyAI: uploads and polls (evidence: `server/src/services/assemblyai.js`)
- Transcription route → Workflow state: returns word timings
- Workflow state → Audio player: sets audio source (evidence: `client/src/App.jsx`)
- Workflow state → Word sync: tracks playback (evidence: `client/src/App.jsx`)
- Workflow state → Transcript view: passes active word (evidence: `client/src/App.jsx`)
- Word sync → Audio player: reads playback time (evidence: `client/src/hooks/useAudioSync.js`)
- Workflow state → Vocabulary list: renders vocabulary (evidence: `client/src/App.jsx`)
- Workflow state → Language choice: handles language choice (evidence: `client/src/App.jsx`)
- Workflow state → API client: requests translation (evidence: `client/src/App.jsx`)
- API client → Translation route: posts word
- HTTP server → Translation route: mounts route (evidence: `server/src/index.js`)
- Translation route → Translation cache: reads and writes (evidence: `server/src/routes/translate.js`)
- Translation route → Translation provider: translates text (evidence: `server/src/routes/translate.js`)
- Translation provider → MyMemory: queries provider (evidence: `server/src/services/mymemory.js`)
- Workflow state → Mobile menu: passes vocabulary (evidence: `client/src/App.jsx`)
- Mobile menu → Word count: renders count (evidence: `client/src/App.jsx`)
- Workflow state → Vocabulary page: shows vocabulary page (evidence: `client/src/App.jsx`)
