This project provides a complete backend foundation for building an e-commerce platform. It is designed to help teams quickly bootstrap a production-ready system while also serving as a deep exploration of backend engineering and system design concepts.
With this foundation in place, an e-commerce backend can be set up and extended rapidly for real-world use cases.
- API Gateway with per-user rate limiting
- User authentication and authorization
- Seller and Admin role-based access
- Product catalog management
- Cart management
- Checkout flow
- Order management
- Asynchronous notification handling
-
Backend: .NET 9 / C#
-
Database: PostgreSQL
-
Authentication: JWT
-
Caching: Redis
-
Messaging:
- Redis Pub/Sub
- RabbitMQ
-
Resilience: Polly
-
Notifications: SMTP
-
Build: .NET CLI
Modular Monolith
The system is implemented as a modular monolith to keep the initial setup simple while maintaining clear domain boundaries. This approach avoids the operational overhead of microservices for a smaller user base, while still enabling future scalability.
Each module is designed with well-defined boundaries and communicates only through interfaces, making it straightforward to extract individual modules into independent microservices if scaling requirements increase.
- Users
- Products
- Orders
- Notifications
- Synchronous (In-Process): Used for atomic transactional flows such as order placement and payment processing.
- Asynchronous: Used for inventory processing, notifications, cancellations, and other non-blocking workflows.
- Used for caching frequently accessed data
- Used as a lightweight pub/sub mechanism for internal event propagation
- Used for reliable asynchronous workflows
- Order placed and order cancelled events are published to RabbitMQ
- Payment and notification services consume these events to trigger refunds and user notifications
- Applied to external service interactions only
- Used for retry handling during refund failures and notification delivery failures
- Not used for database retries
- A single JWT-based authentication system is used
- Authorization is enforced through fine-grained role-based access control
Roles:
- Admin: Full system access
- Seller: Can manage and sell products
- User: Can browse products, place orders, and manage carts
- Rate limiting is applied on a per-user basis to prevent abuse
- .NET 9
- PostgreSQL
- Redis
- RabbitMQ
-
Set up PostgreSQL using the provided SQL scripts
-
Configure the following values:
- PostgreSQL credentials
- JWT secret key
- SMTP configuration
- RabbitMQ configuration
- Redis configuration
-
Run the application using the .NET CLI
-
Use Postman or Insomnia to interact with the APIs via
localhost
Phase 1 focuses on building the complete backend foundation required for an e-commerce platform, with an emphasis on core transactional and domain workflows.
- Shipment and tracking services (to keep focus on core commerce flows)
- Product image storage and management
- User profile editing
These features can be layered on top of the existing foundation without architectural changes.
- Shipment and tracking services
- Product image management
- User profile management
- Advanced reporting and analytics
This project is intended to demonstrate a production-ready, highly scalable e-commerce backend using .NET and a modular monolith architecture.
