# hafez-mostafa/sprachlern_app architecture

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

- Interactive diagram: https://gitdiagram.com/hafez-mostafa/sprachlern_app
- Repository: https://github.com/hafez-mostafa/sprachlern_app

## Overview

This is a NestJS backend for a language-learning application, despite the generic Nest starter README. The learner-facing flow is a client request to public content or child-progress endpoints, through controllers and domain services, into PostgreSQL; guardians authenticate separately, while administrators manage learning content behind an admin JWT. Content administration spans concepts and translations, words and media, exercises, questions, and tasks. The source excerpts and index establish these service calls and storage integrations; other feature relationships are omitted where their wiring was not shown.

Main entry points: [`src/media/media.service.ts`](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/media/media.service.ts) (Media service), [`src/concepts/concepts.service.ts`](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/concepts/concepts.service.ts) (Concepts & translations), [`src/words/words.service.ts`](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/words/words.service.ts) (Words & audio), [`src/concepts/concepts.controller.ts`](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/concepts/concepts.controller.ts) (Content controllers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Identity &amp; Access"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_admin["Admin accounts<br/>[admins.service.ts]"]
  node_authapi["Auth controller<br/>[auth.controller.ts]"]
  node_adminapi["Admin controller"]
end

subgraph group_learning["Learner Accounts &amp; Progress"]
  node_guardian["Guardian accounts"]
  node_child["Child profiles"]
  node_progress["Learning progress"]
  node_guardianapi["Guardian controller"]
  node_childapi["Child controllers"]
  node_progressapi["Progress controllers"]
end

subgraph group_content["Learning Content"]
  node_concepts["Concepts &amp; translations"]
  node_words["Words &amp; audio<br/>[words.service.ts]"]
  node_exercises["Exercises"]
  node_questions["Question pool"]
  node_tasks["Tasks &amp; assignments<br/>[tasks.service.ts]"]
  node_lookups["Reference lookups<br/>[lookups.service.ts]"]
  node_contentapi["Content controllers"]
  node_wordapi["Word controller"]
  node_exerciseapi["Exercise controller"]
  node_questionapi["Question controller"]
  node_taskapi["Task controllers"]
end

subgraph group_platform["Storage &amp; Media"]
  node_media["Media service<br/>[media.service.ts]"]
  node_cloudinary["Cloudinary adapter"]
  node_database[("PostgreSQL")]
end

node_client(("App client"))

node_client -->|"requests"| node_guardianapi
node_client -->|"requests"| node_childapi
node_client -->|"submits progress"| node_progressapi
node_client -->|"requests"| node_contentapi
node_client -->|"requests"| node_wordapi
node_client -->|"requests"| node_exerciseapi
node_client -->|"authenticates"| node_authapi
node_guardianapi -->|"calls"| node_guardian
node_childapi -->|"calls"| node_child
node_progressapi -->|"calls"| node_progress
node_authapi -->|"calls"| node_auth
node_adminapi -->|"calls"| node_admin
node_contentapi -->|"calls"| node_concepts
node_contentapi -->|"passes uploads"| node_media
node_wordapi -->|"calls"| node_words
node_wordapi -->|"passes uploads"| node_media
node_exerciseapi -->|"calls"| node_exercises
node_questionapi -->|"calls"| node_questions
node_taskapi -->|"calls"| node_tasks
node_guardian -->|"reads/writes"| node_database
node_child -->|"reads/writes"| node_database
node_progress -->|"reads/writes"| node_database
node_auth -->|"looks up accounts"| node_database
node_concepts -->|"reads/writes"| node_database
node_concepts -->|"uploads/deletes"| node_media
node_words -->|"reads/writes"| node_database
node_words -->|"uploads/deletes"| node_media
node_exercises -->|"reads/writes"| node_database
node_questions -->|"reads/writes"| node_database
node_tasks -->|"reads/writes"| node_database
node_lookups -->|"reads"| node_database
node_media -->|"uploads/deletes"| node_cloudinary
node_cloudinary -.-> node_database

click node_guardian "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/guardians/guardians.service.ts"
click node_auth "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/auth/auth.service.ts"
click node_admin "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/admins/admins.service.ts"
click node_child "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/child-profiles/child-profiles.service.ts"
click node_progress "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/learning-progress/learning-progress.service.ts"
click node_concepts "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/concepts/concepts.service.ts"
click node_words "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/words/words.service.ts"
click node_exercises "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/exercises/exercises.service.ts"
click node_questions "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/question-pool/question-pool.service.ts"
click node_tasks "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/tasks/tasks.service.ts"
click node_lookups "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/lookups/lookups.service.ts"
click node_contentapi "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/concepts/concepts.controller.ts"
click node_wordapi "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/words/words.controller.ts"
click node_exerciseapi "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/exercises/exercises.controller.ts"
click node_questionapi "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/question-pool/question-pool.controller.ts"
click node_taskapi "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/tasks/task-detail.controller.ts"
click node_guardianapi "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/guardians/guardians.controller.ts"
click node_childapi "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/child-profiles/child-profiles.controller.ts"
click node_progressapi "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/learning-progress/child-progress.controller.ts"
click node_authapi "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/auth/auth.controller.ts"
click node_adminapi "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/admins/admins.controller.ts"
click node_media "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/media/media.service.ts"
click node_cloudinary "https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/cloudinary/cloudinary.service.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_auth,node_admin,node_authapi,node_adminapi,node_client toneBlue
class node_guardian,node_child,node_progress,node_guardianapi,node_childapi,node_progressapi toneAmber
class node_concepts,node_words,node_exercises,node_questions,node_tasks,node_lookups,node_contentapi,node_wordapi,node_exerciseapi,node_questionapi,node_taskapi toneMint
class node_media,node_cloudinary,node_database toneRose
```

## Components

### Identity & Access

- [Authentication](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/auth/auth.service.ts): `src/auth/auth.service.ts`
- [Admin accounts](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/admins/admins.service.ts): `src/admins/admins.service.ts`
- [Auth controller](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/auth/auth.controller.ts): `src/auth/auth.controller.ts`
- [Admin controller](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/admins/admins.controller.ts): `src/admins/admins.controller.ts`

### Learner Accounts & Progress

- [Guardian accounts](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/guardians/guardians.service.ts): `src/guardians/guardians.service.ts`
- [Child profiles](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/child-profiles/child-profiles.service.ts): `src/child-profiles/child-profiles.service.ts`
- [Learning progress](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/learning-progress/learning-progress.service.ts): `src/learning-progress/learning-progress.service.ts`
- [Guardian controller](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/guardians/guardians.controller.ts): `src/guardians/guardians.controller.ts`
- [Child controllers](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/child-profiles/child-profiles.controller.ts): `src/child-profiles/child-profiles.controller.ts`
- [Progress controllers](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/learning-progress/child-progress.controller.ts): `src/learning-progress/child-progress.controller.ts`

### Learning Content

- [Concepts & translations](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/concepts/concepts.service.ts): `src/concepts/concepts.service.ts`
- [Words & audio](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/words/words.service.ts): `src/words/words.service.ts`
- [Exercises](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/exercises/exercises.service.ts): `src/exercises/exercises.service.ts`
- [Question pool](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/question-pool/question-pool.service.ts): `src/question-pool/question-pool.service.ts`
- [Tasks & assignments](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/tasks/tasks.service.ts): `src/tasks/tasks.service.ts`
- [Reference lookups](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/lookups/lookups.service.ts): `src/lookups/lookups.service.ts`
- [Content controllers](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/concepts/concepts.controller.ts): `src/concepts/concepts.controller.ts`
- [Word controller](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/words/words.controller.ts): `src/words/words.controller.ts`
- [Exercise controller](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/exercises/exercises.controller.ts): `src/exercises/exercises.controller.ts`
- [Question controller](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/question-pool/question-pool.controller.ts): `src/question-pool/question-pool.controller.ts`
- [Task controllers](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/tasks/task-detail.controller.ts): `src/tasks/task-detail.controller.ts`

### Storage & Media

- [Media service](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/media/media.service.ts): `src/media/media.service.ts`
- [Cloudinary adapter](https://github.com/hafez-mostafa/sprachlern_app/blob/main/src/cloudinary/cloudinary.service.ts): `src/cloudinary/cloudinary.service.ts`
- **PostgreSQL**

### Other components

- **App client**

## Connections

- App client → Guardian controller: requests (evidence: `src/guardians/guardians.controller.ts`)
- App client → Child controllers: requests (evidence: `src/child-profiles/child-profiles.controller.ts`)
- App client → Progress controllers: submits progress
- App client → Content controllers: requests (evidence: `src/concepts/concepts.controller.ts`)
- App client → Word controller: requests (evidence: `src/words/words.controller.ts`)
- App client → Exercise controller: requests (evidence: `src/exercises/exercises.controller.ts`)
- App client → Auth controller: authenticates (evidence: `src/auth/auth.controller.ts`)
- Guardian controller → Guardian accounts: calls (evidence: `src/guardians/guardians.controller.ts`)
- Child controllers → Child profiles: calls (evidence: `src/child-profiles/child-profiles.controller.ts`)
- Progress controllers → Learning progress: calls (evidence: `src/learning-progress/child-progress.controller.ts`)
- Auth controller → Authentication: calls (evidence: `src/auth/auth.controller.ts`)
- Admin controller → Admin accounts: calls (evidence: `src/admins/admins.controller.ts`)
- Content controllers → Concepts & translations: calls (evidence: `src/concepts/concepts.controller.ts`)
- Content controllers → Media service: passes uploads (evidence: `src/concepts/concepts.controller.ts`)
- Word controller → Words & audio: calls (evidence: `src/words/words.controller.ts`)
- Word controller → Media service: passes uploads (evidence: `src/words/words.controller.ts`)
- Exercise controller → Exercises: calls (evidence: `src/exercises/exercises.controller.ts`)
- Question controller → Question pool: calls (evidence: `src/question-pool/question-pool.controller.ts`)
- Task controllers → Tasks & assignments: calls (evidence: `src/tasks/task-detail.controller.ts`)
- Guardian accounts → PostgreSQL: reads/writes (evidence: `src/guardians/guardians.service.ts`)
- Child profiles → PostgreSQL: reads/writes (evidence: `src/child-profiles/child-profiles.service.ts`)
- Learning progress → PostgreSQL: reads/writes (evidence: `src/learning-progress/learning-progress.service.ts`)
- Authentication → PostgreSQL: looks up accounts (evidence: `src/auth/auth.service.ts`)
- Concepts & translations → PostgreSQL: reads/writes (evidence: `src/concepts/concepts.service.ts`)
- Concepts & translations → Media service: uploads/deletes (evidence: `src/concepts/concepts.service.ts`)
- Words & audio → PostgreSQL: reads/writes (evidence: `src/words/words.service.ts`)
- Words & audio → Media service: uploads/deletes (evidence: `src/words/words.service.ts`)
- Exercises → PostgreSQL: reads/writes (evidence: `src/exercises/exercises.service.ts`)
- Question pool → PostgreSQL: reads/writes (evidence: `src/question-pool/question-pool.service.ts`)
- Tasks & assignments → PostgreSQL: reads/writes (evidence: `src/tasks/tasks.service.ts`)
- Reference lookups → PostgreSQL: reads (evidence: `src/lookups/lookups.service.ts`)
- Media service → Cloudinary adapter: uploads/deletes (evidence: `src/media/media.service.ts`)
- Cloudinary adapter → PostgreSQL
