How adilmohak/django-lms works
Project type and purpose
• This is a full-stack, monolithic Django-based Learning Management System (LMS).
• It combines server-side rendered pages (Django templates + SCSS/JS) with a RESTful API layer (Django REST Framework).
• Key use cases: user/account management (students, lecturers, parents, admins), course catalog & enrollment, quizzes, results, payments, search, PDF/CSV exports.
Main system components
A. Presentation Layer
• Web server (Nginx/Apache)
• Django application server (Gunicorn/Uvicorn via ASGI or WSGI)
• Static assets (CSS, JS, fonts, images) served from /static
• Media file storage for uploads (/media)
• Django templates under /templates
B. Application Layer
• Django “config” module: settings, URL routing, WSGI/ASGI entrypoints
• Django apps (each one a self-contained module):
• accounts (user registration, authentication, profiles)
• core (dashboard, sessions, semesters, news/events)
• course (programs, course creation & allocation)
• quiz (question bank, sittings, templating)
• result (grading, assessment reports, PDF generation)
• payments (Stripe, PayPal, Coinbase, Paylike integrations)
• search (simple DB-backed search utilities)
• REST API submodules (accounts/api, core/api, …) powered by Django REST Framework
C. Data Layer
• Relational database (PostgreSQL/MySQL/SQLite)
• Django ORM models in each app, migrations under /migrations
D. External Services
• Payment gateways: Stripe, PayPal, Coinbase, Paylike
• Email service (SMTP or transactional provider for confirmations)
• (Optional) Caching layer (Redis or Memcached) for session & query caching
• (Optional) Task queue (Celery/RabbitMQ) if background tasks are needed
Component interactions and data flow
• User → HTTP(S) → Load Balancer → Nginx → Gunicorn → Django URL router
• Router dispatches to:
a. Template-based views (accounts/views.py, course/views.py, etc.)
b. API views (accounts/api/views.py, …)
• Business logic triggers ORM calls → Database
• Payments views call external payment gateway APIs → responses returned to front end
• Media uploads go to /media or S3/Cloud storage
• Search queries hit search/models.py or external search engine if added
• Localization loaded via Django’s i18n (locale folders)
Architectural patterns and design principles
• Modular monolith: each feature in its own Django app
• MVC/MVT: Models (models.py) ↔ Views (views.py, APIViews) ↔ Templates/Serializers
• RESTful API layer coexisting with server-side rendering
• Separation of concerns: business logic in utils, decorators, filters; validation in forms, serializers, validators
• Configurable environments via .env, config/settings.py and environment–specific requirement files