Skip to content

codebymini/HealthNode

Repository files navigation


Logo

HealthNode

Living with diabetes type 1 is a great hazzle trying to find balance between carbs and insulin. Since there are multiple factors besides the two mentioned above, this project aims at visualising the correlation between physical activity and glucose levels in the blood.

Explore the docs »
· Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

This is a multipart project containing an iPhone app, Back- and Front-end in Node.js and Kubernetes deployment definitions. It also utilize a Atlas MongoDB.

The repositories used in this project:

(back to top)

System Overview

(back to top)

Built With

Note:

This projects collects data from a Nightscout instance. More information on how to set up Nightscout is found here:

(back to top)

Getting Started

The following instructions is for setting up this project locally. However, The main project is built on Linode utilizing a Linode 2 GB with Ubuntu 21.10 installed.

Prerequisites

  • Linux machine, virtual, physical or cloudbased. (It has been tested on Ubuntu 21.10)

    • MicroK8s runs in as little as 540MB but more RAM is recommended
  • Atlas Mongo DB

    • Select Node.js and copy the connection string. You will need it later:

Installation

Updates the package lists

sudo apt-get update

Install microk8s with snap

sudo snap install microk8s --classic

Add user to group

sudo usermod -a -G microk8s $USER

Set access to .-kube

sudo chown -f -R $USER ~/.kube

Re-enter session

su - $USER

Set the alias for kubectl

alias kubectl='microk8s kubectl'

Enable DNS, Storage, Dashboard and Ingress microk8s enable dns storage dashboard ingress

Clone the repo containing the kubernetes deployment files

git clone https://github.com/CodeByMini/HealthNode

Go to the folder

cd HealthNode

Deploy the files with:

kubectl apply -f 1-namespace.yaml

Remember the connection string from earlier? Now its time to use it.

(if this step was skipped take a ride there now)

Edit 3-healthnodeapi.yaml and change the value for MONGODB. Make sure to change <password> to your_password removing the <> Take this chance to change the APIKEY value to something harder to guess than YOUR_API_KEY.

Then continue with the deployment:

kubectl apply -f 2-healthnodeapi.yaml

kubectl apply -f 3-healthnode.yaml

kubectl apply -f 4-ingress.yaml

Clone the iPhone repo and build it with Xcode.

git clone https://github.com/CodeByMini/HealthNodeApp

Here's a link that describes how to set up a developer account and build an app for iPhone: https://www.youtube.com/watch?v=bqh6YaMxgbE&ab_channel=ThePugEngineer

Skip the steps for creating the app, and clone the repo instead.

git clone https://github.com/CodeByMini/HealthNodeApp

(back to top)

Usage

app

When the app is started fill in the lines for:

  • Host adress

    • This will be the ipadress of the machine running kubernetes.
  • Api key

  • Nightscout name

  • Click Upload button in app. Protip: Make use of iPhone integration with a Mac and send the webpage via AirDrop to watch the graph on a bigger screen

(back to top)

Roadmap

  • Security

    • Make use of https with certificates in both api and front-end
    • Hide the APIKEY and MONGODB connection string with regcred
  • Persitant Volume Claim

    • Use part of the harddrive where the kluster is deployed for a local MongoDB instance
  • Scaleability

    • Use a loadbalancer and scale up the front end and api with more replicas

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Daniel Mini Johansson - daniel@codebymini.se

LinkedIn

Project Link: https://github.com/codebymini/healthnode

Thanks

voxic

jh83

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published