How thaonguyen1012/skylearn works
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: dashboard.html Domain templates · urls.py URL config · views.py Accounts · django.po Translations
Components 18
Django project
Runtime entrypoints and global configuration.
- manage.py · Django management entrypoint.
manage.py - Settings · Project-wide Django settings.
config/settings.py - URL config · Root URL dispatcher for the site.
config/urls.py - WSGI/ASGI · Deployment and async entrypoints.
config/wsgi.py
Domain apps
Feature boundaries that own business workflows.
- Accounts · User management, roles, profiles, and access control.
accounts/views.py - Core · Institutional backbone: dashboard, sessions, semesters, and shared school views.
core/views.py - Course · Programs, courses, allocation, and registration workflows.
course/views.py - Quiz · Self-assessment engine for quizzes, sittings, and marking.
quiz/views.py - Result · Scores, grades, comments, and academic results.
result/views.py - Payments · Payment gateway flows and charge confirmation.
payments/views.py - Search · Cross-domain search and lookup support.
search/views.py
Shared assets
Templates, static content, media, and translations used across apps.
- Base templates · Shared layout, navigation, and error pages.
templates/base.html - Domain templates · Feature-specific server-rendered pages for the major apps.
templates/core/dashboard.html - Auth pages · Login, registration, and password reset screens.
templates/registration/login.html - Snippets · Reusable partials such as navbar, sidebar, filters, and messages.
templates/snippets/messages.html - Static assets · CSS, JS, fonts, and vendor front-end resources.
static/js/main.js - Media files · Uploaded registration forms and result sheets.
media/registration_form/README.txt - Translations · Localized message catalogs for supported languages.
locale/es/LC_MESSAGES/django.po
Connections 29
- 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.