/e-commerce-app-simple-consul-vault

e-commerce application with microservices

Primary LanguageJava

Simple e-commerce microservices application

The application is built using Spring Boot and Angular, and it uses a microservices architecture to make
it scalable and maintainable.
it contains 5 services :
Customer Service, Inventory Service, Order Service, Billing Service, Config Service

Table of Contents

Backend Services

The backend contains 5 services :

Config Service

This service contain configuration of all services

Specify the folder of all config files :

spring.cloud.config.server.git.uri=file:///D:/config-git-repo

Start the consul server :

consul agent -server -bootstrap-expect=1 -data-dir=consul-data -ui -bind=@IP

Show all registred services :

http://localhost:8500/

image

Gateway Service

Spring Cloud Gateway It provides a centralized entry point for routing and filtering requests
to microservices in a distributed system, enabling dynamic and scalable routing based on various criteria.

We use dynamic routing :

@Bean
DiscoveryClientRouteDefinitionLocator dynamicRoutes(ReactiveDiscoveryClient rdc,
                                                    DiscoveryLocatorProperties dlp){
    return new DiscoveryClientRouteDefinitionLocator(rdc, dlp);
}

Customer Service

  • Get all Customers :

image

Inventory Service

  • Get all Products :

image

Order Service

  • Get all infos about an order :

image

Billing Service

vault:

vault server -dev

set VAULT_ADDR=http://127.0.0.1:8200

vault kv put secret/vault-ms user.username=root user.password=1234

vault kv get secret/vault-ms

Frontend with Angular

All Products

image

All Customers

image

All Infos About an Order

image