Code Monkey home page Code Monkey logo

sushi-bar-be's Introduction

sushi-bar-BE

Back End of the sushi bar application.

sushi-bar

Requirement

Management system of a virtual sushi booth in which each customer can consult the online menu; once registered can place the order, indicate the table to be served and pay the bill. Once the bill has been paid, the cook appears with the order to cook and serve to the customer his dinner / lunch. A room administrator has a dashboard available to manage users, customize and compose the menu with the prices of the courses, supervise the work of the cook.

Prerequisites

Architecture (draft)

Based on Apache Kafka & spring boot.

Architecture Draft

Kafka (docker)

Starting Kafka

$ docker compose up -d

Stopping Kafka

$ docker compose down

Connecting to the docker container

$ docker exec -it sushibar-backend-kafka_kafka_1  bash (For Windows add winpty before docker)
$ /bin/kafka-topics --list --bootstrap-server localhost:29092
$ /bin/kafka-console-consumer --bootstrap-server localhost:29092 --topic orders --from-beginning

Kafka-Mongo Connector

Connect to the docker kafka connector instance:

$ docker exec -it sushibar-backend-kafka_connect_1  bash

From the docker container install the kafka connector:

$ ./confluent-hub install --no-prompt mongodb/kafka-connect-mongodb:latest

Configure the kafka connector for the specific topic with postman.

{"name": "mongo-sink-connector",
      "config": {
         "connector.class":"com.mongodb.kafka.connect.MongoSinkConnector",
         "connection.uri":"mongodb://root:rootpassword@mongodb_container",
         "database":"order",
         "collection":"sdp_order",
         "topics":"orders",
         "key.converter.schemas.enable":"true",
         "value.converter.schemas.enable": "true",
     "key.converter":"io.confluent.connect.avro.AvroConverter",
     "key.converter.enhanced.avro.schema.support":true,	
         "key.converter.schema.registry.url": "http://schema-registry:8081",
          "value.converter.schema.registry.url": "http://schema-registry:8081",
          "value.converter.enhanced.avro.schema.support":true,
         "value.converter": "io.confluent.connect.avro.AvroConverter"
         }
     }

Troubleshooting

Schema issue

org.apache.kafka.common.errors.InvalidConfigurationException: Schema being registered is incompatible with an earlier schema; error code: 409

workaround

Set the compatibility mode of the topic to NONE. compatibility

Compass (MongoDB)

Compass connection Compass data

Credits

3 Simple Steps to set up Kafka locally using Docker

Baeldung Kafka

OpenAPI (backend app)

http://localhost:8080/swagger-ui/index.html

Original Requirement (italian)

progetto: gestione di un sushi bar

consegna: 8 settimane divisi in sprint di 2 settimane ciascuno

descrizione: sistema di gestione di un baracchino del sushi virtuale in cui ogni cliente può consultare il menù online; una volta registrato può effettuare l'ordine, indicare il tavolo a cui esssere servito e pagare il conto. Una volta pagato il conto al cuoco compare la comanda da cucinare e servire al cliente la sua cena/pranzo. Un amministratore del locale ha a disposizione una dashboard per gestire gli utenti, personalizzare e comporre il menù con i prezzi delle portate, supervisionare il lavoro del cuoco.

Piano di consegna.

sprint 1

  • registrazione utenti (nominativo, email, password) con conferma via mail
  • accesso amministratore da backend
  • accesso cuoco da backend
  • home page con info del ristorante

sprint 2:

  • gestione pietanze e costi da parte dell'amministratore (nome, costo, quantità, descrizione, foto)
  • navigazione del menù da parte del cliente e possibilità di compore il carrello con le pietanze di cena/pranzo

sprint 3:

  • processo di pagamento fake per utenti registrati e invio della comanda al cuoco
  • gestione delle comande da parte del cuoco: presa in carico e completamento (fake)
  • avviso al cliente (tramite mail) che la sua cena è pronta

sprint 4:

  • gestione utenti da parte dell'aministratore
  • cambio password per password dimenticata

sushi-bar-be's People

Contributors

dependabot[bot] avatar egch avatar sarthak-97 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ipadawan

sushi-bar-be's Issues

Cook - basic use case

  • listen for the order in the orders topic
  • simulate a delay representing the time spent for the meal preparation
  • publishing the processed order in the corresponding processed-order topic

Business case processing order

Once the order is submitted figured out how to process the order:

  • should be handled by a listener or pick it up from another rest api
  • how to transform it and to submit as a meal or a task for the cook

to complete the cook app

Basic functionalities for the cook app:

  1. process the orders from the topic order
  2. submit a new message in the topic meal

User Registration

As a new user, I want to register by creating a username so that the system can remember me and my data.
Authentication should be based on an external identity provider, we could start with gmail.

source

image

To fix issue with @SpringBootTest

Bootstrap issue while executing SpringBootTest

2023-01-14 19:42:11.175 WARN 4987 --- [| adminclient-1] org.apache.kafka.clients.NetworkClient : [AdminClient clientId=adminclient-1] Connection to node -1 (localhost/127.0.0.1:29092) could not be established. Broker may not be available. 2023-01-14 19:42:12.390 INFO 4987 --- [| adminclient-1] org.apache.kafka.clients.NetworkClient : [AdminClient clientId=adminclient-1] Node -1 disconnected.

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.