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 --build
Contributions are welcome!
Please open an issue or submit a PR for improvements.
This project is licensed under the MIT License.