I have Type 1 Diabetes and use a Dexcom G6 CGM (Continuous Glucose Monitor) to track my BG (Blood Glucose) levels. Dexcom has an OAuth2-based API which I'm using to make this server. I've never used Typescript before and I wanted to learn, and this was a cool little project so I thought I'd make it.
You need to have typescript or, at the very least, npm
installed.
- Run the following command to install all required node modules.:
$ npm install
- Create a Redis database.
- Create a Dexcom Developer account and create a project.
- Create a
.env
file in the project directory that has this format:
PORT=
DEXCOM_CLIENT_ID=
DEXCOM_CLIENT_SECRET=
DEXCOM_REDIRECT_URI=
REDIS_PORT=
REDIS_HOST=
REDIS_PASSWORD=
API_KEYS=[]
- Run the following commands in that order:
$ npm run build
$ npm run start
- Open
http://localhost:[PORT]/
in your browser. - Login to your Dexcom account. This account should already be paired to your actual sensor so that you can get your EGV's (Estimated Glucose Values, a term used by Dexcom in their API).
- Make GET requests to
/bg
with a valid API key!
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.