Scalable e-commerce platform built with Spring Boot Microservices, Spring Cloud, Next.js 16, and Kafka.
- Modern & Responsive UI: Built with Next.js (App Router), React, and Vanilla CSS with zero external UI dependencies.
- Multi-Language (i18n): Instant runtime switching between English (
EN) and Spanish (ES) withlocalStoragepersistence. - Admin Dashboard (
/admin): Protected role-based portal (ROLE_ADMIN) for real-time inventory management, stock alerts, and product creation/editing. - Server-Side Catalog Search & Filtering: Multi-parameter search, category filters, price ranges, and dynamic sorting.
This project implements a microservices architecture with the following components:
- API Gateway: Single entry point for all client requests with JWT authentication
- Service Discovery: Eureka server for service registration and discovery
- Config Server: Centralized configuration management
- Microservices: Independent services handling specific business domains
- Event Bus: Apache Kafka for asynchronous communication
- Databases: PostgreSQL (relational), MongoDB (document), Redis (caching)
| API Gateway | Discovery Server | Config Server | User Service | Product Service | | Cart Service | Order Service | Payment Service | Notification Service
Docker Services (defined in docker-compose.yml):
- PostgreSQL: Primary relational database
- MongoDB: Document database for flexible schemas
- Redis: In-memory cache for performance optimization
- Kafka: Message broker for event-driven architecture
The platform features a production-ready observability stack built upon the three core pillars of observability:
- Metrics: Micrometer + Prometheus
- Full exposure of Spring Boot Actuator management endpoints.
- Custom business metrics (
ecommerce_orders_total,ecommerce_payments_processed_total,ecommerce_products_low_stock,ecommerce_orders_amount_total).
- Centralized Logging: Grafana Loki + Promtail
- Real-time log aggregation and querying across all microservice containers.
- Distributed Tracing: Micrometer Tracing + Zipkin
- Automatic
traceIdandspanIdpropagation for end-to-end request correlation across the API Gateway and microservices.
- Automatic
- Visualization: Grafana
| Grafana — Business & System Metrics | Grafana Loki — Centralized Logs |
|---|---|
![]() |
![]() |
| Zipkin — Distributed Tracing |
|---|
![]() |
| Service | URL | Credentials |
|---|---|---|
| Grafana | http://localhost:3002 |
admin / admin |
| Prometheus | http://localhost:9090 |
— |
| Zipkin UI | http://localhost:9411 |
— |
| Mailpit (SMTP) | http://localhost:8025 |
— |
The platform uses Apache Kafka for asynchronous communication between services:
flowchart LR
%% Productores (Izquierda)
subgraph Emisores ["Publisher"]
OrderService["Order Service"]
ProductService["Product Service"]
PaymentService["Payment Service"]
end
%% Tópicos Kafka (Centro)
subgraph Kafka [" Kafka topic"]
T_Order["order-events"]
T_Stock["stock-events"]
T_Payment["payment-events"]
T_Cancel["order-cancelled-events"]
end
%% Consumidores (Derecha)
subgraph Receptores ["Consumer"]
ProductConsumer["Product Service"]
OrderConsumer["Order Service"]
NotifConsumer["Notification Service"]
end
%% Conexiones: Publicadores -> Tópicos
OrderService --> T_Order
ProductService --> T_Stock
PaymentService --> T_Payment
OrderService --> T_Cancel
%% Conexiones: Tópicos -> Consumidores
T_Order --> ProductConsumer
T_Stock --> OrderConsumer
T_Stock --> NotifConsumer
T_Payment --> OrderConsumer
T_Payment --> ProductConsumer
T_Payment --> NotifConsumer
T_Cancel --> ProductConsumer
- Docker & Docker Compose
- Java 17+
- Maven 3.8+
-
Clone the repository
git clone <repository-url> cd E-Commerce-platform
-
Start infrastructure
docker-compose up -d
-
Build the project
mvn clean build
-
Run microservices (each in separate terminal)
cd discovery-server && mvn spring-boot:run cd config-server && mvn spring-boot:run cd api-gateway && mvn spring-boot:run cd user-service && mvn spring-boot:run cd product-service && mvn spring-boot:run cd cart-service && mvn spring-boot:run cd order-service && mvn spring-boot:run cd payment-service && mvn spring-boot:run cd notification-service && mvn spring-boot:run
-
Access services
- API Gateway: http://localhost:8080
- Eureka Dashboard: http://localhost:8761
- Kafka: localhost:9092
- Spring Boot 3.4.1 - Application framework
- Spring Cloud 2024.0.0 - Cloud-native development
- Spring Cloud Gateway - API Gateway
- Spring Cloud Eureka - Service Discovery
- Spring Cloud Config - Configuration Server
- PostgreSQL 16 - Relational database
- MongoDB 7 - Document database
- Redis 7 - Caching layer
- Apache Kafka 3.7.0 - Event streaming
- JWT (JJWT 0.12.5) - Token-based authentication
- Spring Security - Authorization & access control
- Lombok 1.18.34 - Reduce boilerplate code
- Maven - Build management
- Docker - Containerization
This project is licensed under the MIT License.



