Skip to content

Orchestrating microservices securely: Leveraging Spring Cloud Gateway, Consul, Vault, Keycloak, and more for robust communication, monitoring, and scalability. Dockerized with Angular and Bootstrap for efficient frontend management

License

Notifications You must be signed in to change notification settings

Ismailharik/rental-cars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

88 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

A modern and secure rental cars application based on Microservices Architecture

Description :

The objective of this project is to enhance the car rental searching for clients by implementing multiple search filters such as vehicle model, name, category, minimum and maximum price and much more informations about the company . The application allows clients to contact the owner and also enables the owner to manage his vehicles, offices, employees, and orders through an hierarchical architecture. The offices are organized with their respective employees and vehicles, which the admin can manipulate . Additionally, the admin can appoint specific office admins with limited dashboard access to manage the vehicles of their specific offices.

The application is built with a microservices architecture and incorporates several tools and technologies of Spring Cloud for the backend and Angular 13 for the frontend. The main objective of this project is to help to get familiar with microservices architecture,It covered the most important configurations required to build microservices-based applications using Spring Cloud , I have dockerized all services and organised them on docker compose , so with one click you can run all application . below

scroll down to see all tech used

Demo click on the link below :

Class Diagram :

Backend Services:

  • cars-services
  • notification-service
  • customers-service
  • orders-service
  • offices-service

tools & techs

Routing All Microservices Requests :

  • Spring cloud Gateway

Service Discovery :

  • Consul Server

Secret Management :

  • Vault Server

Inter Service Communication :

  • openfeign (sync Communication)
  • web clients (sync / async Communication)
  • kafka Temlate async Communication

Resilient Communication :

  • Circuit Breaker
  • Resilience4J

Distributed Tracing :

  • Micrometer Tracing & Zipkin
    • Tracing β€” seeing WHAT happened
    • Metrics β€” seeing HOW LONG it took to happen

unit & integration test (orders-service) :

  • JUnit
  • Mockito

storing and serving distributed configurations across all service :

  • Spring Cloud Config

Event streaming

  • Kafka Broker

Zero Trust Security Architecture :

  • Spring Security
  • Keycloak (Open Source Identity Manager And Access Management) covered two clients :
    1. rental-cars-clients : for backend to (authenticate you will need to provide symetric key + user credentials)
    2. rental-cars-front : you will need only user credentials as it isn't secure to store symetric key in the front (people can access it from js )

Monitoring

  • Prometheus & Grafana

Databases :

  • MySQL MaeriaDB
  • MongoDB
  • PostgresDB
  • Oracle ( if you have installed in your host machine)

Front End (two app , one for clients & the other for admin):

  • Angular 13
  • Bootstrap 5
  • HightCharts to visualize admine data
  • Admin app secured with keycloak

containerization

  • Docker
  • Docker-Compose

Usage :

To build docker images ,make sure to replace to each service directory and run for each one this commands :

First clone projects

[//]: # (Admin dashboard)
git clone https://github.com/Ismailharik/rental-cars-admin.git

[//]: # (Clients interface )
git clone https://github.com/Ismailharik/rental-cars-front.git

[//]: # (backend services)
git clone https://github.com/Ismailharik/rental-cars.git

[//]: # (backend services configs)
https://github.com/Ismailharik/rental-cars-config.git

uncomment those two line of keycloak

Build Image for your backend service or

docker build -t orders-service .
docker build -t gateway-service .
docker build -t customers-service .
docker build -t notification-service .
docker build -t offices-service .
docker build -t orders-service .
docker build -t config-service .
docker build -t consul-config-service . 
# go to myservices_db folder and run : 
docker build -t custom-mariadb .
# then you can run the cmd below to run all application
docker-compose up

To test the endpoints from postman :

  • Make sure to add on the request header this authorization like the image below
  • If you want to test backend services with rental-cars-client , make sure to add client secret
  • If you're running backend & front services without docker use localhost on Access Token URL input, if you're running them from docker compose , use keycloak ( because we have passed keycloak as host name to the backend services from docker compose )
  • In case you have used docker compose to run all backend service , make sur to update hosys file,by adding adding line indicated on the image below
  • Please the first time you run services add some images to vehicles , I didn't persist data, ( the first images of all vehicles should be 1920x1080 , because I used first images of all vehicles in the carousel of client home page )
hosts file

Application Ports :

Backend Ports :

service Ports
gateway-service 9999
orders-service 8081
cars-service 8082
customers-service 8083
offices-service 8084
consul-config-service 8085
notification-service 8086
config-service 8888
client interface 4201
admin dashboard 4200

Tools Ports :

service Ports
zipkin-server 9411
vault-server 8200
keycloak-service 8080
promethues 9090
grafana 3000
zookeeper 2181
kafka 9092

If you want to Change offices db from Postgres to Oracle

If you have installed oracle db in your machine and want to use it make sure to uncomment it's dependency & config from offices service & comment postgres : oracleConfig

Related Projects :

SaiUpadhyayula/spring-boot-microservices-new
Aliot26/microservices_v3
in28minutes/spring-microservices

License

LICENSE

πŸ”— Links

portfolio linkedin twitter

About

Orchestrating microservices securely: Leveraging Spring Cloud Gateway, Consul, Vault, Keycloak, and more for robust communication, monitoring, and scalability. Dockerized with Angular and Bootstrap for efficient frontend management

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published