Real Time Monitoring Information Systems
- Docker > v19
- Docker Compose > v2.1
- Docker Sync 0.7.1
Ensure that PORT 5432 and 3000 are not being used by other services.
Copy env.example to create a .env file. Here’s what it should look like:
.env
APP_NAME="Akvo MIS"
APP_SHORT_NAME="akvo-mis"
APK_NAME="MIS Mobile"
APK_SHORT_NAME="mis-mobile"
DB_HOST=db
DB_PASSWORD=password
DB_SCHEMA=mis
DB_USER=akvo
DEBUG="True"
DJANGO_SECRET=local-secret
GOOGLE_APPLICATION_CREDENTIALS
MAILJET_APIKEY
MAILJET_SECRET
WEBDOMAIN
EXPO_TOKEN="<<your secret expo token>>"
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"
SENTRY_DSN="<<your sentry DSN for BACKEND>>"
SENTRY_MOBILE_ENV="<<your sentry env>>"
SENTRY_MOBILE_DSN="<<your_sentry_mobile_DSN>>"
SENTRY_MOBILE_AUTH_TOKEN="<<your_sentry_mobile_auth_token>>"You can generate a Sentry auth token by following this official Sentry documentation.
For initial run, you need to create a new docker volume.
./dc.sh up -ddocker volume create akvo-mis-docker-syncNote: 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
^/api/*is redirected to localhost:8000/api^/static-files/*is for worker service in localhost:8000
Network Config:
- setupProxy.js
- mainnetwork container setup
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.shThe 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
Answer each prompt by entering 'y' or 'n' followed by the Enter key.
Default Fake User's password: Test#123
Generate QR Code for Mobile App Download:
To generate a QR code image for the mobile app download link, run:
./dc.sh exec backend python manage.py generate_qr_codeThis generates a QR code PNG image at storage/images/download-app.png encoding the default URL (WEBDOMAIN/app).
To specify a custom URL:
./dc.sh exec backend python manage.py generate_qr_code --url https://example.com/app./dc.sh log --follow <container_name>Available containers:
- backend
- frontend
- mainnetwork
- db
- pgadmin
./dc.sh stop./dc.sh down -t1
docker volume rm akvo-mis-docker-syncFor initial run, you need to create a separate docker volume.
docker volume create akvo-mis-mobile-docker-sync./dc-mobile.sh up -d- Install the Expo Go app from Playstore
- Connect your android to the same wireless network as your machine.
- Open The Expo Go
- Enter URL Manually:
Your_IP_Address:19000
./dc-mobile.sh down -t1export CI_COMMIT='local'
./ci/build.shAbove command will generate two docker images with prefix eu.gcr.io/akvo-lumen/akvo-mis for backend and frontend
docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -dNetwork config: nginx
The Akvo Flow Data Seeder enables you to migrate data from Akvo Flow to Akvo MIS. The process involves downloading forms and data, mapping administration and question data, and seeding the final data via Docker.
Quick Start Steps:
-
Navigate to the scripts directory:
cd scripts/akvo-flow -
Configure environment: Copy
env.exampleto.envand populate with your Akvo Flow credentials -
Configure survey IDs: Update
flow_idsinaf_downloader.ipynbandaf_forms_mapping.ipynbwith your target surveys -
Start JupyterLab:
jupyterlab . -
Download forms and data: Run all cells in
af_downloader.ipynb -
Map administration data: Run all cells in
af_administration_mapping.ipynb -
Map form questions: Run all cells in
af_forms_mapping.ipynb -
Generate parent and child data files: Run all cells in
af_data_registration_monitoring.ipynbto produce the final data files in the output folder -
Pre-download photos (optional but recommended): If your forms contain photo questions, pre-download them before seeding:
python manage.py predownload_photos --form=<akvo_flow_survey_id>
Optional parameters:
--workers=<number>- Number of concurrent download workers (default: 5)
This creates a success log at
storage/akvo-flow/<form_id>_photo_downloads.csvand a failed log atstorage/akvo-flow/<form_id>_photo_downloads_failed.csvfor manual review. Re-running skips already downloaded photos. -
Seed the data: Run the Django management command:
python manage.py flow_data_seeder --form=<akvo_flow_survey_id> --email=<youremail@domain.com>
Optional parameters:
--limit=<number>- Limit the number of records to process--revert=True- Revert previously seeded data
For comprehensive documentation covering environment setup, detailed command explanations, output expectations, and troubleshooting, see the Akvo Flow Data Seeder Guide.