Giter Site home page Giter Site logo

cakestore's Introduction

Cakes Store

Order cakes service for the cakes store

Description

This project is made for educational purposes. Main goal: to learn Spring Boot and Kotlin

Create two microservices:

Cake Assortment Service

Microservice with private GRpc API:

  • AddCake(name, price, cookingTime)
  • RemoveCake(name)
  • GetCake(name)

Every cake has name, price and cooking time. The list of cakes should be stored in the database.

Cake Order Service

Microservice with public GRpc API:

  • OrderCake(name)
  • CheckOrderStatus(statusId)

A list of the orders should be stored in the database. You can see the status of the order. The cake is selected by name (inside will be a lookup from the Assortment of Cakes service). Cake baking is performed in the background. Each service has its own database.

On application start, the baking process for new and unfinished orders restarts.

Technologies

  • Kotlin
  • Spring Boot
  • Maven
  • GRpc
  • Flyway
  • Mybatis
  • PostgreSQL
  • Docker
  • Docker Compose

Architecture Diagram

Mobile version

Run

mvmw package
docker-compose up -d --build

You can check running service instances in Eureka web interface: http://localhost:8761/

GRpc Client

Firstly, install grpcc npm package:

npm install -g grpcc

Then, you can call order service grpc api:

cd order-proto/src/main/proto/
grpcc -i -p ./CakeOrder.proto -a localhost:9090

client.orderCake({cakeName: "Butter"}, pr) // will return orderId

client.checkOrderStatus({orderId: YOUR_ORDER_ID}, pr) // will return order status

Or you can edit available cakes list:

cd assortment-proto/src/main/proto/
grpcc -i -p ./CakesAssortment.proto -a localhost:6565

client.addCake({name: "Napoleon", price: 1000, cookingTime: 180000}, pr)
client.removeCake({name: "Napoleon"}, pr)
client.getCake({name: "Napoleon"}, pr)
client.getCake({id: 1}, pr)

cakestore's People

Stargazers

 avatar

Watchers

 avatar

Forkers

dhealayna

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.