Skip to content

Fully-featured E-Learning Platform API with JWT authentication, course & exam management, video streaming, notifications, with clean architecture.

Notifications You must be signed in to change notification settings

Abdelrahman-Zagloul/E-Learning-Platform

Repository files navigation

🎓 E-Learning Platform API

.NET 8 LinkedIn

A modular and scalable E-Learning Platform API built with ASP.NET Core following Clean Architecture principles.
This project provides a complete backend solution for managing users, courses, videos, exams, notifications, and authentication.
It implements Repository Pattern, Unit of Work, and Result Pattern to ensure clean separation of concerns, maintainability, and testability.


🚀 Key Features

  • Clean Architecture (API, Application, Domain, Infrastructure, Shared)
  • Repository Pattern & Unit of Work
  • Result Pattern for standardized responses
  • Background jobs with Hangfire
  • FluentValidation for request validation
  • AutoMapper for DTO mapping
  • Custom middleware for global error handling
  • Options pattern for configuration
  • File uploads (images, videos)

🔐 Authentication & Account Management

  • JWT authentication with refresh tokens
  • Role-based access (Admin, Teacher, Student)
  • Two-Factor Authentication (2FA)
  • External login (Google)
  • User registration (Teacher / Student)
  • Login / Logout / Revoke tokens
  • Email confirmation
  • Forgot & reset password

📚 Courses

  • Full CRUD operations
  • Fuzzy search & pagination
  • Ratings & comments
  • Specialization filters & top-rated courses

📝 Exams

  • CRUD operations per course
  • Supports MCQ & True/False questions
  • Exam submission & result evaluation

🎥 Videos

  • Upload, update, delete, and download
  • Pagination, search, and trending videos
  • Likes, dislikes, and comments

🔔 Notifications

  • Send Email (SMTP)
  • Send SMS (Twilio)

👥 User Management

  • Manage profiles & profile pictures
  • Role assignment (add/remove)
  • Lock/unlock users
  • Separate endpoints for Teachers & Students

📦 Tech Stack

  • ASP.NET Core 8 – Web API framework
  • Entity Framework Core – ORM for database access
  • SQL Server – Relational database
  • Identity + JWT – Authentication & Authorization
  • Hangfire – Background jobs & scheduling
  • FluentValidation – Request validation
  • AutoMapper – Object mapping
  • Twilio – SMS notifications
  • SMTP – Email notifications
  • Swagger / OpenAPI – API documentation

📌 API Endpoints

# 🔐 Account
POST   /api/Account/register-teacher
POST   /api/Account/register-student
POST   /api/Account/login
POST   /api/Account/refresh-token
POST   /api/Account/revoke-token
POST   /api/Account/logout
POST   /api/Account/change-password
GET    /api/Account/confirm-email
POST   /api/Account/resend-confirm-email
POST   /api/Account/forgot-password
POST   /api/Account/reset-password
POST   /api/Account/google-login
POST   /api/Account/2fa-enable
POST   /api/Account/2fa-disable
POST   /api/Account/2fa/send-code
POST   /api/Account/2fa-verify

# 📚 Courses
GET    /api/Courses
POST   /api/Courses
GET    /api/Courses/{id}
PUT    /api/Courses/{id}
PATCH  /api/Courses/{id}
DELETE /api/Courses/{id}
GET    /api/Courses/{courseName}
GET    /api/Courses/specialization:{specialization}
GET    /api/Courses/CoursesPagination
GET    /api/Courses/TopRated
POST   /api/Courses/{id}/Rate
POST   /api/Courses/{id}/Comment
GET    /api/Courses/{id}/Comments

# 📝 Exams
GET    /api/courses/{courseId}/Exams
POST   /api/courses/{courseId}/Exams
GET    /api/courses/{courseId}/Exams/{examId}
PUT    /api/courses/{courseId}/Exams/{examId}
PATCH  /api/courses/{courseId}/Exams/{examId}
DELETE /api/courses/{courseId}/Exams/{examId}
POST   /api/courses/{courseId}/Exams/{examId}/Submit
GET    /api/courses/{courseId}/Exams/{examId}/Result

# ❓ Questions
GET    /api/Exam/{examId}/Questions/{questionNumber}
DELETE /api/Exam/{examId}/Questions/{questionNumber}
PUT    /api/Exam/{examId}/Questions/{questionNumber}
GET    /api/Exam/{examId}/Questions
GET    /api/Exam/{examId}/Questions/Pagination
POST   /api/Exam/{examId}/Questions/MCQ_Question
POST   /api/Exam/{examId}/Questions/TF_Question

# 🔔 Notification
POST   /api/Notification/send-sms
POST   /api/Notification/send-email

# 👥 Users
GET    /api/Users/{id}
GET    /api/Users
GET    /api/Users/Profile
PUT    /api/Users/Profile
GET    /api/Users/Teachers
GET    /api/Users/Students
PATCH  /api/Users/Profile/Picture
POST   /api/Users/add-role
DELETE /api/Users/remove-role
PATCH  /api/Users/{id}/lock
PATCH  /api/Users/{id}/unlock

# 🎥 Videos
POST   /api/Courses/{courseId}/Videos
GET    /api/Courses/{courseId}/Videos
PUT    /api/Courses/{courseId}/Videos/{videoId}
PATCH  /api/Courses/{courseId}/Videos/{videoId}
DELETE /api/Courses/{courseId}/Videos/{videoId}
GET    /api/Courses/{courseId}/Videos/{videoId}
GET    /api/Courses/{courseId}/Videos/VideosPagination
GET    /api/Courses/{courseId}/Videos/{videoId}/download
GET    /api/Courses/{courseId}/Videos/Search
POST   /api/Courses/{courseId}/Videos/{videoId}/Comment
POST   /api/Courses/{courseId}/Videos/{videoId}/Like
POST   /api/Courses/{courseId}/Videos/{videoId}/Dislike
GET    /api/Courses/{courseId}/Videos/{videoId}/Comments
GET    /api/Courses/{courseId}/Videos/Trending

🛠️ Setup Instructions

  1. Clone the repository

    git clone https://github.com/Abdelrahman-Zagloul/E-Learning-Platform.git
  2. Add your appsettings.json (not included in repo) with OAuth credentials:

    {
    "ConnectionStrings": {
     "DefaultConnection": "YourDatabaseConnectionString"
     }
      "MailSetting": {
        "Email": "Your Email",
        "DisplayName": "Your Name",
        "Password": "Your Password",
        "Host": "smtp.gmail.com",
        "Port": 587
      },
    "JWT": {
       "Key": "Your Key",
       "Issuer": "https://localhost:7250/",
       "Audience": "https://localhost:4200/",
       "DurationInMinutes": 60
     },
     "Twilio": {
        "AccountSID": "Your AccountSID",
        "AuthToken": "Your AuthToken",
        "TwilioPhoneNumber": "+Your TwilioPhoneNumber"
      }
    }
  3. Apply Migrations:

    dotnet ef database update
  4. Run the project:

    dotnet run

👨‍💻 Author

Abdelrahman Zaglol
.NET Developer | Computer Science Student


About

Fully-featured E-Learning Platform API with JWT authentication, course & exam management, video streaming, notifications, with clean architecture.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published