GithubHelp home page GithubHelp logo

ehidra / contact-tracer Goto Github PK

View Code? Open in Web Editor NEW
50.0 22.0 19.0 8.94 MB

A prototype contact tracer app for COVID-19 pandemic response

License: MIT License

JavaScript 8.88% TypeScript 61.47% HTML 10.15% Java 2.21% Swift 5.07% Ruby 1.02% SCSS 11.21%
contact-tracer prototype bluetooth virus android ios ble proximity-sensor ios-app android-app

contact-tracer's Introduction

COVID-19 Contact Tracer

Note:

This project halted in April 2020 once Singapore open-sourced' their code. You should go to https://github.com/opentrace-community. This is here for historical reasons.

Background

COVID-19 is a disease caused by SARS-CoV-2 virus. It emerged in China in late 2019, and in the space of several months it has become a global pandemic. The disease causes respiratory failure in the most critical (approx 4%) cases.

Many countries have implemented lockdown measures to reduce the spread of the disease, and to alleviate pressure on their often overwhelmed health care systems. These measures appear to have been effective in China as, after several months in lockdown, it has now gone several days without recording any new locally transmitted infections.

It is therefore hoped that the physical distancing measures other countries have put in place will also result in fewer new infections over the coming weeks and months.

Once the daily new infections subside, policy makers will then need to consider how they can start easing physical distancing restrictions to get their economies and societies moving again. The obvious risk of this is that the virus will come back.

Researchers at Oxford University have proposed building a ‘contact tracer’ mobile app to mitigate this: https://045.medsci.ox.ac.uk/mobile-app Contact Tracer App

The idea is to create a smart phone app which could replace classical contact tracing when new cases of the disease occur. It would be much quicker to respond (hours rather than days) and much more scalable than traditional methods, making it possible to recommend self-isolation and quarantine measures quickly and efficiently to those affected.

The app could detect nearby devices or app users that it sees (possibly via Bluetooth, Wi-Fi Aware or similar) and record how long it came into contact with them. These could be stored in a local database on the device (better for scalability and privacy).

If an app user reports that they have a suspected or confirmed case of COVID19, this would be synchronised with all other devices so that they can be notified if they came in contact with them. The app could then recommend actions based on how close you came, and how long you spent with them.

Open Source Project

We would like to invite app developers from around the world to assist us in the creation of an open source implementation of such an app.

Requirements

The ideal app would be:

  • Able to communicate peer to peer over BLE, Bluetooth or Wifi
  • Cross platform on Android and iOS
  • Supported by as many devices as possible, but at least those 3-4 years old.
  • Able to scan devices while offline, e.g. when travelling underground or in a remote area without Internet access.
  • Able to run while in the background
  • Free to distribute (software only preferable)

Initially we were planning to identify all devices nearby by their bluetooth MAC addresses, however we now realise this is not feasible as, for privacy reasons, they are hidden from app developers in iOS, also some devices with randomise their MAC address when communicating with others and we are not sure if it is possible for an app developer to access all the addresses that have been used. Our current thinking is to use Bluetooth Low Energy (BLE) to exchange information through Generic Access Profile (GAP) and/or Generic Attribute Profile Services (GATT).

We have already begun working on a prototype, and are evaluating the following options:

Technology Pros Cons
Bluetooth LE Widely supported. No internet dependent. Hardware IDs available on Android. BLE Service Advertisement approach could work if we only want to track other app users. iOS hides hardware addresses, and replaces them with a UUID only valid for your device. The mapping algorithm is not public. We may be able to use BLE to advertise a service amongst app users, but it’s unclear whether Android can discover iOS apps that are advertising in the background.
iBeacon - app based Your phone can advertise a unique id given by the app itself and detect others Advertise ID only works for IOS Android can only detect
Beacon - hardware based Will work across devices and is used already.Beacon does the advertising and the App just monitors that your beacon is with you and looks for other beacons. Extra configuration for the beacons and extra cost for the devices (probably will need to choose just one type of device)
WiFi Aware
Nearby Connections API Uses WiFI Aware and Bluetooth LE recognising devices around you Only valid for Android
Nearby Messages API Valid for IOS and Android even though the connecting process is different of what we want for this Needs internet connection
p2pkit Seems to have a solution that has been tested already across IOS and Android Not updated for 3 years Needs internet connection
MultipeerConnectivity A framework for offline data transmission between Apple devices. Open source library available. Maybe only runs while the app is in the foreground? iOS only.
Wifi Direct Android only, not compatible with iOS."

We are primarily web app developers, so we are looking for engineers with experience in hardware communication who can help.

The prototype (working for IOS and Android)

At the end we decided to go with the Buetooth LE approach and we have build a prototype.

Contact Tracer Prototype on iOS

We are using Ionic 4 + Capacitor for it . If you want to have a go this should get you up and running quickly. We are relying heavily on this plugin https://github.com/randdusing/cordova-plugin-bluetoothle There are some issues we have still to solve but it does work.

At the moment Background mode only work for Android but IOS should be also possible just have to iron it out.

  • git clone repository
  • npm install within the repo root
  • ionic capacitor run android
  • ionic capacitor run ios

The whole point of the app is being able to recognise and connect to other devices no matter the platform and exchange UUID's. Then that should prove two people have been in contact. We have still to improve the proccess testing the scans and advertise as peripheral cycles. The results are stored in a in-app SQLite data base.

