Backend of the Corona Tracking App, developed in the context of the #WirVsVirus Hackathon by the german government. See https://wirvsvirushackathon.org/
- Python 3.7
- websockets
- psycopg2-binary
- pyjwt
- boto3
- To install all packages, run "pip3 install -r requirements.txt"
- Enter "python3 server.py" in the terminal
- Content-Type must be application/json
- All responses are in the following format:
{
"success": True/False,
"message": "Contains message if something went wrong",
"payload": {
// request payload here
}
}
POST /register
Response payload:
{
"userId": // user ID here
"jwt": // JSON Web Token here
}
POST /track
Parameters:
Name | Type | Description |
---|---|---|
jwt | object |
JSON Web Token |
Request body:
{
"contacts": [
[
OTHER_USER_ID,
TIMESTAMP
],
...
],
"positions": [
[
TIMESTAMP,
LONGITUDE,
LATITUDE
],
...
]
}
PATCH /userstatus
Parameters:
Name | Type | Description |
---|---|---|
jwt | object |
JSON Web Token |
status | string |
User health status; Can be HEALTHY or INFECTED |
GET /userstatus
Parameters:
Name | Type | Description |
---|---|---|
jwt | object |
JSON Web Token |
Response payload:
{
"status": // user status here
}
POST /infected
Parameters:
Name | Type | Description |
---|---|---|
jwt | object |
JSON Web Token |
firstname | string |
First name |
lastname | string |
Last name |
phonenumber | string |
Phone number |