Skip to content

Repository files navigation

Lernova

Lernova

CI

Lernova is a full-stack Django learning-management system with role-based access, real-time chat, background notifications and a REST API. Students enrol on courses, teachers manage content and assignments, and admins oversee the platform, with live per-course discussion over WebSockets.

Containerised with Docker, backed by a REST API with interactive Swagger docs, and covered by an automated test suite that runs on every push via GitHub Actions.

Highlights

  • Custom role-based user model (student / teacher / admin) with per-role dashboards and permissions.
  • REST API built with Django REST Framework: viewsets, custom RBAC permission classes, filtering/search/ordering, and auto-generated Swagger/ReDoc docs.
  • Real-time chat over WebSockets using Django Channels + Redis, with authenticated, per-room access control.
  • Asynchronous work offloaded to Celery workers (notification delivery) with Redis as the broker.
  • Split settings (base / production) reading all secrets from the environment, so nothing sensitive is committed.
  • CI on every push. GitHub Actions runs the test suite against Postgres + Redis and lints with ruff.

Features

  • Role-based accounts: student / teacher / admin, each with tailored dashboards and permissions (custom user model with UUID primary keys).
  • Course management: create courses, upload validated materials, set assignments, and enrol students up to a capacity limit.
  • Real-time chat: per-course discussion rooms over WebSockets (Django Channels + Redis), with authenticated access control and typing indicators.
  • Background notifications delivered asynchronously via Celery.
  • REST API: Django REST Framework endpoints with custom permission classes and interactive Swagger docs (drf-yasg).
  • Course feedback: 1–5 star ratings and comments, with one review per student per course enforced at the database level.

Tech stack

Area Technologies
Backend Python 3.12, Django 4.2 LTS, Django REST Framework
Real-time / async Django Channels, Redis, Celery, Daphne
Database PostgreSQL (SQLite works for a quick local run)
Frontend Django templates, Bootstrap 4 (crispy-forms)
Infra Docker, docker-compose, WhiteNoise, Gunicorn
Testing / CI Django test framework, coverage, GitHub Actions, ruff

Architecture

Five Django apps keep concerns separated:

App Responsibility
accounts Custom user model, authentication, profiles, role logic
courses Courses, enrolment, materials, assignments, feedback
chat WebSocket consumers and per-course discussion rooms
notifications Celery tasks for asynchronous notifications
api DRF serializers, viewsets and permission classes

Settings are split under elearning_platform/settings/: base.py for local/dev (the default) and production.py for deployment (Postgres/RDS, S3 static+media, hardened security headers). All secrets come from environment variables (see .env.example).

Running locally

Option A: Docker (recommended)

Brings up Postgres, Redis, the web app and a Celery worker. Migrations run automatically on start.

docker-compose -f docker-compose.dev.yml up --build

Then seed some demo data (optional):

docker-compose -f docker-compose.dev.yml exec web python manage.py create_demo_data

Option B: manual

Requires Python 3.10+, and (for chat/Celery) Redis. PostgreSQL is used by default; for a quick look you can point the database at SQLite instead.

python -m venv venv && source venv/bin/activate
pip install -r requirements-dev.txt
cp .env.example .env          # then edit values (set DEBUG=True for dev)

python manage.py migrate
python manage.py create_demo_data   # optional: seed demo accounts
python manage.py runserver

Then open:

Demo accounts (seeded by create_demo_data)

These exist only in the local demo database, and are not real credentials.

  • Admin: admin / admin123
  • Teachers: teacher1–teacher3 / password123
  • Students: student1–student6 / password123

API overview

All endpoints live under /api/ and require authentication (session auth). Interactive docs are at /swagger/.

Resource Endpoint Notes
Users GET /api/users, GET /api/users/me Read-only; me returns the current user; searchable/filterable by role
Status updates /api/status-updates Full CRUD; users can only edit their own (IsOwnerOrReadOnly)
Courses /api/courses, POST /api/courses/{slug}/enroll Teachers create/edit their own courses (IsTeacherOrReadOnly); students enrol
Enrollments GET /api/enrollments Read-only; scoped to the requesting student/teacher

Custom permission classes (api/permissions.py) enforce the API rules: only teachers create courses (IsTeacherOrReadOnly) and only owners edit their own content (IsOwnerOrReadOnly). Course feedback is one-per-student (enforced at the database level) and gated on enrolment in the course views.

Tests

The suite covers the models, auth flows, and API permissions across the accounts, courses and api apps.

coverage run manage.py test
coverage report

Note: Django forces DEBUG=False during tests, so the WhiteNoise manifest static storage needs a one-off python manage.py collectstatic --noinput first (the CI workflow does this automatically). To run the suite without Postgres, point DATABASES at SQLite via a small local settings module.

Configuration

All secrets and environment-specific values are read from environment variables (see .env.example), so nothing sensitive is committed. manage.py defaults to the base settings; production deploys set DJANGO_SETTINGS_MODULE=elearning_platform.settings.production.

License

Released under the MIT License.

About

Full-stack Django LMS — role-based access, real-time WebSocket chat, Celery notifications, REST API. Dockerised.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages