CongoCart is a microservices-based e-commerce platform built with .NET 10. The project demonstrates a distributed architecture with multiple independent services, an API Gateway, and asynchronous communication via a message bus.
- CongoCart.Web: The frontend web application (ASP.NET Core MVC).
- CongoCart.GatewaySolution: API Gateway using Ocelot to route requests to backend services.
- CongoCart.Services.AuthAPI: Handles user authentication, registration, and JWT token issuance.
- CongoCart.Services.CouponAPI: Manages discount coupons.
- CongoCart.Services.ProductAPI: Manages product catalog and images.
- CongoCart.Services.ShoppingCartAPI: Handles shopping cart operations.
- CongoCart.Services.OrderAPI: Manages order placement and processing.
- CongoCart.Services.EmailAPI: Consumes messages from the service bus to send emails.
- CongoCart.Services.RewardAPI: Manages rewards and loyalty points.
- CongoCart.MessageBus: A shared library for message bus communication.
- Language: C# 14.0
- Framework: .NET 10.0 (ASP.NET Core)
- API Gateway: Ocelot
- Database: SQL Server (LocalDB)
- ORM: Entity Framework Core
- Messaging: Azure Service Bus
- Authentication: JWT Bearer, ASP.NET Core Identity
- Other: AutoMapper, Newtonsoft.Json, Swashbuckle (Swagger)
- .NET 10 SDK
- SQL Server (or LocalDB)
- Azure Service Bus (or a compatible message broker for development)
git clone <repository-url>
cd CongoCartEach service has an appsettings.json file. Ensure you update the following:
- ConnectionStrings: Update
DefaultConnectionto point to your SQL Server instance. - ServiceBusConnectionString: Provide your Azure Service Bus connection string in
CongoCart.Services.EmailAPI,CongoCart.Services.OrderAPI, etc. - JwtOptions: Update the
SecretinAuthAPIandGatewaySolution.
For services using a database (Auth, Coupon, Product, Order, ShoppingCart, Email, Reward), run the following command in their respective directories:
dotnet ef database updateYou can run all projects using your IDE (like JetBrains Rider or Visual Studio) or via terminal.
To run the Web frontend:
cd CongoCart.Web
dotnet runTo run the Gateway:
cd CongoCart.GatewaySolution
dotnet runTo run a specific service:
cd CongoCart.Services.AuthAPI
dotnet runNote: For the full system to work, all services, the gateway, and the web app must be running.
dotnet restore: Restore dependencies.dotnet build: Build the solution.dotnet ef migrations add <Name>: Add a new EF migration.dotnet ef database update: Update the database to the latest migration.
While the project primarily uses appsettings.json, you can override settings using environment variables:
ConnectionStrings__DefaultConnectionApiSettings__JwtOptions__SecretServiceBusConnectionString
TODO: Add unit and integration tests. No test projects currently exist in the solution.
TODO: Add license information.