Giter Club home page Giter Club logo

lms's Introduction

Learning Management System (LMS)

This project is a Learning Management System (LMS) built with Django and Docker, utilizing PostgreSQL as the database and Adminer for database management.

Features

  • User authentication and authorization
  • Course creation and management
  • Module and lesson management
  • Student enrollments
  • Certificate generation upon course completion
  • RESTful API endpoints
  • Dockerized setup for easy deployment

Prerequisites

  • Docker
  • Docker Compose
  • Python 3.12 (if running without Docker)
  • PostgreSQL (if running without Docker)

Getting Started

Clone the Repository

git clone https://github.com/Maansy/LMS.git
cd LMS

Environment Variables

Create a .env file in the root directory and add the following environment variables:

DB_NAME=lms
DB_USER=lmsuser
DB_PASS=lmspassword
DB_HOST=db
SECRET_KEY=your_django_secret_key
DEBUG=True

Running with Docker

Docker Setup

Build and start the Docker containers:

docker-compose build
docker-compose up

This will set up the Django application, PostgreSQL database, and Adminer, and will run the necessary migrations and commands.

Access the Application

  • Django App: http://localhost:8000
  • Adminer: http://localhost:8080

Adminer Login

Use the following credentials to log into Adminer:

  • System: PostgreSQL
  • Server: db
  • Username: lmsuser
  • Password: lmspassword
  • Database: lms

Running Management Commands

To run Django management commands inside the Docker container:

docker-compose run web python manage.py <command>

Useful Commands

  • Migrations: docker-compose run web python manage.py makemigrations
  • Apply Migrations: docker-compose run web python manage.py migrate
  • Create Superuser: docker-compose run web python manage.py createsuperuser
  • Run Tests: docker-compose run web python manage.py test

Running without Docker

Setup PostgreSQL Database

Ensure PostgreSQL is installed and running. Create a database and user:

sudo -u postgres psql

Within the PostgreSQL shell:

CREATE DATABASE lms;
CREATE USER lmsuser WITH PASSWORD 'lmspassword';
GRANT ALL PRIVILEGES ON DATABASE lms TO lmsuser;

Install Dependencies

Create a virtual environment and install dependencies:

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Apply Migrations

Apply the database migrations:

python manage.py makemigrations
python manage.py migrate

Create Groups and Permissions

Run the custom management command to create groups and assign permissions:

python manage.py create_group

Start the Server

Start the Django development server:

python manage.py runserver

Access the Application

  • Django App: http://localhost:8000

API Endpoints

Authentication

  • Register: POST /api/register/
  • Login: POST /api/token/
  • Profile: GET /api/profile/

Courses

  • List/Create Courses: GET/POST /api/courses/
  • Course Detail: GET/PUT/DELETE /api/courses/{course_id}/
  • List/Create Modules: GET/POST /api/courses/{course_id}/modules/
  • Module Detail: GET/PUT/DELETE /api/courses/{course_id}/modules/{module_id}/
  • List/Create Lessons: GET/POST /api/courses/{course_id}/modules/{module_id}/lessons/
  • Lesson Detail: GET/PUT/DELETE /api/courses/{course_id}/modules/{module_id}/lessons/{lesson_id}/

Enrollments

  • List/Create Enrollments: GET/POST /api/enrollments/

Certificates

  • List Certificates: GET /api/certificates/
  • Generate Certificate: POST /api/certificates/generate/{course_id}/

Contributing

If you would like to contribute to this project, please follow these steps:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin feature/your-feature)
  5. Create a new Pull Request

Acknowledgments

  • Django REST framework for providing the tools to build the API
  • Docker for containerization
  • ReportLab for generating PDF certificates
  • Adminer for database management

lms's People

Contributors

maansy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.