Skip to content

dancodingbr/ecommerce

Repository files navigation

Microservices E-commerce MVP

▶ 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.

Project Overview

This is a MVP project that implements a microservices-based e-commerce platform built primarily with Java and Spring Boot.

Preview

User flow

The typical usage journey proposed in the scope of this initial version focuses on:

Phase 1: Browsing and Adding to Cart

  • 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.

Phase 2: Checkout

  • 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.

Phase 3: Post-Purchase

  • Notification: The User/Account Service or a dedicated Notification Service sends a confirmation email to the customer.

Architecture & Tech Stack

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.

Architecture

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

Roadmap & Delivery Features

Sprint 1: Setting up the core infrastructure and enabling secure access (Auth Service)

  • 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.

Sprint 2: Product Discovery & Catalog

  • 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.

Sprint 3: Shopping Cart (State)

  • 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).

Sprint 4: Checkout (Transactions)

  • 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).

Sprint 5: Notifications (Event-Driven)

  • Goal: Decoupled communication.
  • TS 4.1: Configure Notification Service & RabbitMQ.
  • US 4.1: Receive email confirmation after order (Async Email Confirmation via RabbitMQ).

Building and Running

The entire platform can be built and run for development purposes using the main docker-compose.yml file.

Prerequisites

  • Java 21+
  • Node.js & Angular CLI
  • Docker
  • Docker Compose

Instructions

  1. Clone the repository:

    git clone https://github.com/dancodingbr/ecommerce.git
    cd ecommerce
  2. 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.

  3. Access the Application and Services:

About

Microservices E-commerce MVP platform built on the Spring ecosystem.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors