Giter Club home page Giter Club logo

brewdis's Introduction

Brewdis

Real-time inventory demo based on data from https://brewerydb.com.

Tech Stack

  • Spring Boot
  • Gradle 6.8.3
  • Kordamp Gradle plugins 0.46.0.
  • Redis
  • RediSearch

Architecture

image

Run the demo

git clone https://github.com/redis-developer/brewdis.git
cd brewdis
docker-compose up

Access the demo at http://localhost

Demo Steps

Products

Launch redis-cli

Show number of documents in RediSearch index:

FT.INFO products

Run simple keyword search:

FT.SEARCH products chambly

TIP: name, description, breweryName are phonetic text fields so you will notice results containing words that sound similar.

Run prefix search:

`FT.SEARCH products chamb*`
  • Open http://localhost[]
  • Enter a simple keyword search, e.g. chambly. Note highlighted matches.
  • Expand the filter panel by clicking on the filter button (image:https://pic.onlinewebfonts.com/svg/img_3152.png[width=24])
  • Enter some characters in the Brewery field to retrieve suggestions from RediSearch (e.g. Unib)
  • Click the Submit button
  • Refine the search by adding a constraint on the alcohol content (ABV field):
`@abv:[7 9]`
  • Change the sort-by field to ABV and click Submit

Availability

Click Availability on one of the search results. This takes you to the availability map for that product. . The map shows stores near you where the selected product is currently available. . Stores in green have more than 20 in stock, amber: 10 to 20, red: less than 10

Inventory

  • Click on a store and then on the link that pops up
  • This takes you to the real-time inventory for that store
  • The Available to Promise field is updated in real-time based on current difference between supply (On Hand) and demand (Reserved + Allocated + Virtual Hold).

Configuration

The app server is built with Spring Boot which can be configured different ways: Spring Boot Externalized Configuration

Depending on the way you're running the demo you can either:

java -jar brewdis.jar --spring.redis.host=localhost --spring.redis.port=6379 ...
  • use environment variables:
export spring.redis.host=localhost
export spring.redis.port=8080
export ...
java -jar brewdis.jar

Here are the most common configuration options for this demo:

  • spring.redis.host: Redis database hostname (default: localhost)
  • spring.redis.port: Redis database port (default: 6379)
  • stomp.host: Websocket server hostname (default: localhost)
  • stomp.port: Websocket server port (default: 8080)
  • stomp.protocol: Websocket protocol (default: ws). Use wss for secure websockets
  • inventory.generator.rate: duration in millis the generator should sleep between inventory updates (default: 100)
  • availability-radius: radius to find in-store availability (default: 25 mi)

brewdis's People

Contributors

jruaux avatar ajeetraina avatar github-actions[bot] avatar amiramm 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.