I started working on this small spare-time project after attending Fred George's talk: "IoT and MicroServices in the Home". The talk is available on YouTube and it's strongly recommended! Another similar talk is Perryn Fowler's "Microservices and IoT: A Perfect Match", also available on YouTube. More details are available in the blog post I wrote about it, here.
This repository is composed by a RabbitMQ server (the event stream), and three
Rails 5 apps, mimicking a Sales UI, the Warehouse app and a Dashboard. All
these components can be managed throught the scripts stored in /bin
.
This folder contains the Dockerfile and the commands required to build and manage a container with a RabbitMQ server instance.
Docker container is based on Ubuntu 16.04. To build the container run:
./bin/rabbit build
Once the container has been built, it is possible to run it, stop it, or ask for the status, with:
./bin/rabbit start | stop | status
The start
command will try to run the Docker container if this does't exist
yet, otherwise it will restart the existing one.
RabbitMQ has a management web interface, with no default users enabled. To create a user, simply run:
./bin/rabbit add_user my_username my_password
After that, navigate to http://localhost:15672/ and use the newly created credentials to login.
build
: Build the Docker imagestart
: Run RabbitMQ on http://localhost:15672/stop
: Stop RabbitMQstatus
: Verify the status of RabbitMQ serveradd_user <USR> <PWD>
: Add a new with to the RabbitMQ management console
Each Rails app is Dockerized through Docker Compose, with a web
and a db
volume. Apps are managed through the simon_says
script, e.g.
./simon_says start sales
will start the main sales app and its DB.
start
: Starts theinitdb
: Initialize 's DBresetdb!
: Reset 's DB (all existing data will be erased!)sync
: Synchronize DB with RabbitMQ history
dashboard
: Dashboardsales
: EdisonCarswarehouse
: Warehouse