Git Product home page Git Product logo

online-shop-microservices-spring-cloud's Introduction

Online Shop - Microservices Example - Build Microservices Using Spring Boot And Spring Cloud

  • Eureka
  • Spring Cloud Gateway
  • Spring Cloud OpenFeign
  • Spring Cloud Circuit Breaker - Resilience4J
  • Spring Cloud Sleuth + Zipkin
  • Micrometer Tracing + Zipkin
  • Redis
  • RedissonLock
  • RabbitMQ
  • RabbitMQ RPC - Request / Reply Pattern
  • JWT
  • Spring Boot 3.3
  • Spring Boot Admin

Overview

Overview

Order Process

Order Process

API Token Authentication

API Token Authentication

Run And Test

Requirements

  • JDK 22
  • Gradle 8.8
  • Podman & podman-compose (or Docker & docker cmopose)

Preparation

Create and run containers (PostgreSQL, RabbitMQ, Redis, Zipkin)

cd scripts
podman-compose up -d

Or use docker compose

cd scripts
sudo docker compose up -d

Run

Build and run

  • eurekaServer, gateway, sbAdmin
  • authServer, spProduct, spUser, spOrder, spPayment
  • spWeb (web App)
cd scripts
sh run-jars.sh

Test

Add test data before run test

cd spTest
gradle clean test -i --tests AddTestData

check codes in spTest/src/test/java/xyz/defe/sp/test/AddTestData.java

Run test classes

cd spTest
gradle clean test --tests TestAllSuit

see test classes in spTest/src/test/java/xyz/defe/sp/test/*

Quick run and test

cd scripts
sh run-and-test.sh

Web UI

Eureka > http://localhost:8761

Zipkin > http://localhost:9411

RabbitMQ > http://localhost:15672

Spring Boot Admin > http://localhost:11000/wallboard

Spring Boot Admin Overview

Build docker image

Create Dockerfile

gradle dockerCreateDockerfile

It will create a Dockerfile in ./build/docker/

Build image

gradle dockerBuildImage

Podman

Execute the command before build image :

systemctl --user restart podman

Docker

Before build image, comment out this line in build.gradle file :

url = 'unix:///run/user/1000/podman/podman.sock'

When you get the following error :

Got permission denied while trying to connect to the Docker daemon socket

Add your user to docker group :

sudo groupadd docker
sudo gpasswd -a ${USER} docker
sudo systemctl restart docker
newgrp docker

Then you can running Docker without sudo, If that doesn't work, try logout or rebooting.

online-shop-microservices-spring-cloud's People

Contributors

uxov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.