Skip to content

saurabhprasun20/citizen_science_backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

This is the backend of the citizen science survey for the PRODIGI team at UZH.

This server handles assigning unique question set to the connected clients. The current settings helps to duplicate each question 3 times and assign 30 questions to a user and for a total of 50 users.

In order to make this work, we need to run serially→

  1. src/backend/random_generator.py → This file generates a list of 30 random questions for each of the 50 users. The generated data is stored in file → src/backend/data/question_list.json
  2. src/backend/create_db_entry.py → This file is responsible to upload the data into mongodb Database.

Important point: Before running this program make sure that mongo db docker container is running on the server. Use below command to run it →

docker run -d -p 27017:27017 --name prodigi-mongo mongo:latest

So far you can run these two files in your local system also. But you need to start Flask and WSGI server to enable the API endpoint by which qualtrics client can connect and obtain the question list. This API endpoint is →

/api/v1/questions

To run the Flask server in our Ubuntu server, we have a service which automatically runs the flask server. Please make sure that the service is active. The service automatically starts upon server restart. Check for error logs in case its not running.

/etc/systemd/system → citizen_backend.service

Revers proxy to the flask server has been implemented using Nginx. You can find more details about the file on the server.

/etc/nginx/sites-available → citizen-science.org

You can find the repository to create the survey here-->

https://github.com/saurabhprasun20/qualtrics-automation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages