This document describes making Google App Engine hosted nightscout application, with MongoDB Atlas and xDrip+.
- Navigate to https://cloud.google.com
- Go to App Engine and create your first project. Choose the name of your project wisely, this will also be your URL to access Nightscout for yourself.
- Select your appengine configuration. Standard runtime, usCentral, node.js (note: us-central1 is where free tier is!)
- Open the terminal on your computer. If you dont know where this is, do a search for "Terminal" and open that application.
- Install gcloud command sdk, hit enter many times to accept all the defaults
- Run
gcloud initto configure account, project, and default zone gcloud config set compute/region us-central1(to ensure you're on free tier)
- Navigate to https://cloud.mongodb.com
- After creating your account, set up your first cluster, being sure to select GCP Free tier, M0 instance size. Note the default is an M30.
- After the cluster is created, create your first user by clicking "Database Access" in the left nav menu. You'll want to create a user with
readWriteAnyDatabase, and note the password. - Next, go to "Network Access" in the left nav menu. Enter the value of 0.0.0.0/0
- On your clusters page, click the connnect button, then "Connect Your Application" and copy your mongodb+srv connection string.
- Clone the nightscout web monitor to your laptop using
git clone https://github.com/nightscout/cgm-remote-monitor.git - Open the package.json file and modify it slightly. If you search through this short document, you'll see this entry: postinstall all you need to do is change this word, and only this word, to gcp-build
- Save the file and close it
- Go to my gist for app.yaml here https://gist.github.com/techbelle/81ad2814cf193ea6921db3fe5df94f28
- Copy it onto your laptop via copy paste
- Modify the items in the file between the < > symbols. Specifically, this will be your mongodb connection string, projectname, and API Secret.
- The MongoDB connection string is the one from your atlas deployment.
- The
BASE_URLwill contain your App Engine project name, the one I said to choose wisely. - The API secret is the one that goes with your xDrip+ application, and will allow your app to communicate with your mobile phone. It's a number and letter combination you completely make up. This should be lengthy, and you'll need to hand type it into your phone later for xDrip configuration.
- Back in the terminal, run
gcloud app deploy - Check all your configuration shown. The path, source, Target URL etc should all be correct. Target URL should match what you put into the app.yaml for the
BASE_URLfile. If it doesn't match, it won't work. - Hit enter
- You should see some messages about uploading files to Google Cloud Storage, followed by Updating Service. This will take a few minutes.
- When that's done, you'll want to run
gcloud app browseor open your appspot URL in a web browser. - This will open a new window with your app running in the cloud!
- In the top right, there's a little icon that looks like 3 lines. Click that. This will open a settings menu. Near the bottom there's an item called
Authenticate. Click that. It asks here for yourAPI secretfrom theapp.yamlfile.
- Navigate to https://github.com/NightscoutFoundation/xDrip from your Android mobile phone
- Take a picture of the barcode and it will install the xDrip+ app
- In the left navigation menu select
Settings - Select
Cloud Upload - Click
Nightscout Syncthen Enabled should be ON - Fill out your
Base URLin this format:https://apisecret@projectname.appspot.com/api/v1/where API secret is the value from your app.yaml file, the project name is your project name from google app engine. - Exit menu
- You should now see the main UI of xDrip+. In the middle it has a button that says
Start Source Setup Wizard. Click that. - You will now enable your CGM transmitter to send data. Do not do this step unless you have already installed your CGM with sensor needle on yourself. You will need your transmitter ID.
Sorry, I am new to this game. All seemed to be going well until the line "Go to my gist for app.yaml". What does this mean and how do I do it?