A backend-only E-Commerce platform built using Spring Boot Microservices with Spring Cloud Gateway, Eureka Service Discovery, JWT Authentication, OpenFeign, Apache Kafka, and MySQL.
- Overview
- Architecture
- Key Features
- Architecture
- Technology Stack
- Project Structure
- Microservices
- Communication
- Project Demonstration
- Running the Project
- Configuration
- Testing
- Future Improvements
- Author
- License
- 7 Spring Boot Microservices
- JWT Authentication & Authorization
- Spring Cloud Gateway
- Eureka Service Discovery
- OpenFeign Inter-Service Communication
- Apache Kafka Event Messaging
- MySQL with Spring Data JPA
- Swagger / OpenAPI Documentation
- Global Exception Handling
- Unit & Repository Testing
This project is a backend-only E-Commerce application built using a microservices architecture with Spring Boot and Spring Cloud. It demonstrates secure authentication using JWT, synchronous inter-service communication with OpenFeign, asynchronous event-driven messaging using Apache Kafka, centralized routing through Spring Cloud Gateway, and service discovery with Eureka.
Major concepts demonstrated:
- Spring Boot Microservices
- Spring Cloud Gateway
- Eureka Service Discovery
- Spring Security + JWT
- OpenFeign
- Apache Kafka
- Spring Data JPA
- MySQL
- Swagger / OpenAPI
- Layered Architecture
- User Registration
- Secure Login
- JWT Token Generation
- Spring Security
- CRUD Operations
- Validation
- REST APIs
- Inventory Management
- Stock Updates
- Place Orders
- Communicates with Item & Inventory services
- Publishes Kafka events
- Kafka Consumer
- Processes low-stock/order notifications
- API Gateway
- Eureka Service Discovery
- OpenFeign
- Swagger Documentation
- Global Exception Handling
The following diagram illustrates the overall architecture of the application, including client interaction, API Gateway, Eureka Service Discovery, microservices, OpenFeign communication, Apache Kafka event-driven messaging, and independent MySQL databases for each service.
Architecture Highlights
- Client requests are routed through the Spring Cloud Gateway.
- All services register with Eureka Server for service discovery.
- Authentication Service provides JWT-based authentication and authorization.
- Item, Inventory, and Order Services communicate synchronously using OpenFeign.
- Inventory Service publishes events to Apache Kafka, which are consumed by the Notification Service.
- Each microservice maintains its own independent MySQL database.
Category Technologies
Language Java 17 Framework Spring Boot, Spring Cloud Security Spring Security, JWT Messaging Apache Kafka Discovery Eureka Communication OpenFeign Database MySQL, JPA, Hibernate Documentation Swagger/OpenAPI Build Tool Maven Testing JUnit 5, Mockito
springboot-ecommerce-microservices/
├── authentication-service
├── gateway-service
├── eureka-service
├── item-service
├── inventory-service
├── order-service
├── notification-service
├── screenshots
├── README.md
├── LICENSE
└── .gitignore
Handles user registration, login and JWT token generation.
Acts as the single entry point for all client requests and routes them to the appropriate services.
Provides service registration and discovery.
Manages product information through REST APIs.
Maintains stock availability and inventory updates.
Processes orders, validates inventory and publishes Kafka events.
Consumes Kafka messages and generates notifications.
Synchronous
Client → Gateway → Services (REST/OpenFeign)
Asynchronous
Order Service → Kafka → Notification Service
The following screenshots demonstrate the architecture, API documentation, authentication flow, and event-driven communication implemented in this project.
The Eureka Server showing all registered microservices.
Centralized Swagger UI exposed through the API Gateway.
Registering a new user using the Authentication Service.
Successful login returning a JWT access token.
Swagger documentation for the Item Service.
Swagger documentation for the Inventory Service.
Swagger documentation for the Order Service.
Swagger documentation for the Notification Service.
Creating an order using the REST API.
Successful order creation and response returned by the Order Service.
Notification Service consuming a low-stock event published by the Inventory Service via Apache Kafka.
- Java 17
- Maven
- MySQL
- Apache Kafka
- Eureka Server
- Authentication Service
- Gateway Service
- Item Service
- Inventory Service
- Order Service
- Notification Service
Swagger:
http://localhost:8765/swagger-ui/index.html
Sensitive configuration files are intentionally excluded.
Use:
- application-example.properties
- application-example.yml
Rename them locally before running the application.
Implemented using:
- JUnit 5
- Mockito
- Spring Boot Test
- Docker
- Docker Compose
- Kubernetes
- Config Server
- Redis Cache
- Resilience4j
- ELK Stack
- CI/CD Pipeline
Aryan Raj
Backend Developer | Java | Spring Boot | Microservices
GitHub: https://github.com/ARYAN01RAJ
LinkedIn: https://www.linkedin.com/in/aryan-raj-5111a2372/
MIT License.











