Skip to content

Repository files navigation

🎓 LMS API (Learning Management System)

A scalable, modular, and production-ready Learning Management System (LMS) API built with FastAPI. The project follows clean architecture principles, asynchronous programming, and RESTful API best practices to support modern e-learning platforms.

🛠️ Developed by Farid Ahmed


✨ Features

  • 👤 User Authentication & Authorization (JWT)
  • 🎓 Student & Instructor Management
  • 📚 Course Management
  • 📝 Lesson & Module Management
  • 📂 File Upload Support
  • 📖 Enrollment System
  • 📊 Student Progress Tracking
  • 🧾 Quiz & Assignment APIs
  • 🏆 Certificate Management
  • 🔐 Role-Based Access Control (RBAC)
  • ⚡ FastAPI Async Support
  • 📖 Automatic Swagger API Documentation
  • 🐳 Docker Ready
  • 🗄️ Database Migration with Alembic

📂 Project Structure

.
├── app/
│   ├── api/
│   │   └── v1/
│   │       ├── endpoints/
│   │       │   ├── auth.py
│   │       │   ├── users.py
│   │       │   ├── courses.py
│   │       │   ├── lessons.py
│   │       │   ├── enrollments.py
│   │       │   ├── quizzes.py
│   │       │   └── certificates.py
│   │       └── api.py
│   │
│   ├── core/
│   │   ├── config.py
│   │   └── security.py
│   │
│   ├── crud/
│   ├── db/
│   │   ├── base.py
│   │   ├── session.py
│   │   └── init_db.py
│   │
│   ├── models/
│   ├── schemas/
│   ├── services/
│   ├── utils/
│   └── main.py
│
├── tests/
├── alembic/
├── requirements.txt
├── Dockerfile
├── .env.example
└── README.md

🏗️ Architecture

Client
   │
   ▼
FastAPI API
   │
   ▼
Authentication (JWT)
   │
   ▼
Business Services
   │
   ▼
CRUD Layer
   │
   ▼
SQLAlchemy ORM
   │
   ▼
PostgreSQL / MySQL

⚙️ Technology Stack

Backend

  • Python
  • FastAPI
  • SQLAlchemy
  • Pydantic
  • Alembic

Database

  • PostgreSQL
  • MySQL
  • SQLite

Authentication

  • JWT Authentication
  • Role-Based Access Control (RBAC)

DevOps

  • Docker
  • Nginx
  • Linux

🚀 Installation

Clone Repository

git clone <repository-url>

cd lms-api

Create Virtual Environment

python -m venv venv

Windows

venv\Scripts\activate

Linux / macOS

source venv/bin/activate

Install Dependencies

pip install -r requirements.txt

⚙️ Environment Variables

Create a .env file.

DATABASE_URL=postgresql://username:password@localhost/lms_db

SECRET_KEY=your_secret_key

ACCESS_TOKEN_EXPIRE_MINUTES=30

▶️ Run Development Server

uvicorn app.main:app --reload

Application:

http://localhost:8000

Swagger Documentation:

http://localhost:8000/docs

ReDoc:

http://localhost:8000/redoc

📚 Core Modules

  • Authentication
  • Users
  • Students
  • Instructors
  • Courses
  • Categories
  • Lessons
  • Modules
  • Enrollments
  • Quizzes
  • Assignments
  • Certificates
  • Progress Tracking
  • Notifications

📌 API Endpoints

Module Endpoint
Authentication /api/v1/auth
Users /api/v1/users
Courses /api/v1/courses
Lessons /api/v1/lessons
Enrollments /api/v1/enrollments
Quizzes /api/v1/quizzes
Certificates /api/v1/certificates

🧪 Testing

pytest

🐳 Docker

Build:

docker build -t lms-api .

Run:

docker run -p 8000:8000 lms-api

🚀 Future Improvements

  • Payment Gateway Integration
  • Live Classes
  • Video Streaming
  • Discussion Forum
  • AI Learning Assistant
  • Email Notifications
  • Mobile API
  • Analytics Dashboard

👨‍💻 Author

Farid Ahmed

Software Engineer

Connect


📄 License

Licensed under the MIT License.

About

A production-ready FastAPI template for building scalable, secure, and maintainable enterprise-grade backend applications.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages