Giter Club home page Giter Club logo

spring-cloud-playground's Introduction

Spring Cloud Playground - Simple Movie Experience

Build Status Codacy Badge

Micro Services

user-service (port 8081)

API HTTP Method Description
/api/v1/user POST Creates or updates an user
/api/v1/user/{userId} GET Retrieves an user object
/api/v1/users GET Retrieves the list of users

movie-service (port 8082)

API HTTP Method Description
/api/v1/movie POST Creates or updates a movie
/api/v1/movie/{movieId} GET Retrieves a movie object
/api/v1/movies GET Retrieves the list of movies

rating-service (port 8083)

API HTTP Method Description
/api/v1/rating POST Creates a movie rating
/api/v1/ratings/user/{userId} GET Retrieves the list of ratings for an user
/api/v1/ratings/movies/{movieId} GET Retrieves the list of ratings for a movie
/api/v1/ratings/{userId}/{movieId} GET Retrieves a rating for an user and movie
/api/v1/ratings/{userId}/{movieId} DELETE Deletes a rating for an user and movie

cart-service (port 8084)

API HTTP Method Description
/api/v1/cart POST Creates a cart item
/api/v1/cart/{userId} GET Retrieves the list of cart items for an user
/api/v1/cart/{userId}/{movieId} DELETE Deletes a cart item for an user and movie

Cloud Services

Portainer (port 9999)

Eureka

Discovery Server - Eureka (port 8888)

Eureka

Proxy Gateway - Zuul Proxy (port 9001)

Zuul Proxy

Api Gateway - Spring Cloud Gateway (port 9000)

The api gateway uses spring-cloud-gateway, which behinds the scenes is suing spring webflux. At the moment spring webflux does not support the swagger-ui. Below you can see example of requests going through the api gateway:

[skydiver@dropzone ~/spring-cloud-playground (master)] curl --header "Content-Type: application/json" --request POST --data '{ "firstName": "Thiago", "lastName": "Locatelli", "username": "thiagolocatelli"}' http://localhost:9000/user-service/api/v1/user
[skydiver@dropzone ~/spring-cloud-playground (master)] curl --header "Content-Type: application/json" --request POST --data '{ "firstName": "Josh", "lastName": "Long", "username": "starbuxman"}' http://localhost:9000/user-service/api/v1/user
[skydiver@dropzone ~/spring-cloud-playground (master)] curl --header "Content-Type: application/json" --request POST --data '{ "firstName": "Mark", "lastName": "Heckler", "username": "mkheck"}' http://localhost:9000/user-service/api/v1/user

[skydiver@dropzone ~/spring-cloud-playground (master)] http http://localhost:9000/user-service/api/v1/users
HTTP/1.1 200
Content-Type: application/json;charset=UTF-8
Date: Thu, 09 May 2019 19:05:59 GMT
Transfer-Encoding: chunked

[
    {
        "id": 1,
        "firstName": "Thiago",
        "lastName": "Locatelli",
        "userName": "thiagolocatelli"
    },
    {
        "id": 2,
        "firstName": "Josh",
        "lastName": "Long",
        "userName": "starbuxman"
    },
    {
        "id": 3,
        "firstName": "Mark",
        "lastName": "Heckler",
        "userName": "mkheck"
    }
]

Trying it out

Downloading and running locally

git clone https://github.com/thiagolocatelli/spring-cloud-playground.git

mvn clean package -DskipTests

Deploying to Docker

To start all the stack in your docker engine, execute the following command:

mvn clean package -DskipTests -P docker

docker-compose -d -p moviex up

to stop all containers

docker-compose -p moviex down

Deploying to Docker Swarm

spring-cloud-playground's People

Contributors

thiagolocatelli avatar

Watchers

 avatar  avatar

Forkers

khalidelsayed

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.