
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
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:
Note:
This projects collects data from a Nightscout instance. More information on how to set up Nightscout is found here:
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.
-
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
-
- Set up a free tier cluster at https://www.mongodb.com/cloud/atlas/register
- Click on connect
- Select Node.js and copy the connection string. You will need it later:
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
When the app is started fill in the lines for:
-
Host adress
- This will be the ipadress of the machine running kubernetes.
-
Api key
- This is the APIKEY variable in 3-healthnodeapi.yaml
-
Nightscout name
- If the nightscoutadress is https://xxxx.herokuapp.com, then fill in xxxx here.
-
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
-
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).
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!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Daniel Mini Johansson - daniel@codebymini.se
Project Link: https://github.com/codebymini/healthnode