Vapor 4 backend reference implementation of the COVID-19 contact tracing API.
This project is meant to be usable in combination with TracePrivately, an iOS reference implementation.
- Be compatible with the TracePrivately app
- Log as little as possible about users/devices, only what is needed to prevent abuse
- Support for JSON and MessagePack
- Basic webinterface toSee and reject/approve data input
- Optional authentication support, as privately as possible
- Push message support
Currently, there's no device validation implemented. Using this option will accept any token without validation.
Running is almost as simple as running the Vapor 4 starter app. Open the project in Xcode, set the working directory to be [RepoDirectory]/WorkingDir
and run the app. A SQLite file will be created automatically.
Optionally, some configuration can be changed in configure.swift
.
To run the app, you can use:
- macOS running Xcode 11 or higher (tested using Xcode 11.4.1), or;
- Ubuntu with Swift and the Vapor toolbox installed, or;
- A dockerized version of the app
- Open the project in Xcode
- Under Edit scheme -> Run -> Arguments, add these two arguments:
--auto-migrate
(To set up the data model on startup)serve --hostname 0.0.0.0 --port 8080
(To enable the app to listen for incoming connections)- Under Edit scheme -> Run -> Options -> Working Directory, point to
[RepoDirectory]/WorkingDir
- Without this step, the application will work, but the webppages will not be able to find the leaf templates
- Start the application
- Open the app project
- In
KeyServer.plist
, change the BaseURL to be: http://localhost:8080/api/
for simulatorshttp://[your-local-ip]:8080/api/
for real devices- To allow connecting to localhost without ssl, don't forget to Allow Arbitrary Loads in the
Info.plist
. - Run the app
There's are some simple Leaf pages available to see the data results. Simply point your browser to http://localhost:8080/
to see collected results.
Feel free to open issues or pull requests!
This project is licensed under the MIT License
Thanks to HendX for the iOS app!