You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nightscout is a Node.js application. The basic installation of the software for local purposes is:
47
42
48
43
1. Clone the software to your local machine using git
49
44
2. Install Node from https://nodejs.org/en/download/
50
-
2. Use `npm` to install Nightscout dependencies by invokin`npm install` in the project directory. Note the
51
-
dependency installation has to be done usign a non-root user - _do not use root_ for development and hosting
45
+
2. Use `npm` to install Nightscout dependencies by invoking`npm install` in the project directory. Note the
46
+
dependency installation has to be done using a non-root user - _do not use root_ for development and hosting
52
47
the software!
53
-
3. Get a Mongo database by either installing Mongo locally, or get a free cloud account from mLab or Mongodb Atlas.
54
-
4. Configure nightscout by copying `my.env.template` to `my.env` and run it - see the next chapter in the instructions
48
+
3. Get a Mongo database by either installing Mongo locally, or get a free cloud account from mLab or MongoDB Atlas.
49
+
4. Configure Nightscout by copying `my.env.template` to `my.env` and run it - see the next chapter in the instructions
55
50
56
51
## Develop on `dev`
57
52
58
53
We develop on the `dev` branch. All new pull requests should be targeted to `dev`. The `master` branch is only used for distributing the latest version of the tested sources.
59
54
60
55
You can get the `dev` branch checked out using `git checkout dev`.
61
56
62
-
Once checked out, install the dependencies using `npm install`, then copy the included `my.env.template`file to `my.env` and edit the file to include your settings (like the Mongo URL). Leave the `NODE_ENV=development` line intact. Once set, run the site using `npm run dev`. This will start Nigthscout in the development mode, with different code packaging rules and automatic restarting of the server using nodemon, when you save changed files on disk. The client also hot-reloads new code in, but it's recommended to reload the the website after changes due to the way the plugin sandbox works.
57
+
Once checked out, install the dependencies using `npm install`, then copy the included `my.env.template`file to `my.env` and edit the file to include your settings (like the Mongo URL). Leave the `NODE_ENV=development` line intact. Once set, run the site using `npm run dev`. This will start Nightscout in the development mode, with different code packaging rules and automatic restarting of the server using nodemon, when you save changed files on disk. The client also hot-reloads new code in, but it's recommended to reload the website after changes due to the way the plugin sandbox works.
63
58
64
59
Note the template sets `INSECURE_USE_HTTP` to `true` to enable the site to work over HTTP in local development.
65
60
66
61
If you want to additionaly test the site in production mode, create a file called `my.prod.env` that's a copy of the dev file but with `NODE_ENV=production` and start the site using `npm run prod`.
67
62
68
63
## REST API
69
64
70
-
Nightscout implements a REST API for data syncronization. The API is documented using Swagger. To access the documentation
71
-
for the API, run Nightscout locally and load the documentation from /api-docs (or read the associated swagger.json and swagger.yaml
72
-
files locally).
65
+
Nightscout implements a REST API for data syncronization. The API is documented using Swagger. To access the documentation for the API, run Nightscout locally and load the documentation from /api-docs (or read the associated swagger.json and swagger.yaml files locally).
73
66
74
-
Note all dates used to access the API and dates stored in the objects are expected to comply with the ISO-8601 format and
75
-
be deserializable by the Javascript Date class. Of note here is the dates can contain a plus sign which has a special meaning in
76
-
URL encoding, so when issuing requests that place dates to the URL, take special care to ensure the data is properly URL
77
-
encoded.
67
+
Note all dates used to access the API and dates stored in the objects are expected to comply with the ISO-8601 format and be deserializable by the Javascript Date class. Of note here is the dates can contain a plus sign which has a special meaning in URL encoding, so when issuing requests that place dates to the URL, take special care to ensure the data is properly URL encoded.
78
68
79
69
## Design & new features
80
70
81
71
If you intend to add a new feature, please allow the community to participate in the design process by creating an issue to discuss your design. For new features, the issue should describe what use cases the new feature intends to solve, or which existing use cases are being improved.
82
72
83
-
Note Nighscout has a plugin architecture for adding new features. We expect most code for new features live inside a Plugin, so the code retains a clear separation of concerns. If the Plugin API doesn't implement all features you need to implement your feature, please discuss with us on adding those features to the API. Note new features should under almost no circumstances require changes to the existing plugins.
73
+
Note Nightscout has a plugin architecture for adding new features. We expect most code for new features live inside a Plugin, so the code retains a clear separation of concerns. If the Plugin API doesn't implement all features you need to implement your feature, please discuss with us on adding those features to the API. Note new features should under almost no circumstances require changes to the existing plugins.
84
74
85
75
## Style Guide
86
76
@@ -105,7 +95,7 @@ If in doubt, format your code with `js-beautify --indent-size 2 --comma-first -
105
95
106
96
## Create a prototype
107
97
108
-
Fork cgm-remote-monitor and create a branch. You can create a branch using `git checkout -b wip/add-my-widget`. This creates a new branch called `wip/add-my-widget`. The `wip` stands for work in progress and is a common prefix so that when know what to expect when reviewing many branches.
98
+
Fork cgm-remote-monitor and create a branch. You can create a branch using `git checkout -b wip/add-my-widget`. This creates a new branch called `wip/add-my-widget`. The "`wip`" stands for work-in-progress and is a common prefix so that we know what to expect when reviewing many branches.
109
99
110
100
## Submit a pull request
111
101
@@ -115,11 +105,9 @@ This can be done by checking your code `git commit -avm 'my improvements are her
115
105
116
106
Now that the commits are available on github, you can click on the compare buttons on your fork to create a pull request. Make sure to select [Nightscout's `dev` branch](https://github.com/nightscout/cgm-remote-monitor/tree/dev).
117
107
118
-
We assume all new Pull Requests are at least smoke tested by the author and all code in the PR actually works.
119
-
Please include a description of what the features do and rationalize why the changes are needed.
108
+
We assume all new Pull Requests are at least smoke tested by the author and all code in the PR actually works. Please include a description of what the features do and rationalize why the changes are needed.
120
109
121
-
If you add any new NPM module dependencies, you have to rationalize why there are needed - we prefer pull requests that reduce dependencies, not add them.
122
-
Before releasing a a new version, we check with `npm audit` if our dependencies don't have known security issues.
110
+
If you add any new NPM module dependencies, you have to rationalize why they are needed - we prefer pull requests that reduce dependencies, not add them. Before releasing a a new version, we check with `npm audit` if our dependencies don't have known security issues.
123
111
124
112
When adding new features that add configuration options, please ensure the `README` document is amended with information on the new configuration.
125
113
@@ -142,7 +130,7 @@ We encourage liberal use of the comments, including images where appropriate.
142
130
143
131
## Co-ordination
144
132
145
-
Most cgm-remote-monitor hackers use github's ticketing system, along with Facebook cgm-in-the-cloud, and gitter.
133
+
We primarily use GitHub's ticketing system for discussing PRs and bugs, and [Discord][discord-url] for general development chatter.
146
134
147
135
We use git-flow, with `master` as our production, stable branch, and `dev` is used to queue up for upcoming releases. Everything else is done on branches, hopefully with names that indicate what to expect.
148
136
@@ -152,7 +140,7 @@ Every commit is tested by travis. We encourage adding tests to validate your de
152
140
153
141
## Other Dev Tips
154
142
155
-
* Join the [Gitter chat][gitter-url]
143
+
* Join the [Discord chat][discord-url].
156
144
* Get a local dev environment setup if you haven't already.
157
145
* Try breaking up big features/improvements into small parts. It's much easier to accept small PR's.
158
146
* Create tests for your new code as well as the old code. We are aiming for a full test coverage.
@@ -193,6 +181,7 @@ Also if you can't code, it's possible to contribute by improving the documentati
| All active developers: | [@jasoncalabrese][@jpcunningh][@jweismann][@komarserjio][@mdomox][@MilosKozak][@PieterGit][@rickfriele][@sulkaharo]
271
+
| All active developers: | [@jasoncalabrese][@jpcunningh][@jweismann][@komarserjio][@mdomox][@MilosKozak][@PieterGit][@rickfriele][@sulkaharo][@unsoluble]
283
272
| All active testers/documentors: | [@danamlewis][@jamieowendexcom][@mcdafydd][@oteroos][@rarneson][@tynbendad][@unsoluble]
284
273
| All active translators: | [@apanasef][@jizhongwen][@viderehh][@herzogmedia][@LuminaryXion][@OpossumGit]
0 commit comments