To start the server:
$ sudo start uwsgi
and to stop it:
$ sudo stop uwsgi
There is a cron job set to run at midnight everyday:
* 0 * * * /bin/bash /etc/crab/REMAR-Server/ShellScripts/dataPull.sh > /etc/crab/testlog.txt
this should read any exisiting files from the data folder and upload them to the rawcrab server. A python script is then run to sanitise the data, this is then added to the "cleancrab" database which is what the webpage accesses.
If you need to completely refresh the data (delete the databases and re-add the files), use
For development, I recommend ssh tunneling the DB port (5984). For example:
ssh -L 5984:localhost:5984 firstname.lastname@example.org
This will allow you to access the database from your own development envrionment from localhost.
To Run Flask App:
Install requirements, set environment variables then run.
pip install -r requirements.txt export FLASK_APP=REMAR-Data.py export FLASK_DEBUG=1 flask run --host=0.0.0.0
Created CouchDB rawcrab and cleancrab data. http://docs.couchdb.org/en/2.1.1/intro/index.html
Show all dbs
curl -X GET http://127.0.0.1:5984/_all_dbs
Show specific db
curl -X GET http://127.0.0.1:5984/rawcrab
Add document to db
curl -X PUT -d @filepath.json http://127.0.0.1:5984/rawcrab/test
where test is the uuid for accessing the document again,
curl -X GET http://127.0.0.1:5984/rawcrab/test
A new UUID is generated to be accesible on the web interface. Every original uuid is matched to the phone id, therefore phones with multiple uuids associated with them are treated as one user now.
Check recordClass.py for the descriptions of the data that was matched to each question.