Brewpi Software Architecture

http://forum.brewpi.com/uploads/FileUpload/9a/163c168a57e52c68a868c96334d5e5.png

This is the block diagram that I drew up probably at least 2 years ago. We very much want to build this.

The key steps are:

  1. build a mock REST endpoint (service interface - ideally in Python) that can be used to provide the backend that web developers code the UI against.

  2. in parallel, implement the web UI and full version of the service interface.

If you can help out with either of these, please get in touch!

1 Like

As mentioned elsewhere, I would like to help where I can, which could probably be anywhere except for the firmware stuff.

Are you planning to do a full rewrite, or will you be reusing stuff from the existing php codebase?

Great that you want to help.

It will be a full rewrite, because we’d like to get rid of PHP and do the entire web server in Python.

One of the first steps, that would be easy to investigate on the current codebase would be to start logging data to InfluxDB and display it with Grafana. The first hurdle is to compile Influx for 32bit ARM.

Elco & MDMA

superweird idea here;
have you ever thought of launching a kickstarter campaign for a small amount of money, then using that money to hire a full time software dev for 4 months or so to complete the coding? I think if you set up a simple campaign with simple goals, you’d be able to get both exposure to your webshop and to BrewPi as well as scrounch up the money… i would sponsor…
be happy to help you run the campaign…

1 Like

Here the instruction to compile and install influxDB on Raspberry Pi:

###1. InfluxDB on Raspberry Pi

####a) install gvm

sudo apt-get install bison
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
source ~/.gvm/scripts/gvm

####b) follow https://github.com/influxdb/influxdb/blob/master/CONTRIBUTING.md#installing-go

gvm install go1.5
vm use go1.5 --default

####c) install fpm

sudo apt-get install ruby-dev rpm
sudo gem install fpm

####d) follow the first code snippet of https://github.com/influxdb/influxdb/blob/master/CONTRIBUTING.md#project-structure

export GOPATH=$HOME/gocodez
mkdir -p $GOPATH/src/github.com/influxdb
cd $GOPATH/src/github.com/influxdb
git clone https://www.github.com/influxdb/influxdb

####e) Create installation package

cd influxdb
NIGHTLY_BUILD=false
./package.sh 0.9.4

####f) Install package

sudo dpkg -i influxdb_0.9.4_armhf.deb

####g) Start influxdb

sudo update-rc.d influxdb defaults
sudo update-rc.d influxdb enable
sudo /etc/init.d/influxdb start

####h) Create database

/opt/influxdb/influx
CREATE DATABASE xxxxxx
exit

Please verify and let me know if it works.

1 Like

And here are the instructions to get Grafana compiled and installed on Raspberry Pi.
If you do these instruction after installing InfluxDB go is already installed. If not see previous post section a) and b)

###1. Grafana on Raspberry Pi

####a) Install latest nodejs

sudo su -c 'echo “deb https://deb.nodesource.com/armv6l-node/ weezy main” >> /etc/apt/sources.list’
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install nodejs

####b) Get and build Grafana

export GOPATH=/home/pi/gocodez
mkdir -p $GOPATH/src/github.com/grafana
cd $GOPATH/src/github.com/grafana
git clone https://www.github.com/grafana/grafana
cd $GOPATH/src/github.com/grafana/grafana
go run build.go setup
$GOPATH/bin/godep restore
go run build.go build

sudo npm config set registry http://registry.npmjs.org/
sudo npm install
sudo npm install -g grunt-cli
grunt

####c) Setup Grafana application folder

sudo addgroup --system “grafana” --quiet
sudo useradd -N -M --system -g grafana -s /bin/false grafana

sudo mkdir /opt/grafana
sudo cp -R bin/ /opt/grafana
sudo cp -R conf/ /opt/grafana
sudo cp -R public/ /opt/grafana
sudo cp -R vendor/ /opt/grafana
sudo cp packaging/deb/init.d/grafana-server /etc/init.d/
sudo cp packaging/deb/default/defaults.ini /etc/default/grafana-server
sudo chown -R grafana:grafana /opt/grafana

####d) Change configuration file
Edit /etc/default/grafana-server:
Change GRAFANA_HOME=/opt/grafana
Change CONF_DIR=/opt/grafana/conf
Change CONF_FILE=/opt/grafana/conf/defaults.ini

Edit /etc/init.d/grafana-server:
Change GRAFANA_HOME=/opt/grafana
Change DAEMON=/opt/grafana/bin/$NAME

####e) Enable and start service

sudo update-rc.d grafana-server defaults
sudo update-rc.d grafana-server enable
sudo /etc/init.d/grafana-server start

1 Like