Create a BAPP - Step by Step tutorial

One of the core component of the OSP system is the possibility for everyone to create a personal app for sailing purpose.

But how create an app? Create an app for OSP is fast and simple. And in this tutorial i'm going to explain how to create it.

For explaination we use web.uniparthenope.it as host of us BAPP

First of all we must position in opt/fairwind directory

cd opt/fairwind

Now give command:

source etc/profile

with this command we set all environment variable and path for the creation of BAPP.

From this point can create all the BAPP that we need.

It's simple to set the basic app template

fairwind-bapp-create <nameOfBAPP> "Short description of BAPP"

Now the BAPP is ready and is situated in

cd lib/dev/apis/<nameOfBAPP>

and include simple code for testing. It's divided in two section:

  • Static section that contain the frontend of the BAPP
  • Code section that contain the core application

Static Section

Located in

cd <nameOfBAPP>/static

In this section we put all the content that are part of the GUI of OSP system. Are all written in html and javascript. We found in this directory two files: home.html and home.js and in this two files we put all the frontend part of us BAPP

Code Section

The code section is separated in file and directory

  • the __init__.py file that contain the classes that needs for execution of BAPP
  • the lib/ directory that contain all the classes code that are called in __init__.py

At the end of creation for debug the app or launch it we must return in:

cd opt/fairwind

and launch

./developer-run.sh

that run the server and initialize our app.

If we need to stop the application we must send a ctrl+z signal and then execute

./stop.sh

 that stop the app and release the socket in use.

English