Development of an ECommerce in an environment with microservices architecture in .NET 5.0
Implementation of an ECommerce using a complex microservices architecture with several popular and main technologies of the Microsoft network (stack .NET 5.0).
Key architectural references:
- Introducing eShopOnContainers reference app
- .NET Microservices: Architecture for Containerized .NET Applications
Implementations being carried out and planned:
- Ocelot API Gateway (BFF) and Agreggator
💡 SOLID, Clean Architecture, Domain Driven Design (DDD), Clean Code, Repository Pattern, logging, validation, exception handling, Swagger Open API and other standards/features were widely used for the design of projects.
- ASP.NET Core Web API application
- REST API (CRUD operations)
- MongoDB database connection and containerization
- Repository Pattern Implementation
- ASP.NET Core Web API application
- REST API (CRUD operations)
- Redis database connection and containerization
- Consume Discount Grpc Service for inter-service sync communication to calculate product final price
- Repository Pattern Implementation
- Publish BasketCheckout Queue with using MassTransit and RabbitMQ
- ASP.NET Grpc Server application
- Build a Highly Performant inter-service gRPC Communication with Basket Microservice
- Exposing Grpc Services with creating Protobuf messages
- Using Dapper for micro-orm implementation to simplify data access and ensure high performance
- PostgreSQL database connection and containerization
- Application of retry policy for database migration
- ASP.NET Core Web API application
- Developing CQRS with using MediatR, FluentValidation and AutoMapper packages
- Consuming RabbitMQ BasketCheckout event queue with using MassTransit-RabbitMQ Configuration
- SqlServer database connection and containerization
- Using Entity Framework Core ORM and auto migrate to SqlServer when application startup
- Containerization of microservices
- Containerization of databases
- YML files configuration
- Use Portainer to manage docker containers
- Implement API Gateways with Ocelot
- Sample microservices/containers to reroute through the API Gateways
- Run multiple different API Gateway/BFF container types
- The Gateway aggregation pattern in Shopping.Aggregator
- At the root directory which include docker-compose.yml files, run below command to inicialize docker microservices containers:
docker-compose -f .\docker-compose.yml -f.\docker-compose.override.yml up -d --build
Wait for docker compose all microservices, some microservices need extra time to work
It is also possible to launch the project in visual studio by running (F5) when pointing to the docker-compose startup project
- Microservices urls:
-
Catalog API -> http://localhost:8000/swagger/index.html
-
Basket API -> http://localhost:8001/swagger/index.html
-
Discount API -> http://localhost:8002/swagger/index.html
-
Ordering API -> http://localhost:8004/swagger/index.html
-
Shopping.Aggregator -> http://localhost:8005/swagger/index.html
-
API Gateway -> http://localhost:8010/Catalog
-
Rabbit Management Dashboard -> http://localhost:15672 -- guest/guest
-
Portainer -> http://localhost:9000 - User: admin/admin1234
-
pgAdmin PostgreSQL -> http://localhost:5050 - admin@postgres.com/admin1234