Skip to content

Installation

Installing BrisaBoards

BrisaBoards is a Ruby on Rails app. It can be run on a virtual machine (such as DigitalOcean or AWS), but can also un on a sufficiently powerful laptop or desktop. The requirements are:

  • Ruby version 2.5.1 with Rails 5.
  • PostgreSQL server 9 or higher (it uses array and jsonb column types).
  • Redis (optional, useful for live updates).

Full Installation

This is the full installation process for Ubuntu 18.04.

PostgreSQL

apt install postgresql-10

sudo su - postgres
# -d allows user to create databases, so rails can rake db:drop/db:create
createuser brisa-app -P -d
# If you don't use -d, create the database:
createdb -O brisa-app brisa-app

System Setup

sudo su -
apt-get update

sudo apt-get install build-essential bison openssl libreadline7 libreadline-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev autoconf libc-dev ncurses-dev automake libtool postgresql-client libpq-dev nodejs libgmp-dev redis
adduser brisa-app

App Setup

su - brisa-app
# RVM setup
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -sSL https://get.rvm.io | bash -s stable

source ~/.rvm/scripts/rvm
rvm autolibs disable
rvm install --default 2.5.1

# Brisa setup
# Download the brisaboards dist from https://brisaboards.com/downloads and extract:
tar xf brisaboards*.tar.gz

cd brisaboards/
cp templates/environment.default environment.local

# IMPORTANT: Edit environment.local and set the database password (and any other config options different from the defaults)

source ./environment.local
bundle install --without development test
./setup.sh
./add-user my@email.com --admin

# Check that it's working:
./serve.sh

# Rails will run on port 3000 of the IP of the machine.

System Auto-Start

To set it up to automatically start, you can add a file: /etc/systemd/system/brisa-app.service with this:

[Unit]
Description=Brisa Server

[Service]
Type=simple
User=brisa-app
PIDFile=/home/brisa-app/brisaboards/tmp/pids/puma.pid
WorkingDirectory=/home/brisa-app/brisaboards
ExecStart=/home/brisa-app/brisaboards/serve.sh
ExecReload=/bin/kill -s USR1 $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
TimeoutSec=15
Restart=always

[Install]
WantedBy=multi-user.target

Then run the following commands to enable the service and start it:

systemctl daemon-reload
systemctl enable brisa-app.service
systemctl start brisa-app

Web Server Request Forwarding

It is recommended that you run a frontend webserver such as nginx or Apache to forward requests to the backend. The easiest way is to setup a domain (such as brisa.my-site.com) and use a reverse proxy in that config to forward the requests to the backend.

Doing so allows you to do a few things:

  • SSL-enable your Brisa instance.
  • Make it accessible on port 80 and not expose the Rails server directly to the Internet.
  • Load balance if it becomes necessary.