This project is a Udemy-like platform built using a microservices architecture. The system is designed with Clean Architecture principles to ensure scalability, modularity, and maintainability. Additionally, extensive testing has been implemented, including unit tests and integration tests using Testcontainers.
- REST for External API Endpoints:
- RESTful APIs are exposed via controllers to provide easy access for external clients (e.g., frontend, mobile apps).
- Clean Architecture:
- Each service is built using Clean Architecture principles to separate concerns and keep business logic independent of frameworks and external dependencies.
- Manages user registration, login, and role-based access control.
- REST Controllers: User registration, login.
- Handles course creation, updates, and listings.
- REST Controllers: Course search, filter, and view.
- Manages video uploads, storage, and playback.
- REST Controllers: Upload videos, get playback links.
- Handles course purchases and payment processing.
- REST Controllers: Initiate payments, view purchase history.
- Sends emails and real-time notifications.
- REST Controllers: Manage notification settings.
- Provides analytics and insights.
- REST Controllers: View reports and statistics.
- Routes external REST requests to respective services.
- Handles load balancing and authentication.
- Purpose: Provides a client-friendly interface for external applications such as the frontend or mobile apps.
- Example:
- A REST API endpoint in the User Management Service allows new users to register.
- Each layer of the application (domain, application, infrastructure) includes unit tests to ensure code correctness.
- Mocks and fakes are used to isolate dependencies.
- Integration tests are implemented using Testcontainers to spin up real instances of dependent services (e.g., databases, message brokers) in isolated Docker containers.
- Example: Testing the Order Service with a live PostgreSQL container to validate data persistence and integrity.
- Unit Tests: xUnit, Moq
- Integration Tests: Testcontainers, Docker
- Code Coverage: Coverlet, ReportGenerator
- Backend: ASP.NET Core (.NET 8)
- Architecture: Clean Architecture
- Communication: gRPC (for internal), REST (for external)
- Database: PostgreSQL, MongoDB (for specific use cases), Redis (for caching), Elasticsearch (for search), InfluxDB (for metrics), ClickHouse (for analytics), RabbitMQ (for messaging), Amazon S3 (for file storage), Prometheus (for monitoring), Grafana (for visualization), Kibana (for logging), Consul (for service discovery), Vault (for secrets management)
- Message Broker: RabbitMQ (for async notifications)
- Containerization: Docker
- Orchestration: Docker-Compose
- Testing: xUnit, Moq, Testcontainers
-
Clone the Repository:
$ git clone https://github.com/your-repo/udemy-clone.git $ cd udemy-clone
-
Build and Run Services:
$ docker-compose up --build
-
Access the API Gateway:
- API Gateway: http://localhost:3000