A robust, scalable, and fully functional E-Commerce platform designed specifically for a flower and gift shop. This system is built using a modern Microservices Architecture with .NET Core, Docker, and various message brokers and databases to ensure high availability, fault tolerance, and loose coupling.
The project is structured as a collection of independent, specialized microservices that communicate with each other asynchronously via message queues or synchronously via gRPC/HTTP.
- Backend Framework: .NET Core / ASP.NET Core
- API Gateway: Ocelot (or similar .NET API Gateway)
- Database: Microsoft SQL Server (2022)
- Message Broker: RabbitMQ (for asynchronous event-driven communication)
- Caching: Redis (for distributed caching and session management)
- Containerization: Docker & Docker Compose
- Synchronous Communication: gRPC (e.g., Ordering Service to Catalog Service)
- Payment Gateway: Stripe Integration
The platform consists of 10 primary microservices, each with its own dedicated database and responsibility:
- API Gateway (Port 8888): The single entry point for all client requests. It routes HTTP requests to the appropriate backend microservices, handles cross-cutting concerns (like authentication routing), and aggregating responses if necessary.
- Auth Service (Port 8082): Manages user identity, registration, authentication (JWT), profile updates, and password resets via OTP.
- Catalog Service (Port 8084): Handles the product catalog, including managing products, categories, occasions, inventory tracking, reviews, promotional banners, coupons, offers, and a loyalty points system.
- Cart Service (Port 8086): Manages user shopping carts, adding/removing items, and preparing the cart for checkout.
- Ordering Service (Port 8088): Manages the entire lifecycle of an order. Handles order creation, status tracking, re-ordering functionality, user addresses, and delivery shipment tracking.
- Payment Service (Port 8090): Integrates with external payment providers (e.g., Stripe) to process payments securely and manage payment intents and statuses.
- Delivery Service (Port 8092): Handles dispatching, shipment tracking, and driver location updates.
- Promotion Service (Port 8094): Handles complex promotional rules, discounts, and marketing campaigns (often overlaps or interacts closely with the Catalog service's coupon/offer systems).
- Notification Service (Port 8096): Listens to events from RabbitMQ and sends notifications (emails, SMS, or in-app) to users regarding order updates, OTPs, or promotions.
- Audit Service (Port 8098): Tracks system-wide events and logs for compliance, security monitoring, and debugging.
- Comprehensive User Authentication: Secure registration, login, profile management, and OTP-based password recovery.
- Rich Product Catalog: Browse products by categories or occasions, view best sellers, and search functionality. Includes inventory management.
- Shopping Cart & Checkout: Seamless cart management with session persistence and a streamlined checkout process.
- Order Management: Track order statuses in real-time, view order history, and one-click re-ordering.
- Delivery Tracking: Real-time shipment tracking and driver location updates.
- Promotions & Loyalty: Robust coupon application, special offers, promotional banners, and a comprehensive loyalty points system (earning and redeeming points).
- Secure Payments: Integration with Stripe for secure and reliable payment processing.
- Event-Driven Asynchronous Communication: Services are decoupled using RabbitMQ. For example, when an order is placed, an event is published for the Payment, Inventory, and Notification services to react independently.
The entire infrastructure and all microservices can be spun up easily using Docker Compose.
- Docker Desktop installed and running.
- .NET SDK (if you plan to build or run services outside of Docker).
-
Clone the repository.
-
Navigate to the root directory containing the
docker-compose.ymlfile. -
Run the following command to build and start all containers in detached mode:
docker-compose up -d --build
-
Docker Compose will provision the following infrastructure containers first:
flower_sql_server(SQL Server on port 1433)flower_rabbitmq(RabbitMQ on ports 5672, 15672)flower_redis(Redis on port 6379)
-
Once the infrastructure is healthy, the microservices will start automatically.
- API Gateway:
http://localhost:8888(All API requests should be routed through here). - RabbitMQ Management UI:
http://localhost:15672(Username:guest, Password:guest).
A comprehensive list of API endpoints routed through the API Gateway is available in the api_documentation.md file. This document details the HTTP methods, full gateway URLs, endpoint descriptions, and required payloads for all major services (Auth, Catalog, Ordering, Payment, Notification).
The SQL Server container (flower_sql_server) starts with a predefined SA password (MyComplexP@ssw0rd2025). Each microservice uses Entity Framework Core to automatically apply migrations and create its respective database (e.g., GiftShop_IdentityDB, GiftShop_CatalogDB, etc.) upon startup.