====== 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 [[https://framework7.io/|Framework7]] cross platform framework and is supplied with data by an Apache2 web server running a [[https://laravel.com/|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 {{app_technical_overview.pdf|Overview PDF File}} Both components of the app stack are licensed under the [[https://opensource.org/license/mit/|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 Serveradmin admin@admin.de DocumentRoot /var/www/InformAppRisk_Webserver/public ServerName 192.168.83.198/informatrisk ServerAlias www.laravel.dev Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all Require all granted 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 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: create public/storage create public/storage/uploads copy public/storage/tiles sudo chmod 777 public/storage/uploads/ 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 {{Informatrisk_API.zip|Download}}