LearnHub is a microservices-based e-learning platform built with .NET 9.0.
It provides a complete ecosystem for course creation, student enrollment, order management, and real-time notifications.
This project demonstrates:
- Distributed system design
- Clean Architecture & Domain-Driven Design (DDD)
- Event-driven communication with RabbitMQ
- API Gateway with YARP
- Polyglot persistence with PostgreSQL, SQL Server, and Redis
LearnHub enables:
- Instructors β Create and manage courses, quizzes, and assessments
- Students β Browse, purchase, and enroll in courses
- System β Manages lifecycle from browsing β enrollment β progress tracking
- β Course creation and management
- β Student registration & authentication
- β Course catalog browsing & search
- β Shopping cart & order processing
- β Course enrollment
- β Real-time notifications (SignalR)
- β Quiz and assessment management
LearnHub follows a distributed microservices architecture:
- API Gateway Layer β YARP API Gateway (Port 1000)
- Core Business Services β Independent microservices per domain
- Data Layer β Dedicated data stores (SQL Server, PostgreSQL, Redis)
- Messaging Infrastructure β RabbitMQ for async events
| Service | Container Name | Port | Database | Responsibility |
|---|---|---|---|---|
| Users.API | usersapi |
5000 | PostgreSQL (UserDb) | Authentication, user management |
| Course.API | coursesapi |
7000 | SQL Server (CourseDb) | Courses, lectures, quizzes |
| Order.API | orderapi |
8000 | SQL Server (OrderDb) | Order processing, payments |
| Cart.API | shoppingcart-api |
9000 | Redis | Shopping cart management |
| Enrollment.API | enrollmentapi |
5555 | PostgreSQL (EnrollDb) | Course enrollments |
| Notification.API | notificationapi |
6000 | PostgreSQL (NotifDb) | Real-time notifications |
- .NET 9.0 β Primary runtime
- ASP.NET Core β Web API framework
- Carter β Minimal API routing
- MediatR β CQRS & request handling
- Entity Framework Core β ORM for SQL Server
- Marten β Event store on PostgreSQL
- YARP β API Gateway
- RabbitMQ β Message broker
- PostgreSQL β User, Enrollment, Notifications
- SQL Server β Courses, Orders
- Redis β Caching & shopping cart
- Docker & Docker Compose β Containerization
- HTTP/REST β Synchronous calls
- SignalR β Real-time updates
- RabbitMQ β Event-driven async messaging
- Swagger/OpenAPI β API documentation
- Service Containers β Each microservice isolated
- Database Containers β PostgreSQL, SQL Server, Redis
- Infrastructure β RabbitMQ for async messaging
Networks:
LearnHubNetworkβ Main communication layerUserNetwork,CourseNetwork,OrderNetworkβ Service isolationNotificationNetwork,EnrollmentNetworkβ Specialized domains
- User Management β Authentication & profiles
- Educational Content β Courses, lectures, quizzes
- Commerce β Shopping cart, orders, payments
- Communication β Notifications & real-time updates
- Docker & Docker Compose
- .NET 9.0 SDK
- SQL Server & PostgreSQL clients
# Clone repo
git clone https://github.com/ahmed-ateya1/LearnHub
cd learnhub
# Build and start services
docker-compose up --buildContributions are welcome!
Please open an issue or submit a PR for improvements.
This project is licensed under the MIT License.