Skip to content

HealthKitServer is a server that stores healthdata from Apple's HealthKit feature.

License

Notifications You must be signed in to change notification settings

ehershey/HealthKitServer

 
 

Repository files navigation

HealthKitServer

HealthKitServer is a RESTfull server that uses Apple's new hub for health-realted information, HealthKit, to store a persons health related data.

With HealthKit, Apple has created a hub for health data from devices like The Apple Watch, FitBit and Jawbone. Why not store all that data outside the iPhone, perhaps in a structured way that can be shared with other health-realted systems?

The project includes the server itself written in .NET (compiled with Mono for cross-platform support) and an iOS app written with Xamarin Forms.

Note: The Server API supports data from other sources as well, not just HealthKit.

Technology stack

  • Nancy.Selfhost
  • TopShelf
  • Xamarin.Forms
  • Dapper
  • LightInject

Datastorage

I like to let users choose datastorage, so support for the following datastorage methods is created:

  • Local Cache (in memory)
  • MySQL
  • PostgreSQL
  • Redis
  • Solr

Future plans

  • Save all data as OpenEHR archetypes.
  • Separate core project from Xamarin Forms to make building on Linux easier (xbuild can only be run on OSX or Windows). Done, Common project added.
  • More general interfaces for importing data from other sources than HealthKit. (deserialization of archetypes?)
  • Move from SimpleContainer to LightInject when the codebase gets bigger. Done.
  • Create Apple Watch extension
  • Support for SQLite

Build and try

# Run local with data stored in memory:  
git clone https://github.com/andmos/HealthKitServer.git
cd HealthKitServer/
./buildServer run-local

A Vagrant-file is provided for running on a Linux VM with Docker preinstalled. Example with MySQLdatabase:

vagrant up
vagrant ssh
cd /vagrant/Database
./setUpDockerMysqlDatabase
cd ..
# Edit HealthKitData.Host/bin/Debug/HealthKitServer.Host.exe.config and chose 'database' as source.
# Enter healthkitserverdb as database in connectionstring!
docker build -t healthkitserver .
docker run -p 5000:5000 --link healthkitserverdb:healthkitserverdb -it healthkitserver

curl http://localhost:5000/api/v1/ping

Build Status

Build Status

About

HealthKitServer is a server that stores healthdata from Apple's HealthKit feature.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 95.1%
  • Shell 4.9%