# thaonguyen1012/skylearn architecture

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

- Interactive diagram: https://gitdiagram.com/thaonguyen1012/skylearn
- Repository: https://github.com/thaonguyen1012/skylearn

## Overview

1. **Overall shape**
   - SkyLearn is a **server-rendered Django monolith** for learning management.
   - The runtime entry points are `manage.py`, `config/wsgi.py`, and `config/asgi.py`, with `config/settings.py` and `config/urls.py` coordinating the app.

2. **Main architectural boundary: Django project vs feature apps**
   - The repository is split into domain apps: `accounts`, `core`, `course`, `quiz`, `result`, `payments`, and `search`.
   - Each app owns its own models, views, URLs, forms, admin registration, tests, and usually utilities/filters/decorators, which keeps business logic separated by feature area rather than by layer.

3. **Presentation layer**
   - The UI is rendered with Django templates under `templates/`, not a frontend SPA.
   - Shared layout and navigation live in `templates/base.html`, `navbar.html`, `sidebar.html`, and reusable snippets.
   - App-specific pages are organized by domain, such as `templates/accounts/*`, `templates/course/*`, `templates/quiz/*`, and `templates/result/*`.

4. **Identity, roles, and access control**
   - `accounts` is the user-management boundary: students, lecturers, staff/admin workflows, profile pages, and email confirmations.
   - Access is enforced through decorators, custom forms, filters, validators, and signals in the same app.
   - The readme’s role model implies at least three major actor groups: **admin**, **lecturer**, and **student**, with page-level restrictions across the rest of the system.

5. **Academic administration core**
   - `core` appears to hold the institutional backbone: dashboard, news/events, sessions/years, semesters, and shared school-wide views.
   - This is the central administrative subsystem that other apps depend on for academic period context and high-level reporting.
   - The dashboard is explicitly admin-only and acts as the operational overview for the whole LMS.

6. **Course and program management**
   - `course` owns programs, courses, course allocation, registration, and student course lists.
   - It also supports course content attachment workflows, with templates for uploads and course detail pages.
   - The course app is the main bridge between academic structure and student enrollment activity.

7. **Assessment, scoring, and grading**
   - `result` is the grading/reporting subsystem: students’ assessment entries, score calculations, grade levels, comments, and result views.
   - The readme indicates automatic calculation of total, average, point, grade, and pass/warning/fail comments.
   - This app depends on course/session/semester context so results can be grouped by academic period.

8. **Quiz and self-assessment subsystem**
   - `quiz` is a separate learning/assessment domain with MCQ, true/false, and essay support scaffolding.
   - It includes custom template tags, forms, models, and result/progress pages, suggesting a self-contained quiz engine.
   - The readme indicates persistence of quiz sittings/results per user, random question order, pass marks, category progress, and marking workflows for essay questions.

9. **Payments and billing boundary**
   - `payments` is isolated as its own subsystem and has templates for multiple providers: Stripe, PayPal, Coinbase, Paylike, and generic charge/payment pages.
   - The current structure suggests provider-specific rendering and a common payment selection/confirmation flow.
   - It likely connects to invoices and tuition/payment-related user journeys, but remains separate from core academic logic.

10. **Search and cross-cutting lookup**
    - `search` is a lightweight cross-domain lookup feature with its own view, model, and template tags.
    - It likely provides unified querying across users, courses, quizzes, or content rather than being a primary domain store.
    - This is a supporting subsystem rather than a source of record.

11. **Data and persistence model**
    - The app is database-backed via Django ORM and migrations in every major app.
    - The file tree shows many historical migrations, including multilingual field evolution in `core`, `course`, and `quiz`.
    - `media/` stores uploaded artifacts such as registration forms and result sheets, while `static/` contains CSS, JS, fonts, and vendor assets.

12. **Internationalization**
    - The project is multilingual, with translations in `locale/es`, `locale/fr`, and `locale/ru`.
    - Several apps also have `translation.py`, and migrations show language-specific field additions for content such as course and quiz text.
    - This affects the architecture because content is not purely English and some domain entities are language-aware.

