Skip to content

Backend Django Application server to handle API requests from the EduQuest Frontend Application

Notifications You must be signed in to change notification settings

xeroxis-xs/EduQuest-Backend-Django

Repository files navigation

EduQuest Backend Application (Django)

CI

Introduction

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.

Table of Contents

Architecture Overview

Backend Architecture Diagram

Demo

Admin Panel

Site: EduQuest Admin Panel img.png

API Documentation

API documentation: Documentation img_1.png

Key Features:

  • 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.

Technologies Used:

  • 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.

Prerequisites

  • Recommended IDE: JetBrains PyCharm
  • Python 3.10
  • PostgreSQL

Installation

  1. Clone the repository:

    git clone https://github.com/xeroxis-xs/EduQuest-Backend-Django.git
    cd EduQuest-Backend-Django
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. 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
  5. Change Directory to the project root:

    cd app
  6. Apply migrations for new database:

    python manage.py migrate
  7. Create a superuser:

    python manage.py createsuperuser

Running the Application

  1. Run the development server with Redis and Celery (Recommended):

    docker-compose up -d
  2. Run the development server without Redis and Celery:

    python manage.py runserver

Running Tests

To run all unit tests, use the following command:

python manage.py test api.tests

About

Backend Django Application server to handle API requests from the EduQuest Frontend Application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published