---
description: How the MWPA software(s) is structured and works for M.E.E.R. e.V.
---

# Construction

<figure><img src="https://2741709044-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRXRhj3GjfGEkDKgQ1elh%2Fuploads%2F2DorP0Q7GyeEGGhetYjP%2Fwhale-ico.png?alt=media&#x26;token=2cd29add-eed7-45ed-8667-2ecf3d76ef4c" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
This documentation is a technical overview!
{% endhint %}

## Two parts of MWPA

MWPA is divided into two parts.  The mobile app on your cell phone or tablet. And the server that collects the data.

<figure><img src="https://2741709044-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRXRhj3GjfGEkDKgQ1elh%2Fuploads%2FaM4iwsyRYWL4F5rzKExW%2Fmeer_appparts.png?alt=media&#x26;token=4a09b7ea-7b8f-4150-8dc3-76f6531ef804" alt=""><figcaption><p>Two parts of MWPA.</p></figcaption></figure>

* MWPA - Server: [https://github.com/M-E-E-R-e-V/mwpa](https://github.com/M-E-E-R-e-V/mwpa)
* MWPA - App: [https://github.com/M-E-E-R-e-V/mwpa-app](https://github.com/M-E-E-R-e-V/mwpa-app)

<figure><img src="https://2741709044-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRXRhj3GjfGEkDKgQ1elh%2Fuploads%2F7bRbuxAOB0wgTZIInfQK%2FNewsbeitrag_App.png?alt=media&#x26;token=6d018a22-27ae-4132-bf43-2717f79447d7" alt=""><figcaption><p>Tablet for the MWPA App (Outdoor device).</p></figcaption></figure>



***

## Sighting data flow

The data (sightings, tracking) is recorded on the boat using the app for the tablet. Back on site in the office (at home, etc.), the data is then transferred to the Internet (with WiFi) to the MWPA server (our MWPA Server hosting). On the server the data is collected, validated, analyzed, converted and can be exported.

<figure><img src="https://2741709044-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRXRhj3GjfGEkDKgQ1elh%2Fuploads%2FkkRtPJfCGek56anGkdhA%2Fsighting_flow.png?alt=media&#x26;token=72043ef0-1fcb-443d-b41f-9b3c6861ca85" alt=""><figcaption><p>Sighting data flow.</p></figcaption></figure>



***

## MWPA Server structure

The sightings data and tracking data are sent to the backend via [HTTPS](https://de.wikipedia.org/wiki/Hypertext_Transfer_Protocol_Secure) protocol. The backend saves this data in the database (images are stored in the file store). The backend takes care of the processing (collection, analysis, conversion and export creation). The frontend (web portal in the browser) can query data on the backend and trigger actions in the backend (exports, etc.)

<figure><img src="https://2741709044-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRXRhj3GjfGEkDKgQ1elh%2Fuploads%2F6hnkWcSNuqnvbRqBbpJM%2Fmwpa_server_structure.png?alt=media&#x26;token=44f89bf3-3e70-4e23-9018-28d5110c23f1" alt=""><figcaption><p>Structure of MWPA server.</p></figcaption></figure>



***

## Structure at M.E.E.R. e.V.

The structure at M.E.E.R. e.V. was set up as follows:

<figure><img src="https://2741709044-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRXRhj3GjfGEkDKgQ1elh%2Fuploads%2FkFxBMynM0IAKJ9oiEh4C%2Fmwpa_server_system.png?alt=media&#x26;token=cf62a5cc-cc1c-4055-b0a7-31cd7de61689" alt="" width="278"><figcaption><p>Server system on running MWPA server.</p></figcaption></figure>

MWPA Server is installed in a container on a Virtual Environment ([Proxmox](https://www.proxmox.com/de/)). The container has its own private IP and can be accessed in the private network. The Virtual Environment can create a backup of the container every evening.&#x20;

The MWPA server is located in a [Docker](https://www.docker.com/) container in the container. Using an image of the MWPA server, one version can be quickly exchanged for a new version of the MWPA server.

To ensure that MWPA can be accessed securely from the Internet, it is released via [HTTPS](https://de.wikipedia.org/wiki/Hypertext_Transfer_Protocol_Secure). This is done via [FlyingFish](https://flying-fish.gitbook.io/flyingfish/) (a proxy manager ([reverse proxy](https://de.wikipedia.org/wiki/Reverse_Proxy)), another software that was developed, among other things, to solve problems for the MWPA software).

* FlyingFish: [https://github.com/stefanwerfling/flyingfish](https://github.com/stefanwerfling/flyingfish)

<figure><img src="https://2741709044-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRXRhj3GjfGEkDKgQ1elh%2Fuploads%2FneEyaMDalzRmEIJ5dOAW%2Fmwpa_server_request.png?alt=media&#x26;token=3264daf7-a63a-4665-a283-263edbab8b33" alt=""><figcaption><p>Server and network structure + Request way. </p></figcaption></figure>

The [FlyingFish](https://flying-fish.gitbook.io/flyingfish/) uses [LetsEncrypt](https://letsencrypt.org/de/) to issue a valid certificate, which can be used by the mobile app without any problems and allows the front end in the browser to run in a secure connection.

<figure><img src="https://2741709044-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRXRhj3GjfGEkDKgQ1elh%2Fuploads%2FQy4pLAcVFiXvFW1PCO39%2Fmwpa_certificate.png?alt=media&#x26;token=254e9a85-1b49-4221-bc7d-b9fb313f4f1b" alt=""><figcaption><p>Certificate for HTTPS.</p></figcaption></figure>



***

## Data verification

An important part of working with scientific data is the correctness of the data.

A data check is already carried out both during data recording (mobile device) and during data collection (backend). That the most important fields are set in order to be able to record a sighting.

<figure><img src="https://2741709044-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRXRhj3GjfGEkDKgQ1elh%2Fuploads%2F6TIAgRmOFLjTdrDz92vZ%2Fmwpa_dataverification.png?alt=media&#x26;token=8d4e45d7-1865-43fc-91e7-c4c5078ead67" alt=""><figcaption><p>Step 1 of Data verification.</p></figcaption></figure>

According to this check, a sighting is already displayed as <mark style="background-color:yellow;">yellow</mark>/<mark style="background-color:red;">red</mark> in the mobile app. The person entering the data can immediately see and correct the error. This sighting is also immediately marked in red in the portal.

* <mark style="background-color:yellow;">**Yellow**</mark>: The sighting is missing data/incomplete, but the sighting is still running (the sighting end time has not yet been set).
* <mark style="background-color:red;">**Red**</mark>: The sighting has ended, the end of the sighting time has been set, but data is still missing.

<figure><img src="https://2741709044-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRXRhj3GjfGEkDKgQ1elh%2Fuploads%2Fd6qUXkY5FsVxRvaTSBHF%2Fmwpa_dataverification_errors.png?alt=media&#x26;token=45931ea6-353e-4896-a966-8dccae9a1a69" alt=""><figcaption><p>Sighting with missing and incorrect data.</p></figcaption></figure>

***

## More data for the sightings

Additional data about the viewing is collected in a separate table using API via third-party services (tested services). Using existing data (e.g. time/location), further data can be collected (e.g. sea depth, weather, etc.).

<figure><img src="https://2741709044-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRXRhj3GjfGEkDKgQ1elh%2Fuploads%2F8jgVWLoPYwsth0ZJAAMM%2Fmwpa_sightingextend.png?alt=media&#x26;token=7b3429a7-a068-4d5c-9b34-3957e8f50c95" alt=""><figcaption><p>Cronjob call over API more sighting data.</p></figcaption></figure>

A cron job (a service that starts after a certain time) is used to check new sightings and query additional data using the provider's API. This data is saved in an extra table with a reference to the sighting.

***

## Instances of MWPA at M.E.E.R. e.V.

M.E.E.R. e.V. has several instances of MWPA Server (backend and database) to record sightings:

* **Main**: In the main instance, the guides record the sightings which are later used for evaluation/exports etc.
* **Courses**: A separate database was created specifically for the [practical courses](https://m-e-e-r.de/en/experience/practicalcourses/). Participants can practice data collection here in parallel and later compare it with the main MWPA.
* **Demo**: This instance is used to check the app without the data from M.E.E.R. e.V. to release. This is an important part so that Google can test the app so that it can later publish the app in the app store.
* **Dev**: A version that is located locally on the developer's computer. This is where errors are checked, or new functions are implemented and tested.



<figure><img src="https://2741709044-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRXRhj3GjfGEkDKgQ1elh%2Fuploads%2FqtICxcDAO3KG9THEnt1F%2Fmwpa_instances.png?alt=media&#x26;token=b687d90c-d1fd-4bf1-970d-5eeac6546d64" alt=""><figcaption><p>M.E.E.R. e.V. MWPA instances.</p></figcaption></figure>



***

## Team structure & Version Release

The development of the software is one of many projects at M.E.E.R e.V. Short, clear communication channels provide quick opportunities for action for requests for new functions or for reporting errors. The tasks are recorded in GitHub in a weekly meeting (with Tina and more and more Rolf) about requirements and problems.

<figure><img src="https://2741709044-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRXRhj3GjfGEkDKgQ1elh%2Fuploads%2FIx4641alhFJip0DP3Gz5%2Fmwpa_team.png?alt=media&#x26;token=f46b79ab-da1d-4018-b9fc-8eeb848aeeba" alt=""><figcaption><p>Dev-Team.</p></figcaption></figure>

If there is a problem on the boat, Rolf gets feedback from the guide (end user). Rolf (from [Oceano](https://whalewatching-gomera.com/)) passes on problems and questions to Tina & Stefan. Tina and Stefan discuss the requirements/data and further development of MWPA. Inquiries from Fabian/M.E.E.R. team will also be discussed additionally (new requirements).

#### Tests of new versions:

Tina tests the new versions of MWPA and gives feedback on errors that are then corrected by Stefan. Then there is another test run. Once the errors have been fixed, the version can be released. The [new version is then installed on the tablet](https://m-e-e-r-e-v.gitbook.io/mwpa-app/mwpa-mammal-watching.-processing.-analysing./update-and-debugging) with Rolf. Innovations are then discussed together (user handling).

<figure><img src="https://2741709044-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRXRhj3GjfGEkDKgQ1elh%2Fuploads%2FOfJ44dGuqelkVfOQ5HVv%2Fmwpa_release_flow.png?alt=media&#x26;token=8b8d99c1-43f5-4265-b31c-e91b40c5b470" alt=""><figcaption><p>Flow for new version release.</p></figcaption></figure>
