You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A full-stack e-commerce application built with Spring Boot 4, Spring Cloud 2025, and a microservices architecture. The platform handles customer management, product catalog, order processing, payments, and email notifications β all orchestrated through an API Gateway with service discovery.
Client βββΊ API Gateway (8088)
β
ββββΊ /api/customer/** βββΊ Customer Service (8081) βββΊ PostgreSQL
ββββΊ /api/product/** βββΊ Product Service (8082) βββΊ PostgreSQL
ββββΊ /api/order/** βββΊ Order Service (8083) βββΊ PostgreSQL
ββββΊ /api/payment/** βββΊ Payment Service (8084) βββΊ PostgreSQL
Order Creation Flow
1. Client βββΊ POST /api/order/
2. Order Service βββΊ (Feign) βββΊ Customer Service [Validate customer]
3. Order Service βββΊ (Feign) βββΊ Product Service [Purchase & deduct stock]
4. Order Service βββΊ (Feign) βββΊ Payment Service [Process payment]
5. Payment Service βββΊ (Kafka) βββΊ Notification Service [Send email]
6. Order Service βββΊ (Kafka) βββΊ Notification Service [Order confirmation email]
Tech Stack
Layer
Technology
Language
Java 21
Framework
Spring Boot 4.0.2
Cloud
Spring Cloud 2025.1.0
API Gateway
Spring Cloud Gateway Server WebMVC
Service Discovery
Netflix Eureka
Config Management
Spring Cloud Config Server (native)
Inter-Service Comm
OpenFeign (sync), Apache Kafka (async)
Database
PostgreSQL
ORM
Spring Data JPA / Hibernate
API Docs
SpringDoc OpenAPI (Swagger UI)
Tracing
Zipkin + Micrometer Brave
Email
MailDev (development SMTP)
Containerization
Docker & Docker Compose
Services
Infrastructure Services
Service
Port
Description
Config Server
8888
Centralized configuration for all services using native file-based profiles
Discovery Service
8761
Eureka server for service registration and discovery
API Gateway
8088
Single entry point; routes requests to downstream services via load balancer
Business Services
Service
Port
Description
Customer Service
8081
CRUD operations for customer management
Product Service
8082
Product catalog and category management, stock tracking
Order Service
8083
Order creation, orchestrates customer validation, product purchase, and payment
Payment Service
8084
Payment processing, sends Kafka notifications on success
Notification Service
8085
Consumes Kafka events and sends email notifications via MailDev
Infrastructure Components
Component
Port
Description
PostgreSQL
5432
Shared database server with separate databases per service
Kafka
9092
Message broker for async event-driven communication
Zookeeper
2181
Kafka cluster coordination
Zipkin
9411
Distributed tracing UI
MailDev
1080 (UI) / 1025 (SMTP)
Development email server with web UI
pgAdmin
8080
PostgreSQL admin UI
API Endpoints
Customer Service (/api/customer)
Method
Endpoint
Description
POST
/create
Create a new customer
GET
/get?id={id}
Get customer by ID
GET
/get-all
Get all customers
PUT
/update/{id}
Update customer
DELETE
/delete/{id}
Delete customer
Product Service (/api/product)
Method
Endpoint
Description
POST
/
Create a new product
GET
/all-products
Get all products
GET
/product/{id}
Get product by ID
DELETE
/product/{id}
Delete product
POST
/purchase
Purchase products (deducts stock)
POST
/category/
Create a category
GET
/category/
Get all categories
GET
/category/{categoryId}
Get category by ID
Order Service (/api/order)
Method
Endpoint
Description
POST
/
Create a new order
GET
/
Get all orders
GET
/{id}
Get order by ID
Payment Service (/api/payment)
Method
Endpoint
Description
POST
/
Process a payment
Getting Started
Prerequisites
Docker & Docker Compose
Ports 5432, 8080β8088, 9092, 9411, 1025, 1080, 2181 available
Run the Platform
cd services
docker compose up -d --build
Services start in dependency order:
PostgreSQL, Zookeeper, Kafka, Zipkin, MailDev
Config Server (waits for health check)
Discovery Service
All business services + Gateway
Startup time: Allow ~2 minutes for all services to register with Eureka.
Verify Services
# Check all containers are running
docker ps
# Eureka dashboard
open http://localhost:8761
# Test gateway routing
curl http://localhost:8088/api/customer/get-all
curl http://localhost:8088/api/product/all-products
curl http://localhost:8088/api/order/
Swagger UI
Each service exposes Swagger UI for interactive API documentation: