A backend microservices-based E-Commerce Order Management System built with Java 21, Spring Boot, Spring Cloud, MongoDB, Spring Security, JWT, Eureka, OpenFeign, Resilience4j, and Swagger/OpenAPI.
The system follows a distributed microservices architecture with separate services for authentication, product management, and order management. The API Gateway acts as the single entry point for clients, providing request routing, JWT authentication, role-based authorization, and customer ID forwarding.
Eureka Service Registry enables service registration and discovery, while OpenFeign is used for communication between Order Service and Product Service. Resilience4j provides fault tolerance for dependent service failures.
- Auth Service β User registration, login, JWT token generation, and role management
- Product Service β Product CRUD, search, and inventory management
- Order Service β Order creation, retrieval, cancellation, payment, and status management
- API Gateway β Centralized routing, JWT authentication, authorization, and customer ID forwarding
- Eureka Service Registry β Service registration and discovery
The project demonstrates practical experience with Java backend development, REST APIs, microservices, JWT authentication, role-based authorization, MongoDB, service discovery, API Gateway architecture, inter-service communication, and fault-tolerant design.
The application follows a microservices architecture where each service is independently responsible for a specific business capability.
ββββββββββββββββββββββββ
β Client β
β Postman / Browser β
ββββββββββββ¬ββββββββββββ
β
β HTTP Requests
βΌ
ββββββββββββββββββββββββ
β API Gateway β
β :8080 β
β β
β JWT Authentication β
β Role Authorization β
β Request Routing β
β Customer ID Forward β
βββββββββ¬ββββββββ¬βββββββ
β β
ββββββββββββββ ββββββββββββββ
β β
βΌ βΌ
ββββββββββββββββββββ ββββββββββββββββββββ
β Auth Service β β Product Service β
β β β :8081 β
β User Registrationβ β β
β Login β β Product CRUD β
β JWT Generation β β Search β
β Role Management β β Stock Management β
ββββββββββ¬ββββββββββ ββββββββββ¬ββββββββββ
β β
βΌ β
ββββββββββββββββββββ β
β Auth DB β β
β MongoDB β β
ββββββββββββββββββββ β
β
β OpenFeign
βΌ
ββββββββββββββββββββ
β Order Service β
β :8082 β
β β
β Create Orders β
β My Orders β
β All Orders β
β Cancellation β
β Status Managementβ
β Payment Status β
ββββββββββ¬ββββββββββ
β
βΌ
ββββββββββββββββββββ
β Order DB β
β MongoDB β
ββββββββββββββββββββ
ββββββββββββββββββββββββββββββββ
β Eureka Registry β
β :8761 β
β β
β Service Registration β
β Service Discovery β
ββββββββββββββββ¬ββββββββββββββββ
β
ββββββββββββββββΌβββββββββββββββ
β β β
βΌ βΌ βΌ
API Gateway Auth Service Product Service
β β β
ββββββββββββββββ΄βββββββββββββββ
β
βΌ
Order Service
- Client β Sends authentication and business API requests.
- API Gateway β Acts as the single entry point, validates JWT tokens, performs role-based authorization, forwards customer information, and routes requests.
- Auth Service β Handles user registration, login, JWT generation, and user roles.
- Product Service β Manages products, product search, inventory, stock reservation, and stock release.
- Order Service β Handles order creation, customer orders, order retrieval, cancellation, payment status, and order status management.
- Eureka Service Registry β Maintains service registrations and enables service discovery.
- MongoDB β Provides persistent data storage for the services.
- OpenFeign β Enables communication between Order Service and Product Service.
- Resilience4j β Provides fault tolerance for Product Service communication.
Client
β
β Register / Login
βΌ
API Gateway
β
βΌ
Auth Service
β
β Validate Credentials
β Generate JWT
βΌ
Client
β
β Authorization: Bearer <JWT>
βΌ
API Gateway
β
β Validate JWT
β Check Role
β Forward Customer ID
βΌ
Product / Order Service
- The client registers or logs in through the API Gateway.
- The API Gateway routes the request to the Auth Service.
- The Auth Service validates the credentials.
- A JWT token is generated and returned to the client.
- The client includes the JWT in subsequent requests.
- The API Gateway validates the JWT and checks the user's role.
- For authenticated order requests, the customer ID is forwarded to the Order Service.
- The request is routed to the appropriate backend service.
Client
β
β POST /api/v1/orders
β Authorization: Bearer <JWT>
βΌ
API Gateway
β
β JWT Authentication
β Role Authorization
β Customer ID Forwarding
βΌ
Order Service
β
β Get Product
βΌ
Product Service
β
β Product Details
βΌ
Order Service
β
β Reserve Stock
βΌ
Product Service
β
β Stock Reserved
βΌ
Order Service
β
β Calculate Total
β Save Order
βΌ
Order MongoDB
β
βΌ
Order Response
β
βΌ
API Gateway
β
βΌ
Client
Shows all microservices registered and running successfully.
Interactive Swagger documentation for Product Service APIs.
Interactive Swagger documentation for Order Service APIs.
Interactive Swagger documentation for Auth Service APIs.
Successful order creation through the API Gateway.
- User registration and login
- JWT-based authentication
- Role-based authorization with
USERandADMINroles - Protected API endpoints through API Gateway
- Admin-only operations for product management and order administration
- Customer ID forwarding from the authenticated JWT
- Create, retrieve, update, and delete products
- Product search and filtering
- Category-based filtering
- Price-range filtering
- Inventory management
- Stock reservation
- Stock release
- Create orders with multiple products
- Automatic order total calculation
- Retrieve order by ID
- Retrieve order by order number
- Retrieve authenticated customer's orders
- Admin-only retrieval of all orders
- Order cancellation
- Order status management
- Payment status management
- Controlled order status transitions
- OpenFeign for Order Service β Product Service communication
- Eureka-based service discovery
- API Gateway as the single entry point for clients
- Independent service and database separation
- Resilience4j Circuit Breaker for Product Service communication
- Graceful
503 Service Unavailableresponses when dependent services are unavailable - Global exception handling
- Request validation
- Proper HTTP error responses for invalid requests and resources
- Swagger/OpenAPI documentation
- Spring Boot Actuator health endpoints
- Postman API testing
- Maven-based project management
The application is divided into independent microservices, with each service responsible for a specific business capability.
Responsibilities:
- User registration
- User login
- Credential validation
- JWT token generation
- User role management
- Providing authenticated user information
The Auth Service works with the API Gateway to secure protected endpoints using JWT-based authentication.
Port: 8761
Technology:
- Spring Boot
- Spring Cloud Netflix Eureka Server
Responsibilities:
- Service registration
- Service discovery
- Maintaining the list of available service instances
Eureka Dashboard:
http://localhost:8761
Port: 8081
Technology:
- Spring Boot
- Spring Data MongoDB
- MongoDB
- Validation
- Eureka Client
- Swagger/OpenAPI
- Actuator
Responsibilities:
- Create products
- Retrieve products
- Update products
- Delete products
- Search and filter products
- Manage inventory
- Reserve stock
- Release stock
Database:
ecommerce_product_db
Port: 8082
Technology:
- Spring Boot
- Spring Data MongoDB
- MongoDB
- OpenFeign
- Eureka Client
- Resilience4j
- Validation
- Swagger/OpenAPI
- Actuator
Responsibilities:
- Create orders
- Retrieve orders by ID
- Retrieve orders by order number
- Retrieve authenticated customer's orders
- Retrieve all orders for administrators
- Cancel orders
- Update order status
- Update payment status
- Calculate order totals
- Communicate with Product Service
- Reserve and release product stock
Order Access:
USER / ADMIN
β
βββ GET /api/v1/orders/my-orders
ADMIN
β
βββ GET /api/v1/orders/all
Database:
ecommerce_order_db
Port: 8080
Responsibilities:
- Single entry point for clients
- Route requests to the appropriate microservice
- Validate JWT authentication
- Enforce role-based authorization
- Forward authenticated customer information
- Protect service endpoints from direct client access
Gateway Endpoints:
/api/v1/auth/**
/api/v1/products/**
/api/v1/orders/**
The API Gateway acts as the single entry point for clients, handling authentication, authorization, customer ID forwarding, and request routing.
| Technology | Purpose |
|---|---|
| Java 21 | Programming language |
| Spring Boot 4.0.7 | Application framework |
| Spring Cloud 2025.1.2 | Microservices infrastructure |
| Spring Security | Authentication and authorization |
| JWT | Stateless authentication |
| Spring Cloud Gateway | API Gateway and request routing |
| Spring Cloud Netflix Eureka | Service discovery and registration |
| Spring Cloud OpenFeign | Inter-service communication |
| Resilience4j | Circuit breaker and fault tolerance |
| Spring Data MongoDB | Database access |
| MongoDB | NoSQL database |
| Swagger / OpenAPI | API documentation and testing |
| Spring Boot Actuator | Health monitoring |
| Maven | Build and dependency management |
| Git / GitHub | Version control |
| Postman | API testing |
ecommerce-microservices/
β
βββ auth-service/
β βββ src/
β β βββ main/
β β βββ java/
β β βββ resources/
β βββ pom.xml
β βββ mvnw.cmd
β
βββ service-registry/
β βββ src/
β β βββ main/
β β βββ java/
β β βββ resources/
β βββ pom.xml
β βββ mvnw.cmd
β
βββ product-service/
β βββ src/
β β βββ main/
β β βββ java/
β β βββ resources/
β βββ pom.xml
β βββ mvnw.cmd
β
βββ order-service/
β βββ src/
β β βββ main/
β β βββ java/
β β βββ resources/
β βββ pom.xml
β βββ mvnw.cmd
β
βββ api-gateway/
β βββ src/
β β βββ main/
β β βββ java/
β β βββ resources/
β βββ pom.xml
β βββ mvnw.cmd
β
βββ screenshots/
β βββ eureka-dashboard.png
β βββ product-swagger.png
β βββ order-swagger.png
β βββ create-order.png
β
βββ architecture.png
βββ README.md
auth-service
β
βββ Authentication & JWT
service-registry
β
βββ Service Discovery
api-gateway
β
βββ JWT Authentication
βββ Role Authorization
βββ Customer ID Forwarding
βββ Request Routing
product-service
β
βββ Product & Inventory Management
order-service
β
βββ Order Management
Each microservice is independently structured with its own source code, configuration, dependencies, database ownership, and build lifecycle.
When an authenticated customer creates an order, the request flows through the API Gateway before reaching the Order Service.
Client
β
β 1. Login / Register
βΌ
Auth Service
β
β 2. JWT Token
βΌ
Client
β
β 3. POST /api/v1/orders
β Authorization: Bearer <JWT>
βΌ
API Gateway
β
β 4. Validate JWT
β 5. Check USER / ADMIN role
β 6. Forward Customer ID
βΌ
Order Service
β
β 7. Request product details
βΌ
Product Service
β
β 8. Return product information
βΌ
Order Service
β
β 9. Reserve stock
βΌ
Product Service
β
β 10. Stock successfully reserved
βΌ
Order Service
β
β 11. Calculate total
β 12. Save order
βΌ
Order MongoDB
β
β 13. Return order response
βΌ
API Gateway
β
βΌ
Client
- The customer authenticates through the Auth Service.
- The Auth Service generates a JWT token.
- The client sends the JWT with the order request.
- The API Gateway validates the JWT and checks the user's role.
- The Gateway forwards the authenticated customer ID to the Order Service.
- The Order Service retrieves product information from the Product Service using OpenFeign.
- The Order Service requests stock reservation.
- The Product Service reserves the requested inventory.
- The Order Service calculates item subtotals and the total order amount.
- The order is persisted in the Order MongoDB database.
- The completed order response is returned to the client through the API Gateway.
The order stores:
- Product ID
- Product name
- Product price
- Quantity
- Item subtotal
- Total order amount
- Customer ID
- Order number
- Order status
- Payment status
- Creation timestamp
Orders follow a controlled status transition managed by the Order Service.
CREATED
β
β Payment completed
βΌ
CONFIRMED
β
βΌ
PROCESSING
β
βΌ
SHIPPED
β
βΌ
DELIVERED
Orders can be cancelled from supported intermediate states:
CREATED βββββββββΊ CANCELLED
CONFIRMED βββββββΊ CANCELLED
PROCESSING ββββββΊ CANCELLED
Payment status is maintained separately from order status:
PENDING
β
ββββββββββΊ PAID
β
ββββββββββΊ FAILED
β
ββββββΊ PAID
PAID ββββββββββββΊ REFUNDED
(when a paid order is cancelled)
The Order Service validates every status transition.
| Current Status | Allowed Next Status |
|---|---|
CREATED |
CONFIRMED, CANCELLED |
CONFIRMED |
PROCESSING, CANCELLED |
PROCESSING |
SHIPPED, CANCELLED |
SHIPPED |
DELIVERED |
DELIVERED |
None |
CANCELLED |
None |
A CREATED order can only be confirmed after its payment status becomes PAID.
For example, the following transition is rejected:
CREATED β SHIPPED
This ensures that orders progress through the expected business workflow and prevents invalid state changes.
The microservices communicate through the API Gateway, Eureka Service Registry, and OpenFeign.
Clients send requests to the API Gateway rather than directly accessing individual microservices.
Client
β
β HTTP Request + JWT
βΌ
API Gateway :8080
The Gateway:
- Validates JWT authentication.
- Checks
USERandADMINroles. - Routes requests to the appropriate microservice.
- Forwards the authenticated customer ID for customer-specific order requests.
API Gateway
:8080
β
ββββββββββββββΌβββββββββββββ
βΌ βΌ βΌ
Auth Service Product Service Order Service
The Order Service communicates with the Product Service using Spring Cloud OpenFeign.
@FeignClient(name = "product-service")
public interface ProductServiceClient {
}The Order Service uses the Product Service for:
GET /api/v1/products/{id}
PUT /api/v1/products/{id}/reserve-stock
PUT /api/v1/products/{id}/release-stock
For example, when creating an order:
Order Service
β
β OpenFeign
βΌ
Product Service
β
βββ Get Product
β
βββ Reserve Stock
β
βββ Release Stock
Eureka acts as the service registry.
Eureka Registry
:8761
β²
ββββββββββββββββΌβββββββββββββββ
β β β
βΌ βΌ βΌ
API Gateway Auth Service Product Service
β β
β β
ββββββββββββββββ¬βββββββββββββββ
βΌ
Order Service
Each service registers itself with Eureka. The Order Service can discover the Product Service using its service name instead of relying on a hardcoded host and port.
product-service
This makes the architecture more flexible when service instances or deployment locations change.
The Order Service uses Resilience4j Circuit Breaker to handle failures when communicating with the Product Service through OpenFeign.
This prevents Product Service failures from propagating as uncontrolled errors through the Order Service.
Order Service
β
β OpenFeign Request
βΌ
Product Service
β
X Service Unavailable
β
βΌ
Resilience4j Circuit Breaker
β
βΌ
Fallback Handler
β
βΌ
HTTP 503 Service Unavailable
When the Product Service is temporarily unavailable, the circuit breaker handles the failure and the application returns a controlled response instead of exposing a raw Feign or network exception.
{
"status": 503,
"error": "Service Unavailable",
"message": "Product Service is currently unavailable. Please try again later."
}The circuit breaker is used around Product Service communication required for order processing, including:
Get Product Details
β
βΌ
Reserve Product Stock
β
βΌ
Release Product Stock
This improves the system's fault tolerance, provides predictable error responses, and prevents temporary dependency failures from causing uncontrolled failures in the Order Service.
The application uses MongoDB for persistent data storage. Each microservice has its own dedicated database, following the database-per-service principle.
The Auth Service stores user and authentication-related data in its dedicated MongoDB database.
Auth Service β Auth MongoDB
The Product Service stores product and inventory data in:
ecommerce_product_db
Configuration:
spring.data.mongodb.uri=mongodb://localhost:27017/ecommerce_product_dbThe Order Service stores order data in:
ecommerce_order_db
Configuration:
spring.data.mongodb.uri=mongodb://localhost:27017/ecommerce_order_dbβββββββββββββββββββββββββββ
β Auth Service β
ββββββββββββββ¬βββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Auth MongoDB β
βββββββββββββββββββββββββββ
βββββββββββββββββββββββββββ
β Product Service β
β :8081 β
ββββββββββββββ¬βββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β ecommerce_product_db β
βββββββββββββββββββββββββββ
βββββββββββββββββββββββββββ
β Order Service β
β :8082 β
ββββββββββββββ¬βββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β ecommerce_order_db β
βββββββββββββββββββββββββββ
This separation ensures that each service owns and manages its own data without directly accessing another service's database.
MongoDB must be running locally on:
localhost:27017
Make sure the following are installed and available on your system:
- Java 21
- Maven
- MongoDB
- Git
java -versionThe project requires Java 21.
mvn -versionMongoDB should be running locally on:
localhost:27017
Before starting the microservices, ensure that MongoDB is running successfully.
Start the services in the following order so that service discovery and inter-service communication are available before client requests are sent.
Open a terminal:
cd service-registry
.\mvnw.cmd spring-boot:runEureka runs on:
http://localhost:8761
Open the Eureka Dashboard and verify that the required services are registered.
Open a new terminal:
cd auth-service
.\mvnw.cmd spring-boot:runThe Auth Service handles user registration, login, JWT generation, and authentication-related operations.
Open a new terminal:
cd product-service
.\mvnw.cmd spring-boot:runProduct Service runs on:
http://localhost:8081
Open a new terminal:
cd order-service
.\mvnw.cmd spring-boot:runOrder Service runs on:
http://localhost:8082
Open a new terminal:
cd api-gateway
.\mvnw.cmd spring-boot:runAPI Gateway runs on:
http://localhost:8080
MongoDB
β
βΌ
Eureka Registry
β
ββββββββββββββββ
βΌ βΌ
Auth Service Product Service
β β
ββββββββ¬ββββββββ
βΌ
Order Service
β
βΌ
API Gateway
β
βΌ
Client
Once all services are running and registered with Eureka, client requests should be sent through the API Gateway at:
http://localhost:8080
All client requests should preferably go through the API Gateway:
http://localhost:8080
Authentication is handled using JWT Bearer tokens.
Authentication endpoints are provided by the Auth Service.
POST /api/v1/auth/registerPOST /api/v1/auth/loginThe login response provides a JWT token that must be included when accessing protected APIs.
Example:
Authorization: Bearer <JWT_TOKEN>Access: ADMIN
POST /api/v1/productsExample:
{
"sku": "PHONE-001",
"name": "Smartphone",
"category": "Electronics",
"description": "Test smartphone",
"price": 25000,
"stock": 10,
"active": true
}Access: USER, ADMIN
GET /api/v1/products/{id}Access: USER, ADMIN
GET /api/v1/productsSupported query parameters:
category
search
minPrice
maxPrice
Example:
GET /api/v1/products?category=Electronics&minPrice=10000&maxPrice=50000Access: ADMIN
PUT /api/v1/products/{id}Access: ADMIN
DELETE /api/v1/products/{id}Access: USER, ADMIN
PUT /api/v1/products/{id}/reserve-stockAccess: USER, ADMIN
PUT /api/v1/products/{id}/release-stockAccess: USER, ADMIN
POST /api/v1/ordersExample:
{
"customerId": "CUST-TEST-001",
"items": [
{
"productId": "PRODUCT_ID",
"quantity": 2
}
]
}Access: USER, ADMIN
GET /api/v1/orders/{id}Access: USER, ADMIN
GET /api/v1/orders/number/{orderNumber}Access: USER, ADMIN
Returns orders belonging to the authenticated customer.
GET /api/v1/orders/my-ordersThe customer ID is obtained from the authenticated JWT and forwarded by the API Gateway.
Access: ADMIN
Returns all orders in the system.
GET /api/v1/orders/allAccess: USER, ADMIN
POST /api/v1/orders/{id}/cancelAccess: ADMIN
PUT /api/v1/orders/{id}/statusAccess: ADMIN
PUT /api/v1/orders/{id}/payment| API | USER | ADMIN |
|---|---|---|
| Register / Login | β | β |
| Create Product | β | β |
| View Products | β | β |
| Update Product | β | β |
| Delete Product | β | β |
| Create Order | β | β |
| Get Order | β | β |
| My Orders | β | β |
| All Orders | β | β |
| Cancel Order | β | β |
| Update Order Status | β | β |
| Update Payment Status | β | β |
The project uses Swagger/OpenAPI to provide interactive API documentation for the microservices.
Swagger allows developers to:
- View available REST endpoints
- Inspect request and response models
- Understand required parameters
- Test APIs interactively
- Verify API behavior during development
- Explore authentication, product, and order APIs
http://localhost:8083/swagger-ui/index.html
http://localhost:8080/swagger-ui/index.html
http://localhost:8080/swagger-ui/index.html
The API Gateway exposes the service API documentation through the configured Gateway routes.
http://localhost:8080/swagger-ui/index.html
For protected APIs, provide the JWT token using the authorization mechanism configured in Swagger:
Bearer <JWT_TOKEN>
The project uses Spring Boot Actuator to expose health and monitoring endpoints for the microservices.
GET http://localhost:8081/actuator/health
GET http://localhost:8082/actuator/health
GET http://localhost:8080/actuator/health
GET http://localhost:8083/actuator/health
A healthy service should return a response similar to:
{
"status": "UP"
}These endpoints are useful for monitoring service availability and verifying application health during development and deployment.
The application was tested using Postman through the API Gateway.
Testing covered authentication, authorization, product management, order processing, service communication, and failure scenarios.
- User registration
- User login
- JWT token generation
- Access to protected endpoints with a valid JWT
- Rejection of requests without authentication
- USER and ADMIN role-based access
- USER denied access to admin-only endpoints
- ADMIN access to administrative endpoints
- Product creation
- Product retrieval
- Product update
- Product deletion
- Product search and filtering
- Stock reservation
- Stock release
- Invalid product ID
- Duplicate product SKU
- Request validation
- Order creation
- Get order by ID
- Get order by order number
- Get authenticated customer's orders
- Get all orders for administrators
- Order cancellation
- Order status updates
- Payment status updates
- Order total calculation
- Invalid order ID
- Invalid order status transition
- Invalid payment status transition
- Duplicate products within an order
- Invalid product ID
- Insufficient product stock
- API Gateway routing
- JWT authentication at the Gateway
- Customer ID forwarding
- Eureka service registration
- Eureka service discovery
- OpenFeign communication between Order Service and Product Service
- Product Service unavailable
- OpenFeign communication failure
- Resilience4j Circuit Breaker
- Controlled
503 Service Unavailableresponse - Global exception handling
Service availability was verified using Spring Boot Actuator:
GET /actuator/health
The main request flow was tested end-to-end through:
Client
β
βΌ
API Gateway
β
βΌ
Authentication / Authorization
β
βΌ
Microservice
β
βΌ
Database / Dependent Service
This helped verify both individual API functionality and communication between the distributed services.
The application uses centralized exception handling to provide consistent and meaningful error responses.
The Order Service uses @RestControllerAdvice to handle application-specific and unexpected exceptions.
When an order ID or order number does not exist:
HTTP 404 NOT FOUND
When an order references an invalid product:
HTTP 404 NOT FOUND
Invalid or missing request data is rejected with an appropriate client error response.
For example, an order must contain at least one item and a valid customer ID.
HTTP 400 BAD REQUEST
Requests without valid authentication credentials are rejected:
HTTP 401 UNAUTHORIZED
Authenticated users attempting to access an endpoint without the required role receive:
HTTP 403 FORBIDDEN
For example, a USER attempting to access:
GET /api/v1/orders/all
is denied because this endpoint requires the ADMIN role.
When the Product Service is unavailable, Resilience4j handles the failure and returns:
HTTP 503 SERVICE UNAVAILABLE
Example:
{
"status": 503,
"error": "Service Unavailable",
"message": "Product Service is currently unavailable. Please try again later."
}Centralized error handling prevents raw internal exceptions from being exposed directly to API clients and provides predictable responses across the application.
First authenticate through the Auth Service:
POST http://localhost:8080/api/v1/auth/login
Use the returned JWT token when creating a product or order.
Create a product:
POST http://localhost:8080/api/v1/products
Then create an order using the returned product ID:
POST http://localhost:8080/api/v1/orders
The system processes the request as follows:
Client
β
API Gateway
β
JWT Authentication
β
Order Service
β
Product Service
β
Reserve Stock
β
Calculate Order Total
β
Save Order in MongoDB
β
Return Order Response
Build Auth Service:
cd auth-service
.\mvnw.cmd clean packageBuild Product Service:
cd product-service
.\mvnw.cmd clean packageBuild Order Service:
cd order-service
.\mvnw.cmd clean packageBuild API Gateway:
cd api-gateway
.\mvnw.cmd clean packageBuild Service Registry:
cd service-registry
.\mvnw.cmd clean packageAuthentication, Product, and Order functionality are separated into independently deployable services.
Eureka allows services to register and discover one another without hardcoding service instance information for inter-service communication.
Clients interact with a single gateway instead of communicating directly with every microservice.
JWT provides stateless authentication while the API Gateway performs authentication and role-based authorization.
The API Gateway extracts the authenticated customer information from the JWT and forwards the customer ID to the Order Service for customer-specific operations.
OpenFeign simplifies communication between Order Service and Product Service.
Resilience4j prevents temporary Product Service failures from causing uncontrolled failures in Order Service.
Each service owns its own database:
Auth Service β Auth MongoDB
Product Service β ecommerce_product_db
Order Service β ecommerce_order_db
This follows the database-per-service principle and keeps service data isolated.
Potential future enhancements include:
- Payment Service
- Notification Service
- Kafka-based asynchronous communication
- Distributed tracing
- Centralized configuration
- Centralized logging
- Redis caching
- Automated CI/CD pipeline
- Automated integration tests
- Kubernetes deployment
This project demonstrates practical experience with:
- Java backend development
- Spring Boot
- REST API development
- Spring Security
- JWT authentication
- Role-based authorization
- MongoDB
- Microservice architecture
- Service discovery
- API Gateway
- OpenFeign
- Circuit breaker pattern
- Exception handling
- API validation
- Swagger/OpenAPI
- Actuator monitoring
- Maven
- Git/GitHub
- Postman API testing
Rakshitha Bai V.
Computer Science & Engineering β Data Science
Built as a practical Java Spring Boot microservices project demonstrating backend development, distributed service communication, JWT-based security, service discovery, API Gateway architecture, role-based authorization, and fault-tolerant design.
Thank you for visiting this project! I hope you found it useful and informative. π





