Kiến trúc tổng quan
LMS là modular monolith: backend là Spring Boot theo Clean Architecture/DDD, frontend là Angular 20 theo feature-based structure, database là PostgreSQL/Flyway, media dùng R2/Shaka, offline dùng PWA + IndexedDB/Dexie.
Runtime map
| Layer | Công nghệ | Vai trò |
|---|---|---|
| Browser | Angular 20, Signals, PWA | UI cho student, teacher, admin |
| API | Spring Boot 3.2, Java 21 | Auth, course, learning, assessment, payment, AI bridge |
| Database | PostgreSQL 16, Flyway | Source of truth cho user/course/progress/payment |
| Storage | Cloudflare R2/S3-compatible | File upload, video package, offline profile |
| Media | Shaka Player, HLS/DASH | Adaptive video playback |
| Edge | Caddy, Cloudflare Worker | HTTPS, reverse proxy, media auth |
| AI | Wiii embed/API | Chat assistant, Pointy, lesson/course generation |
Request flow backend
Angular component
-> Angular service/API client
-> REST controller
-> application use case
-> domain model/repository port
-> infrastructure adapter/JPA entity
-> PostgreSQL
Quy tắc quan trọng: domain model không phải JPA entity. JPA chỉ nằm trong infrastructure.
Vì sao chọn Just the Docs
Just the Docs là Jekyll theme cho documentation, có built-in search và sidebar. Theo tài liệu chính thức, cách dùng gọn là gem-based: Gemfile + theme: just-the-docs, không cần clone theme vào repo.