13. **Operational and developer tooling**
    - The repo includes GitHub Actions for Django testing and pylint, plus `.pylintrc` and requirements split by environment.
    - `scripts/` contains fake-data generators, indicating the project supports seeded development/demo data.
    - The presence of `templates/error_handler_base.html` and custom 400/403/404/500 pages shows explicit handling of user-facing failures.

14. **Typical request flow**
    - A user request enters Django URL routing, is dispatched to a feature app view, which reads/writes ORM models and renders a template.
    - Domain flows are mostly vertical: authentication in `accounts`, period setup in `core`, enrollment in `course`, assessment in `quiz`/`result`, and payment handling in `payments`.
    - Shared context is passed through templates and permissions rather than through a separate API layer.

15. **What to emphasize in a diagram**
    - Draw one central Django runtime with multiple domain apps around it.
    - Show `accounts` and `core` as foundational services feeding all other apps.
    - Show `course`, `quiz`, `result`, and `payments` as the main user-facing business workflows.
    - Show `templates`, `static`, `media`, and `locale` as shared presentation/content support rather than standalone services.

Main entry points: [`templates/core/dashboard.html`](https://github.com/thaonguyen1012/skylearn/blob/main/templates/core/dashboard.html) (Domain templates), [`config/urls.py`](https://github.com/thaonguyen1012/skylearn/blob/main/config/urls.py) (URL config), [`accounts/views.py`](https://github.com/thaonguyen1012/skylearn/blob/main/accounts/views.py) (Accounts), [`locale/es/LC_MESSAGES/django.po`](https://github.com/thaonguyen1012/skylearn/blob/main/locale/es/LC_MESSAGES/django.po) (Translations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_project["Django project"]
  node_manage_py["manage.py<br/>entrypoint<br/>[manage.py]"]
  node_config_settings["Settings<br/>config<br/>[settings.py]"]
  node_config_urls["URL config<br/>router<br/>[urls.py]"]
  node_config_wsgi_asgi["WSGI/ASGI<br/>runtime<br/>[wsgi.py]"]
end

subgraph group_apps["Domain apps"]
  node_accounts_app[("Accounts<br/>identity<br/>[views.py]")]
  node_core_app[("Core<br/>[views.py]")]
  node_course_app[("Course<br/>catalog<br/>[views.py]")]
  node_quiz_app[("Quiz<br/>assessment<br/>[views.py]")]
  node_result_app[("Result<br/>grading<br/>[views.py]")]
  node_payments_app[("Payments<br/>billing<br/>[views.py]")]
  node_search_app["Search<br/>lookup<br/>[views.py]"]
end

subgraph group_shared["Shared assets"]
  node_templates_base["Base templates<br/>presentation<br/>[base.html]"]
  node_templates_domain["Domain templates<br/>presentation<br/>[dashboard.html]"]
  node_templates_auth["Auth pages<br/>presentation<br/>[login.html]"]
  node_templates_shared_snippets["Snippets<br/>presentation<br/>[messages.html]"]
  node_static_assets["Static assets<br/>[main.js]"]
  node_media_assets[("Media files<br/>uploads<br/>[README.txt]")]
  node_locale_files["Translations<br/>i18n<br/>[django.po]"]
end

node_manage_py -->|"loads"| node_config_settings
node_manage_py -->|"routes"| node_config_urls
node_config_wsgi_asgi -->|"reads"| node_config_settings
node_config_urls -->|"dispatches"| node_accounts_app
node_config_urls -->|"dispatches"| node_core_app
node_config_urls -->|"dispatches"| node_course_app
node_config_urls -->|"dispatches"| node_quiz_app
node_config_urls -->|"dispatches"| node_result_app
node_config_urls -->|"dispatches"| node_payments_app
node_config_urls -->|"dispatches"| node_search_app
node_accounts_app -->|"renders"| node_templates_auth
node_accounts_app -->|"renders"| node_templates_domain
node_accounts_app -->|"translates"| node_locale_files
node_accounts_app -->|"uploads"| node_media_assets
node_core_app -->|"renders"| node_templates_domain
node_core_app -->|"translates"| node_locale_files
node_course_app -->|"renders"| node_templates_domain
node_course_app -->|"uploads"| node_media_assets
node_course_app -->|"translates"| node_locale_files
node_quiz_app -->|"renders"| node_templates_domain
node_quiz_app -->|"translates"| node_locale_files
node_result_app -->|"renders"| node_templates_domain
node_payments_app -->|"renders"| node_templates_domain
node_search_app -->|"renders"| node_templates_domain
node_templates_base -->|"includes"| node_templates_shared_snippets
node_templates_domain -->|"includes"| node_templates_shared_snippets
node_templates_domain -->|"loads"| node_static_assets
node_templates_auth -->|"loads"| node_static_assets
node_locale_files -->|"feeds"| node_templates_domain

click node_manage_py "https://github.com/thaonguyen1012/skylearn/blob/main/manage.py"
click node_config_settings "https://github.com/thaonguyen1012/skylearn/blob/main/config/settings.py"
click node_config_urls "https://github.com/thaonguyen1012/skylearn/blob/main/config/urls.py"
click node_config_wsgi_asgi "https://github.com/thaonguyen1012/skylearn/blob/main/config/wsgi.py"
click node_accounts_app "https://github.com/thaonguyen1012/skylearn/blob/main/accounts/views.py"
click node_core_app "https://github.com/thaonguyen1012/skylearn/blob/main/core/views.py"
click node_course_app "https://github.com/thaonguyen1012/skylearn/blob/main/course/views.py"
click node_quiz_app "https://github.com/thaonguyen1012/skylearn/blob/main/quiz/views.py"
click node_result_app "https://github.com/thaonguyen1012/skylearn/blob/main/result/views.py"
click node_payments_app "https://github.com/thaonguyen1012/skylearn/blob/main/payments/views.py"
click node_search_app "https://github.com/thaonguyen1012/skylearn/blob/main/search/views.py"
click node_templates_base "https://github.com/thaonguyen1012/skylearn/blob/main/templates/base.html"
click node_templates_domain "https://github.com/thaonguyen1012/skylearn/blob/main/templates/core/dashboard.html"
click node_templates_auth "https://github.com/thaonguyen1012/skylearn/blob/main/templates/registration/login.html"
click node_templates_shared_snippets "https://github.com/thaonguyen1012/skylearn/blob/main/templates/snippets/messages.html"
click node_static_assets "https://github.com/thaonguyen1012/skylearn/blob/main/static/js/main.js"
click node_media_assets "https://github.com/thaonguyen1012/skylearn/blob/main/media/registration_form/README.txt"
click node_locale_files "https://github.com/thaonguyen1012/skylearn/blob/main/locale/es/LC_MESSAGES/django.po"

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_manage_py,node_config_settings,node_config_urls,node_config_wsgi_asgi toneBlue
class node_accounts_app,node_core_app,node_course_app,node_quiz_app,node_result_app,node_payments_app,node_search_app toneAmber
class node_templates_base,node_templates_domain,node_templates_auth,node_templates_shared_snippets,node_static_assets,node_media_assets,node_locale_files toneMint
```

## Components

### Django project

Runtime entrypoints and global configuration.

- [manage.py](https://github.com/thaonguyen1012/skylearn/blob/main/manage.py): entrypoint · Django management entrypoint. · `manage.py`
- [Settings](https://github.com/thaonguyen1012/skylearn/blob/main/config/settings.py): config · Project-wide Django settings. · `config/settings.py`
- [URL config](https://github.com/thaonguyen1012/skylearn/blob/main/config/urls.py): router · Root URL dispatcher for the site. · `config/urls.py`
- [WSGI/ASGI](https://github.com/thaonguyen1012/skylearn/blob/main/config/wsgi.py): runtime · Deployment and async entrypoints. · `config/wsgi.py`

### Domain apps

Feature boundaries that own business workflows.

- [Accounts](https://github.com/thaonguyen1012/skylearn/blob/main/accounts/views.py): identity · User management, roles, profiles, and access control. · `accounts/views.py`
- [Core](https://github.com/thaonguyen1012/skylearn/blob/main/core/views.py): admin core · Institutional backbone: dashboard, sessions, semesters, and shared school views. · `core/views.py`
- [Course](https://github.com/thaonguyen1012/skylearn/blob/main/course/views.py): catalog · Programs, courses, allocation, and registration workflows. · `course/views.py`
- [Quiz](https://github.com/thaonguyen1012/skylearn/blob/main/quiz/views.py): assessment · Self-assessment engine for quizzes, sittings, and marking. · `quiz/views.py`
- [Result](https://github.com/thaonguyen1012/skylearn/blob/main/result/views.py): grading · Scores, grades, comments, and academic results. · `result/views.py`
- [Payments](https://github.com/thaonguyen1012/skylearn/blob/main/payments/views.py): billing · Payment gateway flows and charge confirmation. · `payments/views.py`
- [Search](https://github.com/thaonguyen1012/skylearn/blob/main/search/views.py): lookup · Cross-domain search and lookup support. · `search/views.py`

### Shared assets

Templates, static content, media, and translations used across apps.

- [Base templates](https://github.com/thaonguyen1012/skylearn/blob/main/templates/base.html): presentation · Shared layout, navigation, and error pages. · `templates/base.html`
- [Domain templates](https://github.com/thaonguyen1012/skylearn/blob/main/templates/core/dashboard.html): presentation · Feature-specific server-rendered pages for the major apps. · `templates/core/dashboard.html`
- [Auth pages](https://github.com/thaonguyen1012/skylearn/blob/main/templates/registration/login.html): presentation · Login, registration, and password reset screens. · `templates/registration/login.html`
- [Snippets](https://github.com/thaonguyen1012/skylearn/blob/main/templates/snippets/messages.html): presentation · Reusable partials such as navbar, sidebar, filters, and messages. · `templates/snippets/messages.html`
- [Static assets](https://github.com/thaonguyen1012/skylearn/blob/main/static/js/main.js): assets · CSS, JS, fonts, and vendor front-end resources. · `static/js/main.js`
- [Media files](https://github.com/thaonguyen1012/skylearn/blob/main/media/registration_form/README.txt): uploads · Uploaded registration forms and result sheets. · `media/registration_form/README.txt`
- [Translations](https://github.com/thaonguyen1012/skylearn/blob/main/locale/es/LC_MESSAGES/django.po): i18n · Localized message catalogs for supported languages. · `locale/es/LC_MESSAGES/django.po`

## Connections

- manage.py → Settings: loads · Management commands use project settings.
- manage.py → URL config: routes · Management-run server uses root URL config.
- WSGI/ASGI → Settings: reads · WSGI/ASGI runtime is configured by settings.
- URL config → Accounts: dispatches · Root routing sends requests to the accounts app.
- URL config → Core: dispatches · Root routing sends requests to core views.
- URL config → Course: dispatches · Root routing sends requests to course views.
- URL config → Quiz: dispatches · Root routing sends requests to quiz views.
- URL config → Result: dispatches · Root routing sends requests to result views.
- URL config → Payments: dispatches · Root routing sends requests to payment views.
- URL config → Search: dispatches · Root routing sends requests to search views.
- Accounts → Auth pages: renders · Authentication and account flows use auth templates.
- Accounts → Domain templates: renders · Profile and staff/student pages are server-rendered.
- Accounts → Translations: translates · Account UI supports localized content.
- Accounts → Media files: uploads · Account workflows handle uploaded forms and artifacts.
- Core → Domain templates: renders · Dashboard and institutional pages use domain templates.
- Core → Translations: translates · Core content includes localized fields.
- Course → Domain templates: renders · Course catalog and registration pages are server-rendered.
- Course → Media files: uploads · Course content and related files can be stored as media.
- Course → Translations: translates · Course text and summaries are localized.
- Quiz → Domain templates: renders · Quiz forms, progress, and results use domain templates.
- Quiz → Translations: translates · Quiz questions and choices are localized.
- Result → Domain templates: renders · Result entry and reporting pages are server-rendered.
- Payments → Domain templates: renders · Provider and payment pages use domain templates.
- Search → Domain templates: renders · Search page uses domain templates.
- Base templates → Snippets: includes · Base layout composes shared navigation and message snippets.
- Domain templates → Snippets: includes · Feature pages reuse shared partials.
- Domain templates → Static assets: loads · Templates depend on CSS, JS, fonts, and vendor assets.
- Auth pages → Static assets: loads · Auth pages use the shared front-end asset bundle.
- Translations → Domain templates: feeds · Localized strings support rendered pages.
