Giter VIP home page Giter VIP logo

fitness-tracker-streamlit's Introduction

fitness-tracker-streamlit

๐Ÿ’ก About

I'm a data nerd and fitness enthusiast at heart, so the opportunity to optimize my nutrition and training through my own data has always excited me. Yet despite having tracked results in apps like MyFitnessPal, Crossfit btwb, Stronglifts 5x5, and Apple Health since 2013, I've always been disappointed by the lack of integration and limited insights among these apps. That's why I decided to create a personal app to show me the insights I want from my own fitness data.

๐Ÿš€ Features

I've kept the app pretty simple as it's for personal use:

  • Data Sources: Integrate data from MyFitnessPal (nutrition), Crossfit btwb (workouts), and Apple Health (steps). A preprocessed version of data collated from each of these data sources is pulled from an S3 bucket.
    • Pulling data from apps directly: MyFitnessPal has an API, but it's private - python-myfitnesspal is a promising alternative for programmatic access and MFP also supports bulk exports. Crossfit btwb only supports bulk csv exports. Apple Health supports bulk exports and programmatic access via HealthKit.
  • Data Transformation: The app performs some intermediate calculations on the sourced data to generate initial summary results and format the data for visualizations in the app.
  • Multi-Page Streamlit App:
    • Overview: A summary table with weekly aggregated stats on metrics for health (weight, delta from prevous week), nutrition (calories, protein intake), and training (#lifting and condition days, step count). I've found this useful to get a rough sense of how much I need to eat and how often I need to exercise to see a meaningful change in metrics like weight/body fat percentage. This table can be exported to csv via a Download button.
    • Visualizations: Here's the fun stuff. This page generates a few time-series plots (interactive via plotly) to show trends for weight, caloric intake, steps, and workouts. You can filter on dates and aggregate over days, weeks, and months to visualize the trends on different scales. There's also a summary table for which exercises I do most frequently.
    • Raw Data: It's often useful to see the underlying raw data used for calculations and visualizations, so I've made this available for viewing/download.

๐ŸŒ Getting Started

Configuration

The dashboard is set up to run with Docker and AWS, so the former should be installed and credentials for the latter should be configured/present.

Installation

git clone https://github.com/hsrishi/fitness-tracker-streamlit.git
cd fitness-tracker-streamlit

docker build . -t fitness-tracker-streamlit

Running the App

docker run -d -p 8501:8501 -v ~/.aws:/root/.aws fitness-tracker-streamlit

Hosting the App

I don't recommend hosting the app on a server as it's primarily intended for personal use (trivial to run locally, expense of hosting is unnecessary), but it's built with docker so deploying to the cloud is fairly straightforward. A small EC2 instance (e.g. t2.micro) is more than enough compute to run the app and you can use container services (ECR, ECS) to manage docker deployment.

โš–๏ธ License

License: MIT

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.