# mbasa6034-rgb/premium-bdu architecture

> Architecture diagram of the GitHub repository mbasa6034-rgb/premium-bdu, 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/mbasa6034-rgb/premium-bdu
- Repository: https://github.com/mbasa6034-rgb/premium-bdu

## Overview

This repository contains a Flutter-based learning app, browser assets, course content, and a script that synchronizes content to a REST backend. The intended user journey appears to be studying course material in the app, but the client sources and README were not provided, so client-side calls and navigation cannot be verified. The shown sync script reads course JSON, updates backend course/chapter/content records and settings, removes stale records, then advances the content version.

Main entry points: [`scripts/deploy.py`](https://github.com/mbasa6034-rgb/premium-bdu/blob/main/scripts/deploy.py) (Content sync), [`app/assets/www/index.html`](https://github.com/mbasa6034-rgb/premium-bdu/blob/main/app/assets/www/index.html) (Web app entry), [`app/lib/main.dart`](https://github.com/mbasa6034-rgb/premium-bdu/blob/main/app/lib/main.dart) (Flutter app), [`app/assets/www/app.js`](https://github.com/mbasa6034-rgb/premium-bdu/blob/main/app/assets/www/app.js) (Web app logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Learning clients"]
  node_flutter["Flutter app<br/>[main.dart]"]
  node_web_entry["Web app entry<br/>[index.html]"]
  node_web_app["Web app logic<br/>[app.js]"]
  node_auth["Authentication<br/>[auth.js]"]
  node_i18n["Localization<br/>[i18n.js]"]
  node_splash["Splash screen<br/>[splash.html]"]
end

subgraph group_content["Course content"]
  node_course_files["Course data"]
  node_settings_file["App settings<br/>[settings.json]"]
end

subgraph group_sync["Content synchronization"]
  node_sync_script["Content sync<br/>[deploy.py]"]
end

subgraph group_backend["Backend data"]
  node_rest_api["REST backend"]
  node_courses[("Courses")]
  node_chapters[("Chapters")]
  node_chapter_content[("Chapter content")]
  node_settings[("Remote settings")]
  node_content_version[("Content version")]
end

node_learner(("Learner"))

node_learner -.->|"uses"| node_flutter
node_learner -.->|"uses"| node_web_entry
node_sync_script -->|"reads"| node_course_files
node_sync_script -->|"reads"| node_settings_file
node_sync_script -->|"sends REST requests"| node_rest_api
node_rest_api -->|"updates"| node_courses
node_rest_api -->|"updates and prunes"| node_chapters
node_rest_api -->|"replaces content"| node_chapter_content
node_rest_api -->|"upserts"| node_settings
node_rest_api -->|"advances"| node_content_version
node_web_entry -.->|"loads"| node_web_app

click node_flutter "https://github.com/mbasa6034-rgb/premium-bdu/blob/main/app/lib/main.dart"
click node_web_entry "https://github.com/mbasa6034-rgb/premium-bdu/blob/main/app/assets/www/index.html"
click node_web_app "https://github.com/mbasa6034-rgb/premium-bdu/blob/main/app/assets/www/app.js"
click node_auth "https://github.com/mbasa6034-rgb/premium-bdu/blob/main/app/assets/www/auth.js"
click node_i18n "https://github.com/mbasa6034-rgb/premium-bdu/blob/main/app/assets/www/i18n.js"
click node_splash "https://github.com/mbasa6034-rgb/premium-bdu/blob/main/app/assets/www/splash.html"
click node_course_files "https://github.com/mbasa6034-rgb/premium-bdu/tree/main/content/subjects"
click node_settings_file "https://github.com/mbasa6034-rgb/premium-bdu/blob/main/content/settings.json"
click node_sync_script "https://github.com/mbasa6034-rgb/premium-bdu/blob/main/scripts/deploy.py"

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_flutter,node_web_entry,node_web_app,node_auth,node_i18n,node_splash toneBlue
class node_course_files,node_settings_file toneAmber
class node_sync_script toneMint
class node_rest_api,node_courses,node_chapters,node_chapter_content,node_settings,node_content_version toneRose
class node_learner toneIndigo
```

## Components

### Learning clients

- [Flutter app](https://github.com/mbasa6034-rgb/premium-bdu/blob/main/app/lib/main.dart): `app/lib/main.dart`
- [Web app entry](https://github.com/mbasa6034-rgb/premium-bdu/blob/main/app/assets/www/index.html): `app/assets/www/index.html`
- [Web app logic](https://github.com/mbasa6034-rgb/premium-bdu/blob/main/app/assets/www/app.js): `app/assets/www/app.js`
- [Authentication](https://github.com/mbasa6034-rgb/premium-bdu/blob/main/app/assets/www/auth.js): `app/assets/www/auth.js`
- [Localization](https://github.com/mbasa6034-rgb/premium-bdu/blob/main/app/assets/www/i18n.js): `app/assets/www/i18n.js`
- [Splash screen](https://github.com/mbasa6034-rgb/premium-bdu/blob/main/app/assets/www/splash.html): `app/assets/www/splash.html`

### Course content

- [Course data](https://github.com/mbasa6034-rgb/premium-bdu/tree/main/content/subjects): `content/subjects`
- [App settings](https://github.com/mbasa6034-rgb/premium-bdu/blob/main/content/settings.json): `content/settings.json`

### Content synchronization

- [Content sync](https://github.com/mbasa6034-rgb/premium-bdu/blob/main/scripts/deploy.py): `scripts/deploy.py`

### Backend data

- **REST backend**
- **Courses**
- **Chapters**
- **Chapter content**
- **Remote settings**
- **Content version**

### Other components

- **Learner**

## Connections

- Learner → Flutter app: uses
- Learner → Web app entry: uses
- Content sync → Course data: reads (evidence: `scripts/deploy.py`)
- Content sync → App settings: reads (evidence: `scripts/deploy.py`)
- Content sync → REST backend: sends REST requests (evidence: `scripts/deploy.py`)
- REST backend → Courses: updates
- REST backend → Chapters: updates and prunes
- REST backend → Chapter content: replaces content
- REST backend → Remote settings: upserts
- REST backend → Content version: advances
- Web app entry → Web app logic: loads
