Code Monkey home page Code Monkey logo

disciplinator's Introduction

Build Status

Discontinued

I don't have enough time and interest to continue developing this project, and, to be honest, I don't need it anymore :) This idea came to me while I was working remotely, hence I wasn't moving much, which was super bad for my health. But now I have an office job, and I overdo my step-goal every day, so disciplinator is kinda useless for me now.

Stay fit and healthy, y'all!

Disciplinator [WORK IN PROGRESS]

Disciplinator is a motivatory tool that utilizes Fitbit personal API. It is designed to help in breaking the sedentary lifestyle through motivating the user to keep being active each hour (except for sleeping hours and some evening Pizza Time).

[TODO] Setup

How it works?

Disciplinator has 3 main parts:

  • Headmaster: web-service that connects to the Fitbit API, calculates the activity debt and returns current status upon request: either Normal or DebtCollection(N), where N is number of minutes to work out to change state back to normal.
  • Priestess is an intermediate helper library to provide common Data Types among different Fitness Apps (currently only Fitbit API is supported).
  • Driver is a client-side part that would motivate user through making his life harder if they fail to keep active through the day. It uses data provided by the headmaster to perform the callback-defined actions.

Principles and unresolved questions are described in the Rule Book.

Drivers

As the driver library is in principle indiscriminate in what one would do with the received events, and can trigger any external callbacks as long as they fall into the Box<Fn(headmaster::State) -> Result<(), failure::Error> interface, it's possible to define any actions to be triggered as events.

This repository ships the executor binary in driver/drivers/executor which is a handy mediator between the driver lib and user-defined actions. Actions are represented as Plugins, which are just executable files with a manifest file attached to them. Plugins may be implemented in any language, be it bash, python, ruby, or even PowerShell is one feels like it. Plugin may as well be a binary file produced by Rust, C or any other language compiler. Anything as long as it's executable.

The plugin Manifest defines on which events plugin should be ran, and if it's enabled.

For a plugin sample please refer to the osx_send_notification.sh bash script, and it's manifest file osx_send_notification.sh.toml;

API Support

Currently only Fitbit API is supported as an author is a proud owner of the Charge 2. Support of the other APIs is not planned until author decides to switch to another fitness wearables manufacturer.

Miscellaneous

There's an Android Application for receiving push-notifications from the respective Executor plugin and Disciplinarian data rendering. Implemented mostly for convenience of debugging and to play with Android (who can live without a pinch of mobile development these days), but turned out to be pretty useful.

Acknowledgements

Huge thanks to @bradfordboyle for his fitbit-grabber-rs crate, which I'm continuing to develop for the needs of this project.

Contacts

Mike Lubinets: [email protected]

disciplinator's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sergeysova

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.