Giter Site home page Giter Site logo

fraktalio / restaurant-demo Goto Github PK

View Code? Open in Web Editor NEW
61.0 3.0 15.0 20.1 MB

Axon demo - `Restaurant Management` Information System - A part of the systems landscape https://github.com/fraktalio/courier-demo, https://github.com/fraktalio/restaurant-demo, https://github.com/fraktalio/order-demo

License: Other

Kotlin 74.63% CSS 0.03% HTML 25.34%
event-sourcing cqrs ddd kotlin axon-framework event-modeling spring-boot demo-app microservices

restaurant-demo's Introduction

Restaurant - demo

CI with maven

Systems Landscape

The systems landscape consists of three systems order management, restaurant management and courier management

Customers use the web application to place food orders at local restaurants. Application(s) coordinates a restaurant/kitchen order preparation, and a network of couriers who deliver the orders.

Vision

Event Modeling is a method of describing systems using an example of how information has changed within them over time.

event modeling

Structure

The C4 software architecture model is a simple hierarchical way to think about the static structures of a software system in terms of containers, components and classes (or code).

A System Context diagram can be a useful starting point for diagramming and documenting a software system, allowing you to step back and look at the big picture.

landscape

Restaurant Management System

Managing restaurant menus and other information including location and opening hours. Managing the preparation of orders at a restaurant kitchen.

Vision

We zoom in to show the event model of the Restaurant Management System only:

event modeling

Specification by example (SBE) is a collaborative approach to defining requirements and business-oriented functional tests for software products based on capturing and illustrating requirements using realistic examples instead of abstract statements.

spec by example

Structure

Once you understand how your system fits in to the overall IT environment with a System Context diagram, a really useful next step can be to illustrate the high-level technology choices with a Container diagram:

containers diagram

Following on from a Container diagram showing the high-level technology decisions, you can then start to zoom in and decompose each container further:

components diagram

Canvas

Name: Restaurant Management
Description: Managing restaurant menus and other information including location and opening hours. Managing the preparation of orders at a restaurant kitchen.
Concepts: Architectural patterns: Technology:
  • Domain Driven Design
  • Event Driven Microservices
  • Eventsourcing
  • CQRS
  • Kotlin
  • Axon
  • Spring(Boot)
  • SQL(Postgres)
  • Docker
  • Testcontainers
  • Kubernetes
  • Prometheus
  • Grafana
  • Jaeger
Service API
Commands: Queries: Events published:
gRPC:
  • CreateRestaurantCommand
  • ActivateRestaurantMenuCommand
  • PassivateRestaurantMenuCommand
  • PlaceRestaurantOrderCommand
  • MarkRestaurantOrderAsPreparedCommand
gRPC:
  • FindRestaurantQuery
  • FindMenuQuery
  • FindAllMenusQuery
  • FindRestaurantOrderQuery
  • FindAllRestaurantsQuery
  • FindAllRestaurantOrdersQuery
gRPC:
  • RestaurantCreatedEvent
  • RestaurantMenuActivatedEvent
  • RestaurantMenuPassivatedEvent
  • RestaurantOrderPlacedEvent
  • RestaurantOrderPreparedEvent
  • RestaurantOrderRejectedEvent
Domain model:
  • Restaurant
  • RestaurantOrder
Dependencies:
Invokes Subscribes to
- -

Development

This project is driven using maven.

Run locally

Requirements

You can download a ZIP file with AxonServer as a standalone JAR. This will also give you the AxonServer CLI and information on how to run and configure the server.

Alternatively, you can run the following command to start AxonServer in a Docker container:

docker run -d --name axonserver -p 8024:8024 -p 8124:8124 axoniq/axonserver

Build & Test

./mvnw clean verify

to additionally run integration testcontainers tests (docker required):

./mvnw clean verify -DskipIntegrationTests=false

Run

./mvnw spring-boot:run

Run on Kubernetes cluster

Requirements

  • Kubernetes. It is included in the Docker on Mac (and Windows) binary so it installed automatically with it. After a successful installation, you need to explicitly enable Kubernetes support. Click the Docker icon in the status bar, go to “Preferences”, and on the “Kubernetes” tab check “Enable Kubernetes”.
  • Kubectl allows you to run commands against Kubernetes clusters. You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs

Build the docker image to local registry:

./mvnw clean verify jib:dockerBuild

Deploy:

kubectl apply -k .k8s/base

Delete:

kubectl delete -k .k8s/base
kubectl delete pvc --all

Continuously deploy with google skaffold

  • Skaffold is a command line tool that facilitates continuous development for Kubernetes applications.

Use skaffold dev to build and deploy your app every time your code changes:

$ skaffold dev

or activate observability profile, to enable metrics and tracing with Prometheus, Grafana and Jaeger:

$ skaffold dev -p observability

Deploy once

Use skaffold run to build and deploy your app once, similar to a CI/CD pipeline:

$ skaffold run

or activate observability profile, to enable metrics and tracing with Prometheus, Grafana and Jaeger:

$ skaffold run -p observability

References and further reading


Created with ❤️ by Fraktalio

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.