When the COVID-19 pandemic started, I was concerned about identifying if I or one of my family members has made contact with a confirmed case. "People you may know" feature of Facebook inspired me, because it somehow can identify if you have met someone in real life or not, and gives you suggestions based on that.

So I thought crowd-sourcing these locations might do the trick.

What it does

App that collects users location data while it respects their privacy since it doesn't ask for any personal information and doesn't store IP addresses. The location data is stored on a remote server and the app continues to collect user's location data in the background and when the app is closed. Then when a user marks themselves as a COVID-19 case, everyone who has visited any of the locations that user been to in the past 9 days, they get a notification.

If a user makes an encounter with multiple COVID-19 cases, they get multiple notifications and they can browse the encounter history and check the location of such encounters.

How I built it

The backend was built using NodeJS, Express and MongoDB. The mobile application was built using Swift and it works for iPhone for the time being, but it would be pretty easy to implement and android version of it.

The backend exposes multiple REST API endpoints for Authentication, Location Tracking and Encounters listing and posting.


Authentication is made with privacy in mind, it doesn't require you to register an account, it auto registers you with your phone's UDID, and stores a bearer token on your device required for API calls.

Location Services

The app requires an "Always usage" for location services on your phone as it listens for location updates in the background and when the phone is locked or the app is closed.

Those locations are stored as a Coordinates point tied to the user id without any IP address data.

Marking a user as a confirmed case

If a user gets the news that they're a COVID-19 positive, they can open the app and click on a button that marks them as a confirmed case.

I query their locations in the past 9 days and notify users who have been to the same locations, and I add an encounter entry to the database, so it acts as a history for the user encounters.

No details about who's the COVID-19 case is sent to the other users, so everything is anonymous.

What's next for Contact Beacon

This app can help in disease spread control in the feature. Confirmed cases data can be shared with health organizations to help prevent the fast spreading of the disease and help people avoid places that have been contaminated.

Share this project: