A modern, cloud-native e-commerce platform built with microservices architecture, demonstrating best practices in distributed systems design.
- Overview
- Architecture
- Features
- Tech Stack
- Prerequisites
- Getting Started
- Project Structure
- Development
- API Documentation
- Contributing
- License
GigaShop is a full-featured e-commerce platform built using microservices architecture. It demonstrates modern software development practices including:
- Microservices Architecture: Independent, scalable services
- Event-Driven Communication: Using RabbitMQ for async messaging
- API Gateway Pattern: YARP-based gateway for unified API access
- CQRS & Clean Architecture: Separation of concerns and maintainable code
- Containerization: Docker-based deployment
- Modern Frontend: React with TypeScript and shadcn/ui components
The application consists of the following microservices:
βββββββββββββββ β Web UI β (React + Vite + TypeScript) ββββββββ¬βββββββ β ββββββββΌβββββββββββββββ β YARP API Gateway β ββββββββ¬βββββββββββββββ β βββββββββββββββ¬ββββββββββββββ¬ββββββββββββββ β β β β ββββββββΌβββββββ βββββΌβββββ ββββββββΌβββββββ βββββΌβββββββββ β Catalog β β Basket β β Order β β Discount β β Service β β Serviceβ β Service β β Service β β (PostgreSQL)β β(Redis) β β(SQL Server) β β (gRPC) β βββββββββββββββ ββββββββββ βββββββββββββββ ββββββββββββββ β β β βββββββββββββββ΄ββββββββββββββ β ββββββββΌβββββββ β RabbitMQ β β(Message Bus)β βββββββββββββββ - Catalog Service: Product catalog management with PostgreSQL
- Basket Service: Shopping cart with Redis cache
- Order Service: Order processing with SQL Server (CQRS pattern)
- Discount Service: Discount calculations via gRPC
- API Gateway: YARP reverse proxy for routing and aggregation
- Web UI: React-based customer-facing application
- ποΈ Product browsing and search
- π Shopping cart management
- π³ Order processing and tracking
- π« Discount and coupon system
- π Real-time inventory updates
- π± Responsive web interface
- π Secure API gateway
- π Event-driven architecture
- π³ Containerized deployment
- .NET 8: Latest LTS version of .NET
- ASP.NET Core: Web API framework
- Entity Framework Core: ORM for data access
- MediatR: CQRS and mediator pattern
- Carter: Minimal API endpoints
- Mapster: Object mapping
- FluentValidation: Input validation
- YARP: Reverse proxy and API gateway
- gRPC: High-performance RPC framework
- React 18: UI library
- TypeScript: Type-safe JavaScript
- Vite: Build tool and dev server
- TailwindCSS: Utility-first CSS
- shadcn/ui: Component library
- React Router: Client-side routing
- TanStack Query: Data fetching and caching
- React Hook Form: Form management
- Zod: Schema validation
- Docker & Docker Compose: Containerization
- PostgreSQL: Catalog and Basket databases
- SQL Server: Order database
- Redis: Distributed cache
- RabbitMQ: Message broker
Before you begin, ensure you have the following installed:
-
Docker Desktop (v20.10 or higher)
-
.NET 8 SDK (for local development)
-
Node.js 18+ (for frontend development)
-
Git
# Check Docker docker --version docker compose version # Check .NET dotnet --version # Check Node.js node --version npm --versiongit clone https://github.com/Lukada-taiya/gigashop.git cd gigashopThe easiest way to run the entire application:
cd src docker compose up -dThis will start all services:
- Web UI: http://localhost:6005
- API Gateway: http://localhost:6004
- Catalog API: http://localhost:6000
- Basket API: http://localhost:6001
- Order API: http://localhost:6003
- Discount gRPC: http://localhost:6002
- RabbitMQ Management: http://localhost:15672 (guest/guest)
# Check all containers are up docker compose ps # View logs docker compose logs -f # View specific service logs docker compose logs -f catalog.api# Stop all services docker compose down # Stop and remove volumes (clean slate) docker compose down -vgigashop/ βββ src/ β βββ ApiGateways/ β β βββ YarpApiGateway/ # API Gateway service β βββ BuildingBlocks/ β β βββ BuildingBlocks/ # Shared libraries β β βββ BuildingBlocks.Messaging/ # Messaging abstractions β βββ Services/ β β βββ Basket/ β β β βββ Basket.API/ # Basket microservice β β βββ Catalog/ β β β βββ Catalog.API/ # Catalog microservice β β βββ Discount/ β β β βββ Discount.Grpc/ # Discount gRPC service β β βββ Order/ β β βββ Order.API/ # Order API β β βββ Order.Application/ # Business logic β β βββ Order.Domain/ # Domain models β β βββ Order.Infrastructure/ # Data access β βββ Web/ # React frontend β βββ compose.yaml # Docker Compose base β βββ compose.override.yaml # Docker Compose overrides β βββ gigashop.sln # Solution file βββ .github/ # GitHub templates βββ CONTRIBUTING.md # Contribution guidelines βββ CODE_OF_CONDUCT.md # Code of conduct βββ LICENSE # MIT License βββ README.md # This file cd src # Run Catalog API dotnet run --project Services/Catalog/Catalog.API # Run Basket API dotnet run --project Services/Basket/Basket.API # Run Order API dotnet run --project Services/Order/Order.API # Run Discount gRPC dotnet run --project Services/Discount/Discount.Grpc # Run API Gateway dotnet run --project ApiGateways/YarpApiGatewaycd src/Web # Install dependencies npm install # Run development server npm run dev # Build for production npm run build # Preview production build npm run preview # Lint code npm run lint# Add a new migration (Order service example) cd src/Services/Order/Order.API dotnet ef migrations add MigrationName # Update database dotnet ef database update # Remove last migration dotnet ef migrations removecd src # Build all images docker compose build # Build specific service docker compose build catalog.api # Build without cache docker compose build --no-cacheCreate a .env file in the src/ directory for local configuration:
# Database Connection Strings POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres POSTGRES_DB=CatalogDb # SQL Server SA_PASSWORD=YourStrong@Passw0rd # Redis REDIS_PASSWORD= # RabbitMQ RABBITMQ_DEFAULT_USER=guest RABBITMQ_DEFAULT_PASS=guest # API URLs VITE_CART_SERVICE_URL=http://localhost:6004/basket-service VITE_PRODUCT_SERVICE_URL=http://localhost:6004/catalog-service VITE_USER_SERVICE_URL=http://localhost:6004/order-serviceGET /products- Get all productsGET /products/{id}- Get product by IDGET /products/category/{category}- Get products by categoryPOST /products- Create new productPUT /products- Update productDELETE /products/{id}- Delete product
GET /basket/{userName}- Get user's basketPOST /basket- Store/update basketDELETE /basket/{userName}- Delete basketPOST /basket/checkout- Checkout basket
GET /orders- Get all ordersGET /orders/{orderName}- Get orders by nameGET /orders/customer/{customerId}- Get customer ordersPOST /orders- Create orderPUT /orders- Update orderDELETE /orders/{id}- Delete order
GetDiscount- Get discount for a productCreateDiscount- Create new discountUpdateDiscount- Update existing discountDeleteDiscount- Delete discount
# Run all tests dotnet test # Run tests with coverage dotnet test /p:CollectCoverage=true # Run specific test project dotnet test src/Services/Catalog/Catalog.TestsPort conflicts:
# Check what's using a port lsof -i :6000 # macOS/Linux netstat -ano | findstr :6000 # Windows # Change ports in compose.override.yamlDatabase connection issues:
# Reset databases docker compose down -v docker compose up -dFrontend build errors:
cd src/Web rm -rf node_modules package-lock.json npm installWe welcome contributions! Please see our Contributing Guidelines for details on:
- Code of Conduct
- Development process
- Submitting pull requests
- Coding standards
- Testing requirements
This project is licensed under the MIT License - see the LICENSE file for details.
- Adam Tungtaiya Lukman - Initial work - @maestro-00
- Built with modern .NET and React ecosystems
- Inspired by microservices best practices
- Community-driven development
- π§ Email: Create an issue
- π¬ Discussions: GitHub Discussions
- π Bug Reports: Issue Tracker
Star β this repository if you find it helpful!