▶ Live Demo — ecommerce.devoyager.cloud
This document provides a comprehensive overview of the E-commerce MVP platform, its architecture, and instructions for building, running, and developing for it.
This is a MVP project that implements a microservices-based e-commerce platform built primarily with Java and Spring Boot.
The typical usage journey proposed in the scope of this initial version focuses on:
- Request: A customer navigates to the website (via the Frontend).
- Display Products: The Gateway calls the Product Service to fetch product data (images, descriptions, prices) to display to the user.
- Authentication: If the user logs in, the Gateway contacts the Auth Service to authenticate their credentials.
- Add to Cart: The user clicks "Add to Cart" of some product. The Gateway sends this request to the Shopping Cart Service, which updates the customer's cart.
- Initiate Checkout: The customer proceeds to checkout. The Gateway pulls the current cart items from the Shopping Cart Service.
- Place Order: The customer confirms the purchase. The Gateway sends a request to the Order Service to create a new order record in a pending state.
- Notification: The User/Account Service or a dedicated Notification Service sends a confirmation email to the customer.
The platform follows a microservices architecture, with each service responsible for a specific business domain. The services are containerized using Docker and orchestrated with Docker Compose.
The key components of the architecture are:
| Microservice | Description | Technology Stack | Database/Store |
|---|---|---|---|
| API Gateway | The single entry point for all client requests. It is responsible for routing, security, and cross-cutting concerns. | Spring Cloud Gateway, GraphQL | N/A |
| Service Registry | A central registry where all services register themselves and discover other services. | Spring Boot | N/A |
| Auth Service | Manages user authentication and authorization using Keycloak (Identity & Access Management). | Keycloak, Spring Boot | PostgreSQL (Users) |
| Product Service | Manages the product catalog, using MongoDB for storage. | Spring Boot | MongoDB (NoSQL) |
| Cart Service | Manages shopping carts, using Redis for fast access to cart data. | Spring Boot | Redis (Key-Value) |
| Order Service | Manages orders and transactions, using PostgreSQL for data consistency. | Spring Boot | PostgreSQL (Relational) |
| Notification Service | Sends notifications to users, using RabbitMQ for asynchronous messaging. | Spring Boot | RabbitMQ (Broker) |
| Frontend | A single-page application built with Angular that provides the user interface. | Angular (SPA) | N/A |
- Goal: Establish the User Authentication flow, configure the API Gateway, and enable secure login.
- ✅ TS 6.1: Set up API Gateway (GraphQL) and route Auth requests.
- ✅ US 5.2: Secure Login (Keycloak integration & JWT generation).
- ✅ US 5.1: Register for a new account.
- Goal: Enable "Window Shopping". A user should be able to view the full product catalog and click into specific product details, with data served from the Product Microservice (MongoDB).
- ✅ TS 1.1: Configure Product Service & Database (Spring Boot/MongoDB).
- ✅ US 1.1: View Product Catalog (MongoDB retrieval).
- ✅ US 1.2: View Product Details.
- Goal: Enable users to add items to a persistent shopping cart.
- ✅ TS 2.1: Configure Cart Service & Redis.
- ✅ US 2.1: Add items to Cart (The Core Action).
- ✅ US 2.2: View Cart Summary (Total price and items in cart).
- Goal: Convert a shopping cart into a permanent Order record. A user can click "Checkout," resulting in a saved order in the PostgreSQL database and an empty shopping cart.
- ✅ TS 3.1: Configure Order Service & PostgreSQL.
- ✅ US 3.1: Checkout the items in the cart (Order Placement).
- Goal: Decoupled communication.
- ✅ TS 4.1: Configure Notification Service & RabbitMQ.
- ✅ US 4.1: Receive email confirmation after order (Async Email Confirmation via RabbitMQ).
The entire platform can be built and run for development purposes using the main docker-compose.yml file.
- Java 21+
- Node.js & Angular CLI
- Docker
- Docker Compose
-
Clone the repository:
git clone https://github.com/dancodingbr/ecommerce.git cd ecommerce -
Build and run the services:
docker-compose up -d --build
This will build the Docker images for all services and start the containers, including development utilities.
-
Access the Application and Services:
- Frontend: http://localhost:8087
- API Gateway: http://localhost:8080
- Service Registry: http://localhost:8761
- Keycloak Admin Console: http://localhost:8082
- Auth Service: http://localhost:8081
- Product Service: http://localhost:8083
- Cart Service: http://localhost:8084
- Order Service: http://localhost:8085
- Notification Service: http://localhost:8086
- Redis Insight: http://localhost:5540
- pgAdmin: http://localhost:5050
- RabbitMQ Management: http://localhost:15672
- MailHog (Email Viewer): http://localhost:8025
- Grafana (Metrics, Logs & Traces): http://localhost:3000
- Prometheus: http://localhost:9090
- SonarQube (Quality Dashboard):
http://<production-server-ip>:9000— see docs/SONAR_CONFIG.md

