This app required a static config to seed and retreieve the data. So, first please provide the instance value like below environment setup (the instance name is "test"):
export SIWINS_INSTANCE="test"
This app requires Akvo Flow API Authentication to provides correct credentials when seed or sync form and data points from Akvo FLOW.
Environment Setup:
export AUTH0_CLIENT="string"
export AUTH0_USER="string"
export AUTH0_PWD="string"
When running the test, any upload and download activities will not uploaded directly as Storage object (offered by Google Cloud). It stored inside ./backend/tmp/fake-storage
Environment Setup:
export GOOGLE_APPLICATION_CREDENTIALS=path_to_service_account.json
To use the Mailjet Email API, you need to create a Mailjet account, then retrieve your API and Secret keys. They will be used for seed/sync notification purposes.
export MAILJET_SECRET="string"
export MAILJET_APIKEY="string"
export NOTIFICATION_RECIPIENTS="email1,email2"
Now you have all the required environment ready, then run the App using:
docker volume create --name=siwins-docker-sync
./dc.sh up -d
To stop:
./dc.sh down -t 1
Reset the app:
./dc.sh down -v
The app should be running at: localhost:3000. Any endpoints with prefix
/api
is redirected to localhost:5000/config.js
is a static config that redirected to localhost:5001/config.js
see: setupProxy.js
Before you seed the baseline data, please make sure that you have all the required file in the following structure:
Folder Path: /backend/source/
backend/source/
├── administration
│ └── fake-geolocations.csv
├── forms
│ └── forms.json
└── solomon-island-topojson.json
Assuming that you have forms.json inside ./backend/source/
folder and have correct Environment setup you will be able to run.
- Run form and fake data seeder
docker-compose exec backend ./fake_seed.sh
- Run form seeder with flow data (require Environment setup)
docker-compose exec backend ./seed.sh
To get updated data points from akvo-flow instance, you need to run (require Environment setup):
docker-compose exec backend ./sync.sh
To seed fake data points, run command below:
docker-compose exec backend python -m seeder.fake_datapoint <number_of_data_points>
To seed fake history for data points, run command below:
docker-compose exec backend python -m seeder.fake_history
docker-compose exec backend ./test.sh
export CI_COMMIT='local'
./ci/build.sh
This will generate two docker images with prefix eu.gcr.io/akvo-lumen/siwins
for backend and frontend
docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d
Then visit: localhost:8080. Any endpoints with prefix
/api
is redirected to backend API: localhost:5000/config.js
is a static config that redirected to localhost:5001/config.js inside the network container
see:
- nginx config
- mainnetwork container setup
For further information about the file formats please contact tech.consultancy@akvo.org