Skip to content

akvo/rtmis

Repository files navigation

RTMIS

Build Status Build Status Repo Size Languages Issues Last Commit Coverage Status Coverage Status

Real Time Monitoring Information Systems

Prerequisite

  • Docker > v19
  • Docker Compose > v2.1
  • Docker Sync 0.7.1

Development

Environment Setup

Expected that PORT 5432 and 3000 are not being used by other services.

.env

DB_HOST=db
DB_PASSWORD=password
DB_SCHEMA=rtmis
DB_USER=akvo
DEBUG="True"
DJANGO_SECRET=local-secret
GOOGLE_APPLICATION_CREDENTIALS
MAILJET_APIKEY
MAILJET_SECRET
WEBDOMAIN
POSTGRES_PASSWORD=password
PGADMIN_DEFAULT_EMAIL=dev@akvo.org
PGADMIN_DEFAULT_PASSWORD=password
PGADMIN_LISTEN_PORT="5050"
IP_ADDRESS="http://<your_ip_address>:3000/api/v1/device"
APK_UPLOAD_SECRET="123456789AU"
STORAGE_PATH="./storage"

Start

For initial run, you need to create a new docker volume.

./dc.sh up -d
docker volume create rtmis-docker-sync

Note: On some linux systems, you may need to change the permissions of the directory where the volume is stored.

The development site should be running at: localhost:3000. Any endpoints with prefix

Network Config:

Add New User and Seed Master Data:

Once the containers are up and running, you can seed the necessary data by running the following command:

./dc.sh exec backend ./seeder.sh

The script will prompt you for various actions related to data seeding such as:

  • seed administrative data
  • add a new super admin
  • seed fake users
  • seed forms
  • and seed fake data

Answer each prompt by entering 'y' or 'n' followed by the Enter key.

./dc.sh exec backend python manage.py generate_views

This command will generate materialized view for DataCategory model

Log

./dc.sh log --follow <container_name>

Available containers:

  • backend
  • frontend
  • mainnetwork
  • db
  • pgadmin

Stop

./dc.sh stop

Teardown

./dc.sh down -t1
docker volume rm rtmis-docker-sync

Mobile App Development

For initial run, you need to create a separate docker volume.

docker volume create rtmis-mobile-docker-sync
./dc-mobile.sh up -d
  1. Install the Expo Go app from Playstore
  2. Connect your android to the same wireless network as your machine.
  3. Open The Expo Go
  4. Enter URL Manually: Your_IP_Address:19000

Teardown Mobile App

./dc-mobile.sh down -t1

Production

export CI_COMMIT='local'
./ci/build.sh

Above command will generate two docker images with prefix eu.gcr.io/akvo-lumen/rtmis for backend and frontend

docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d

Network config: nginx