Skip to content
Gustav Gybäck edited this page Mar 25, 2018 · 2 revisions

Welcome to the kons-screen wiki! Follow this link to view the instructions in Swedish.

This code is developed by F.dev to run the screen in Konsulatet. It's written to be implemented on a Raspberry pi with back-end support from our server. If you have any questions please feel free to contact our administrator at [email protected]

Table of Contents

Installation

The installation guide is written for you who runs a linux based operating system.

Install with setup.sh

To install the code extract the files somewhere, that directory is onwards called your-path. Open the terminal and navigate to ~/your-path/kons-screen/ and run:

    ./setup.sh
Follow the instructions given in the terminal if the installation wasn't successful.

Manual installation

Code that will be executed in the terminal will be written as:

*EXECUTABLE-CODE*
Following instructions assume that you are running python3.4+.

Check your python version with:

python --version</code>
Sometimes you find python3 by:
python3

Frontend

If you don't have nodejs or npm run the following:

sudo apt-get install nodejs
sudo apt-get install npm

Navigate to ~/your-path/kons-screen/frontend/ and execute:

npm install

Backend

To install all dependencies for back-end, app.py, run:

    pip3 install -r requirements.txt

If the command pip3 isn't recognised run the same code but with pip instead. If that doesn't work you need to install pip with:

    sudo apt-get install python-pip

or

sudo apt-get install python3-pip

Usage

Frontend

To preview index.html you need to navigate to ~/your-path/kons-screen/frontend/ and run:

npm start
This will host the app at localhost:3000. To render data you will need to start the back-end, app.py according to the instructions bellow.

Backend, app.py

The back-end applications default is to run on a local database. app.py has two options:--remotedb and --debug.

  • To connect to the remote database at https://f.kth.se instead of your local one you add --remotedb
  • The debug version --debug, allows you to render small changes without restarting app.py
Example:
python app.py --debug --remotedb

Navigation

Clone this wiki locally