Project Strategy: MVP - mcannamela/brew-control-dash GitHub Wiki
Overview
Basics
The brewery comprises some physical items governed by an Arduino Ethernet. The overall idea is to ask the Arduino for the state, interpret that state as physical quantities, and show those quantities in a browser on graphs that will be continuously updated. The existing https://github.com/mcannamela/brew-control repo knows how to talk to the Arduino, convert its raw outputs to physical quantities, and tell it what to do. We will want to lean on that eventually, but first we can focus on getting this project up and running with fakes. That code being old and dumb, this new repo will thus focus on the greenfield components: serving a web application and displaying the information in a pleasing way.
Can-kicking
Integrating with the legacy code is being deferred. Another "later" thing is to be able to deploy this project "for reals" and be able to see what the brewery is doing from the public internet. Finally, the application will be stateless to start.
Acceptance
When we can docker-compose up
in this repo, navigate to localhost/blah and see fake graphs of temperature continuously updating, we will be ready to come back to our kicked-cans, starting with rigging in the real communication with the Arduino via integration with brew-control
Milestones
Environment and CI Setup
We'll use Github actions for CI. We'll use poetry to wrangle dependencies. We'll use Docker to package it up and docker-compose to orchestrate the containers. We'll build and push Docker images to Dockerhub for "deployment".
The nominal plan is to use Dash to dodge writing any javascript, which means that Flask will be the web framework. It seems like https://dash.plotly.com/live-updates is the exact use case we want, so we can feel confident these choices are going to work for us.
This milestone will be complete when:
- pushing to github triggers unit tests to run
- merging a branch to master builds the Docker image and pushes it to Dockerhub
- running
docker-compose up
in the repo starts a web server that shows a "hello world" page via Flask and Dash
Fake graphs
We'll use plotly to make graphs.
The idea is to follow e.g. https://dash.plotly.com/live-updates and adapt it to the eventual shape of our data (see https://github.com/mcannamela/brew-control/blob/67cb7cd3bd73fe70f199d630c4f96b55a2a1d682/brew_control_client/brew_state.py#L28).
Instead of worrying about rehabilitating brew-control to the point where we can use it as a library, the server will randomly generate a brew state and plot it.
The milestone will be complete when:
- the app shows a continuously updated graph of brew temperatures powered by random noise
Integrate brew-control
The final milestone in our MVP will be rehabilitating brew-control such that this project can use it to get real data from the Arduino.
On the brew-control side, we'll use poetry to publish the packages we need from it. On the brew-control-dash side, we'll need to install brew-control as a library and replace our fake brew state generator with the real deal.
This milestone will be complete when:
- the app shows a continuously updated graph of real brew temperatures