How adelmuhammad-23/e-learning-platform works
Project Type & Purpose
• This is a full-stack web application (“Online Learning Platform”) built with:
– Backend: ASP.NET Core Web API (Clean Architecture)
– Frontend: Angular (separate repo)
– Database: SQL Server
– External services: PayPal, SMTP/email, Cloudinary (for file uploads)
• Purpose: Provide user authentication (students/instructors/admins), course management, quizzes, payments, reviews, notifications.
File Structure (Clean Architecture Layers)
• Presentation/API Layer:
– e-learning.API (ASP.NET Core controllers, Program.cs, appsettings, wwwroot uploads)
• Core/Application Layer:
– e-learning.Core (Use-cases, CQRS commands & queries, validation behaviors, mapping profiles, middleware)
• Service Layer:
– e-learning.Services (service interfaces + implementations for business processes like payments, email, course logic)
• Data/Domain Layer:
– e-learning.Data (Entities, DTOs, Enums, Helpers)
• Infrastructure Layer:
– e-learning.infrastructure (EF Core DbContext, Repositories, Migrations, Seeder, ServiceRegistration)
• Testing Layer:
– e-learning.Services.Tests (unit tests covering service logic)
README Insights
• Confirms Clean Architecture structure: “API, Core, Data, Infrastructure, Service, Testing.”
• Lists key features (authentication, payments, file uploads, notifications).
• Mentions Docker Compose and deployment targets (Azure, AWS, IIS, Docker).
Main Components & Their Interactions
a. Frontend (Angular):
– HTTP(S) calls → Backend API
b. Backend API (ASP.NET Core Web API):
– Controllers (AuthController, CoursesController, etc.)
– Uses MediatR/CQRS to dispatch Commands & Queries into Core
c. Core/Application:
– ValidationBehavior (pipeline), Handlers for Commands/Queries, Mapping profiles
– Emits domain models, returns standardized Responses
d. Service Layer:
– Implements IEmailServices, IPayPalService, ICourseServices, etc.
– Contains business workflows (e.g., purchase flow: charge via PayPal → send confirmation email)
e. Infrastructure:
– EF Core DbContext → SQL Server
– Repositories (implement data access interfaces)
– Migrations manage schema
– Seeder pre-populates roles/users
f. Database:
– SQL Server instance (tables: Users, Courses, Enrollments, Quizzes, Reviews, Payments, Notifications, OTPRequests)
g. External Services:
– PayPal Gateway
– SMTP/Email provider
– Cloudinary (or local Blob storage via wwwroot/uploads)
h. Container Orchestration:
– docker-compose.yml defines API container + SQL Server + other supporting services
Architectural Patterns & Principles
• Clean Architecture (layers depend inward)
• CQRS + Mediator Pattern (Commands vs. Queries)
• Repository Pattern & Unit of Work via EF Core
• Dependency Injection across layers (ServiceRegistration in Infrastructure & CoreDependencies in Core)
• Middleware (ErrorHandlerMiddleware) for cross-cutting concerns
• Role-Based Access Control via ASP.NET Core Identity