Mac development set up

Install Ionic and depencies

Following these instructions: https://ionicframework.com/docs/v3/developer-resources/platform-setup/mac-setup.html

Install Homebrew from https://brew.sh/

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Install n (Node version manager)

brew install n

Update node to latest version

sudo n latest

Install Xcode from the App Store

Download Android Studio from https://developer.android.com/studio/ and run the installer. After installation, add the “command line tools” from Configure > Android SDK > SDK Tools NOTE: Couldn’t find ‘Android Support Repository’ - Android cli command not found

Install java

brew install java

Symlink it so that the OSX system Java wrappers can find this JDK, symlink it with

sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

Install Cordova

sudo npm install -g cordova

Install Ionic

sudo npm install -g ionic

Capacitor dependencies

Install Ruby

brew install ruby
Add to .bash_profile   export PATH=/usr/local/opt/ruby/bin:$PATH

Install Xcode developer tools

xcode-select --install

Install cocoapods

sudo gem install cocoapods

Clone and build the project

Clone the project:

git clone [email protected]:ehidra/contact-tracer.git
cd contact-tracer

Run capacitor and other build tools

ionic capacitor run ios

npm install

npx cap sync ios

Open the project in Xcode better

npx cap open ios

Contributors

  • Paul Maunders - Memiah Limited - UK
  • Carlos Morillo Merino - eHidra - Spain

contact-tracer's People

Contributors

baradhili avatar cmorillo avatar dependabot[bot] avatar jhnlwhd avatar paulmaunders avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

contact-tracer's Issues

stick to BLE, avoid GPS

in open-air Bluetooth and wifi have really long ranges... BLE is pretty much designed for short-range (yeah it can still see far, but less likely)

Not sure if you are looking at GPS tracking, but remember the GPS receiver really sucks down on the battery - I did have a thought that the protocol get extended so the user can be advised if they've been close to a confirmed case within the last 14/21 days.. and if they are, they can pass their current location back to authorities..

Credential

Hello Team ,

I am trying to run this ionic project in local .
I need some credential details , you have this ?
firebase: {
apiKey: '',
authDomain: '',
databaseURL: '',
projectId: '',
storageBucket: '',
messagingSenderId: '',
appId: '',
measurementId: ''
}

Pulling together a team

Hi Guys,
I've been working away and can now bring Public health support from the Scandinavian countries and I can also release info about this project to >500 epidemiologists all connected to the Norwegian Institute for Public health...

But I'm a bit worried.. its been really quiet here, so are things continuing here or should I take it elsewhere?

If its going to be here we need to roll up our sleeves and work out what we need and what features for the MVP.. this can go really fast if we want - we NEED to go really fast since Covid isn't waiting..

Introduction

Hi @cmorillo and @paulmaunders ,

Very interested in helping with this effort. I'm a mobile developer. Specialize in iOS but also do cross-platform and have worked with bluetooth. Big concern of mine is that bluetooth can grab everyone in your apartment building (above and below you) so elevation comparisons would dramatically increase accuracy.

My email is RNorback [@] gmail.com. Would you mind adding me to the slack channel? I'd like to see how I can best jump in.

Looks like the code from Trace Together will be open sourced soon. One serious drawback is having to leave the app open. Would love to discuss further.

Best,
Rob

Please Collaborate With Zerobase!

Hello contact-tracer friends. I'm Aron Szanto. I'm leading a team of 120 volunteers to build an anonymous, virtual contact tracing application called Zerobase. We'd love to connect with you.

Zerobase is a different kind of contact tracing. We don't use GPS, proximity sensing, peer to peer systems, or app installs. Instead, our novel QR mesh network can be deployed into any community with access to a printer. We're on the ground in Germany already around Köln and are moving quickly towards a scaled deployment in the USA: New Jersey, New York, California, Texas, Colorado, and New Hampshire.

I love the work you're doing here. Please consider getting in touch with us- we know that the eventual technical system that will be most effective against the coronavirus is a consortium solution, combining proximity, GPS, touchpoint-based mechanisms (like ours), and many other ingenious mechanisms developed under the auspices of the worldwide effort to end COVID-19. We have designed our system and models from the ground up to be able to quickly integrate with any other application that may provide helpful information, and we will prioritize sharing any information, data, or analysis that arises out of the use of our system.

In the meantime, if you're interested in working with us, please read about us at https://github.com/zerobase-io/About-Us-Onboarding. And for those who will see contact-tracer through, please keep in touch! We'd love to share data with you- our orthogonal modalities of tracing will bring synergy when analyzing the spread of the virus.

Love from the front,

Aron Szanto
Founder and CEO,
Zerobase Foundation

How you are advertising a unique id?

Can you inform me how you are advertising a unique id? And how can device detect that unique id during scan?
I am using same plugin https://github.com/randdusing/cordova-plugin-bluetoothle
I am adverting like this
bluetoothle.startAdvertising(sucess, error, {
"services":["xxx"], //iOS
"service":"xxx", //Android
"name":"xxxxx",
});
But problem is that during scan I am getting a string. But how can I advertise a unique id?
advertisement:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" //This is for example

Existing efforts

It might be worth considering contributing to existing projects to reduce fragmentation of efforts, since a contract tracer would need to be adopted by a large percentage of a population to be useful and having lots of apps would undermine this - e.g. https://corona-trace.github.io/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.