ShopNow Microservices Overview Architecture

Overview Architecture

The ShopNow project applies the Database per Service pattern to ensure independence between microservices. Each service owns its own database, allowing development teams to work independently and optimize technology suitable for each specific domain.

Overview Architecture

API Gateway serves as the single entry point for the entire backend system. It routes user requests to internal services (User, Product, Cart) and handles authentication and authorization through integration with Keycloak. The project uses Kong Gateway as the API Gateway. The main components of Kong Gateway will be introduced in section 1.1 Introduction to Kong Gateway.

Keycloak (Authentication & Authorization) is an open-source identity and access management service. It provides user authentication, authorization, and protection of microservice endpoints. Keycloak provides a web interface to manage identity and access for microservices.

Keycloak

Config Server manages centralized configuration for all microservices, making it easy to update configuration without rebuilding or redeploying the application. Instead of each microservice having to manage its own configuration, they can connect to the config server to get necessary settings, especially when deploying across different environments (dev, staging, production).

Discovery Server allows microservices to register and automatically discover each other without specifying static IP addresses or ports. It supports scaling and load balancing between service instances. More specifically, the discovery server acts as a centralized registry where services automatically register and update their status (e.g., “ready” or “not ready” status). The system uses Spring Cloud Netflix Eureka technology as the discovery server.

Discovery Server

All services in the ShopNow system provide Swagger UI interface to support developers during development, testing, and system integration. This automatic API documentation helps frontend/backend teams easily understand the functionality and processing flow of each service.

User Service handles user information, registration, profile updates, and shopping history. It connects to its own PostgreSQL database. User Service is responsible for handling all user-related tasks such as:

User Service

Product Service manages product lists, product details, inventory, and related information. It has an independent PostgreSQL database to store product information. Product Service is responsible for storing and distributing information related to:

Product Service

Cart Service manages user shopping carts, allowing adding/removing/editing products in the cart. It uses PostgreSQL to store cart data. Cart Service provides shopping cart operation functions for users, including:

Cart Service

Domain

List of Domains in the ShopNow system after deployment:

You need to purchase a Domain first to be able to deploy the system and access it using the Domain.

Domain Description
shopnow.tranvix.click Main domain to access the ShopNow shopping interface
kong-proxy.tranvix.click Kong Gateway used to route user requests to internal services
keycloak.tranvix.click Main domain to access the Keycloak identity and access management interface
discovery-server.tranvix.click Access the Discovery Server interface of the ShopNow system
user-service.tranvix.click/swagger-ui/index.html Access the Swagger UI interface of the ShopNow system’s User Service
product-service.tranvix.click/swagger-ui/index.html Access the Swagger UI interface of the ShopNow system’s Product Service
cart-service.tranvix.click/swagger-ui/index.html Access the Swagger UI interface of the ShopNow system’s Cart Service