User Tools

Site Tools


en:resources:app

App Materials

The Inform@Risk Smartphone App

The smartphone app of the project Inform@Risk aims to both distribute information about a variety of topics concerning current risk status, sensor values and general project information. It was developed using the Framework7 cross platform framework and is supplied with data by an Apache2 web server running a Laravel installation.

This page contains instructions for setting up development environments on either Debian based Linux distributions or MacOS and only contains instructions specific to the project, i.e. the correct version of Android to compile against must be present in the operating system. Packages were installed via homebrew on Mac.

A more detailed explanation of individual software components and structure is available via the Overview PDF File

Both components of the app stack are licensed under the MIT License

Smartphone App

https://mygit.th-deg.de/tcf-public/informatrisk_app

Install global packages:

npm install -g framework7-cli
npm install -g cordova
apt-get install openjdk-8-jdk

It might be necessary to manually set JAVA_HOME and/or ANDROID_HOME depending on your operating system

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/
export ANDROID_HOME=$HOME/Android/Sdk

In project directory:

npm install

Compiling and launching application:

npm run build-cordova-android

and then either of the 2 following

framework7 cordova run android
adb install -r /home/sschroeck/InformAppRisk/TGEO_InformAppRisk/cordova/platforms/android/app/build/outputs/apk/debug/app-debug.apk #path can be found in output of build command

Webserver

https://mygit.th-deg.de/tcf-public/informatrisk_server

Necessary global packages (replace PHP version with the correct one for your desired Laravel Version)

sudo apt-get install postgresql-12
sudo apt-get install apache2 libapache2-mod-php7.4 php7.4 php7.4-xml php7.4-gd php7.4-opcache php7.4-mbstring php7.4-pgsql
sudo apt-get install postgis #should automatically install 'postgresql-12-postgis' as well
sudo apt-get install imagemagick
sudo apt-get install composer

Database setup:

sudo -u postgres psql

CREATE USER informatrisk_user WITH PASSWORD 'herpderp';
CREATE DATABASE informatrisk OWNER informatrisk_user;
\c informatrisk
CREATE EXTENSION postgis;

Web server setup and example config:

sudo openssl req -x509 -nodes -days 700 -newkey rsa:2048 -keyout /etc/ssl/private/InformAtRisk.key -out /etc/ssl/certs/InformAtRisk.crt
/etc/apache2/sites-enabled/{your used site configuration}.conf
NameVirtualHost *:8070
Listen 8070
<VirtualHost *:8070>
        Serveradmin admin@admin.de
        DocumentRoot /var/www/InformAppRisk_Webserver/public
        ServerName 192.168.83.198/informatrisk
        ServerAlias www.laravel.dev

        <Directory /var/www/InformAppRisk_Webserver/public/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
                Require all granted
        </Directory>

        SSLEngine on
        SSLCertificateFile /etc/ssl/certs/InformAtRisk.crt
        SSlCertificateKeyFile /etc/ssl/private/InformAtRisk.key

        LogLevel debug
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

UBUNTU

sudo a2enmod ssl
sudo a2enmod header
sudo a2enmod rewrite

MAC

  You need to manuall activate the specific packages installed in step 1 by editing httpd.conf
  Also follow the instructions at the bottom of the PHP homebrew page

Web project setup in project directory:

composer install
php artisan storage:link

Create the following folders if they do not exist yet: </code> create public/storage create public/storage/uploads copy public/storage/tiles sudo chmod 777 public/storage/uploads/

<code>
php artisan migrate:fresh
php artisan db:seed
php artisan passport:install
php artisan key:generate

Create a file named '.env' according to the template of '.env.example' and fill in relevant information like app name and database connection parameters

Copy the Firebase credential file into config folder and add Firebase config to .env

FIREBASE_CREDENTIALS=config/informatrisk-abc16-firebase-adminsdk-y5nqn-89585b4ecd.json
FIREBASE_DATABASE_URL=https://informatrisk-abc16.firebaseio.com

Sensor Communication API

HTML based interactive API Download

en/resources/app.txt · Last modified: 2023/07/25 11:59 by s-schroeck