The EduQuest Backend Application is the core service layer of EduQuest, a web app designed to enhance student engagement and learning performance through digital badges and gamified learning experiences.
This backend provides essential functionalities for managing user authentication, course management, quest generation, and progress tracking, as well as integration with external tools such as Wooclap for importing quiz data.
Built using the Django REST Framework (DRF), the backend manages API requests from the frontend, handles Bearer token authentication, processes quest-related logic, and issues digital badges to students based on their achievements.
The frontend application can be found here.
- Architecture Overview
- Demo
- Key Features
- Technologies Used
- Prerequisites
- Installation
- Running the Application
- Running Tests
Site: EduQuest Admin Panel
API documentation: Documentation
- API Management: Provides RESTful endpoints for managing users, courses, quests, badges, and student progress.
- User Authentication: Secure authentication using JWT tokens from Azure Active Directory (Azure AD).
- Course and Quest Management: Backend logic for managing course creation, quest assignments, and tracking user participation.
- Badge Issuance System: Asynchronous badge validation and issuance system using Celery and Redis to ensure scalability.
- Integration with Wooclap: Imports quiz data and tracks student performance from Wooclap events.
- Django: A Python-based web framework used for building the backend application, managing authentication, and handling server-side operations.
- Django REST Framework (DRF): An extension of Django that provides a powerful toolkit for building Web APIs.
- PostgreSQL: A relational database used to store course, quest, user, and badge data.
- Celery: A distributed task queue for running asynchronous operations, such as badge validation and quest processing.
- Redis: Used as the message broker for Celery to handle asynchronous task execution.
- Recommended IDE: JetBrains PyCharm
- Python 3.10
- PostgreSQL
-
Clone the repository:
git clone https://github.com/xeroxis-xs/EduQuest-Backend-Django.git cd EduQuest-Backend-Django
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables: Create a
.env
file in the root directory and add the following:SECRET_KEY=your_django_secret_key ALLOWED_HOSTS=your_allowed_hosts_ip DB_NAME=postgres_sql_db_name DB_USER=postgres_sql_db_user DB_PASSWORD=postgres_sql_db_password DB_HOST=postgres_sql_db_host DB_PORT=postgres_sql_db_port AZURE_AD_CLIENT_ID=your_registered_backend_app_client_id AZURE_AD_CLIENT_SECRET=your_registered_backend_app_client_secret AZURE_ACCOUNT_NAME=your_azure_storage_account_name AZURE_ACCOUNT_KEY=your_azure_storage_account_key AZURE_STORAGE_ACCOUNT_CONNECTION_STRING=your_azure_storage_account_connection_string AZURE_CONTAINER=your_azure_storage_container DEBUG=1_for_dev_0_for_prod
-
Change Directory to the project root:
cd app
-
Apply migrations for new database:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Run the development server with Redis and Celery (Recommended):
docker-compose up -d
-
Run the development server without Redis and Celery:
python manage.py runserver
To run all unit tests, use the following command:
python manage.py test api.tests