Design Online Shopping System like Amazon

Difficulty: Hard Source: awesome-low-level-design

Requirements

  1. Browse products, add to cart, place orders
  2. Multiple product categories with search
  3. Manage profiles, view order history, track status
  4. Inventory management
  5. Multiple payment methods
  6. Concurrent access
  7. Scalable
  8. User-friendly

Class Diagram

Class Diagram


Classes, Interfaces and Enumerations

Class/Interface Description
User Id, name, email, password, orders list
Product Id, name, description, price, quantity; update quantity, check availability
Order Id, user, order items, total, status
OrderItem Product, quantity
OrderStatus Enum: pending, processing, shipped, delivered, cancelled
ShoppingCart Add, remove, update items; map of product IDs to order items
Payment Interface; CreditCardPayment implementation
OnlineShoppingService Singleton; synchronized

Design Patterns Used

Pattern Application
Singleton OnlineShoppingService provides centralized management of users, products, and orders with synchronized access

Code Implementations

Language Source Code
Java View on GitHub
Python View on GitHub
C++ View on GitHub
C# View on GitHub
Go View on GitHub