Skip to content

Elementttto/ECommerce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E-Commerce Platform

Overview

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.


Features

  • 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

Tech Stack

  • Backend: .NET 9 / C#

  • Database: PostgreSQL

  • Authentication: JWT

  • Caching: Redis

  • Messaging:

    • Redis Pub/Sub
    • RabbitMQ
  • Resilience: Polly

  • Notifications: SMTP

  • Build: .NET CLI


Architecture

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.

Core Modules

  • Users
  • Products
  • Orders
  • Notifications

Communication Model

  • 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.

E-Commerce Architecture

Infrastructure & Tooling Decisions

Redis

  • Used for caching frequently accessed data
  • Used as a lightweight pub/sub mechanism for internal event propagation

RabbitMQ

  • 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

Polly

  • Applied to external service interactions only
  • Used for retry handling during refund failures and notification delivery failures
  • Not used for database retries

Security & Authentication

Authentication Model

  • 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

API Gateway

  • Rate limiting is applied on a per-user basis to prevent abuse

Setup & Run

Prerequisites

  • .NET 9
  • PostgreSQL
  • Redis
  • RabbitMQ

Steps

  1. Set up PostgreSQL using the provided SQL scripts

  2. Configure the following values:

    • PostgreSQL credentials
    • JWT secret key
    • SMTP configuration
    • RabbitMQ configuration
    • Redis configuration
  3. Run the application using the .NET CLI

  4. Use Postman or Insomnia to interact with the APIs via localhost


Phase 1 Scope

Phase 1 focuses on building the complete backend foundation required for an e-commerce platform, with an emphasis on core transactional and domain workflows.

Intentionally Excluded

  • 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.


Future Work

  • Shipment and tracking services
  • Product image management
  • User profile management
  • Advanced reporting and analytics

Project Intent

This project is intended to demonstrate a production-ready, highly scalable e-commerce backend using .NET and a modular monolith architecture.

About

A Private Ecommerce project implementing foundation for an ecommerce platform

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages