-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd54804
commit 3540c3a
Showing
35 changed files
with
710 additions
and
2,374 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,5 @@ mongo-data | |
.env | ||
doc/ | ||
revision | ||
|
||
dev_run_migration.sh |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# @sensebox/opensensemap-api Changelog | ||
# openSenseMap API Changelog | ||
|
||
## Unreleased | ||
- Initial Release after splitting api and models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,96 +1,76 @@ | ||
# openSenseMap API | ||
 | ||
|
||
[openSenseMap] is part of the [senseBox] project. To get more information about openSenseMap and senseBox visit the before mentioned links or have a look at this [video](https://www.youtube.com/watch?v=uTOWYa42_rI), read the [API docs](https://docs.opensensemap.org) or the [openSenseMap](https://osem.books.sensebox.de/) chapter in our [books](https://books.sensebox.de/). | ||
[](https://travis-ci.org/sensebox/openSenseMap-API) | ||
|
||
## Organization | ||
This repository contains the Node.js package [@sensebox/opensensemap-api](https://www.npmjs.com/package/@sensebox/opensensemap-api), which is the HTTP REST API used by [https://opensensemap.org](https://opensensemap.org) running at [https://api.opensensemap.org](https://api.opensensemap.org). To get more information about openSenseMap and senseBox visit the before mentioned links or have a look at this [video](https://www.youtube.com/watch?v=uTOWYa42_rI), read the [API docs](https://docs.opensensemap.org) or the [openSenseMap](https://osem.books.sensebox.de/) chapter in our [books](https://books.sensebox.de/). openSenseMap is part of the [senseBox] project. | ||
|
||
Originally, this API has been built as part of the bachelor thesis of [@mpfeil](https://github.com/mpfeil) at the ifgi (Institute for Geoinformatics, WWU Münster) and is currently maintained by [@ubergesundheit](https://github.com/ubergesundheit). | ||
|
||
## Configuration | ||
Configuration values reside in the `lib/config.js` file. Configuration can also be set through environment variables starting with `OSEM_`. Environment variables override values in `lib/config.js`. | ||
|
||
## Development | ||
- Have [Node.js] v6, [yarn](https://yarnpkg.com/), [Docker](https://docs.docker.com/engine/installation/) and [docker-compose](https://docs.docker.com/compose/install/) installed | ||
- Start your development database (`docker-compose up -d db`) | ||
- Check out `development` branch (`git checkout development`) | ||
- Run `yarn install` | ||
- Create your own branch `git checkout -b my-awesome-branch` | ||
- Commit your changes to your branch and push it to your fork | ||
- Create a pull request against the `development` branch | ||
|
||
## Running Tests | ||
You can run the tests in containers using Docker and docker-compose. | ||
``` | ||
# Only run this once or every time you change dependencies in package.json | ||
./run-tests.sh build | ||
./run-tests.sh | ||
``` | ||
|
||
## Related projects | ||
- openSenseMap Frontend | ||
- sketch-templater | ||
- ttn-integration | ||
- models | ||
- mqtt | ||
- osem-compose | ||
|
||
This repository is a monorepo for the packages | ||
|
||
- [](https://www.npmjs.com/package/@sensebox/opensensemap-api-models) [@sensebox/opensensemap-api-models](models) The data models and database connection of openSenseMap. | ||
- [](https://www.npmjs.com/package/@sensebox/opensensemap-api) [@sensebox/opensensemap-api](api) The REST API used by [https://opensensemap.org](https://opensensemap.org) running at [https://api.opensensemap.org](https://api.opensensemap.org). | ||
|
||
### Directories | ||
- root directory | ||
- not published on NPM | ||
- is used to build a Docker container image | ||
- contains tests (run with `./run-tests`) | ||
- [api](api) directory | ||
- NPM [@sensebox/opensensemap-api](https://www.npmjs.com/package/@sensebox/opensensemap-api) | ||
- [Changelog](api/CHANGELOG.md) | ||
- should not appear as dependency of other packages | ||
- [models](models) directory | ||
- NPM [@sensebox/opensensemap-api-models](https://www.npmjs.com/package/@sensebox/opensensemap-api-models) | ||
- [Changelog](models/CHANGELOG.md) | ||
- `require('@sensebox/opensensemap-api-models')` for access to data models | ||
## Technologies | ||
|
||
* [Node.js] | ||
* [MongoDB] | ||
|
||
## Organization | ||
|
||
### Branches | ||
- master (runs in production) | ||
- Is never used to publish versions of subpackages | ||
- [package.json](package.json) contains specific versions from NPM | ||
- Is used for container build tags | ||
- development (runs on testing server) | ||
- Releases for subpackages are done from here | ||
- [package.json](package.json) contains `file:./api` and `file:./models` as versions | ||
- Bleeding edge and possibly unstable development version | ||
- gh-pages | ||
- Hosts API docs for [https://docs.opensensemap.org/](https://docs.opensensemap.org/) | ||
- Is generated and pushed to github by Travis CI [](https://travis-ci.org/sensebox/openSenseMap-API) | ||
- Is generated and pushed to github by Travis CI | ||
|
||
### Tags and Versions | ||
Git Tags are used for: | ||
- Docker hub builds `dockerhub-v1`. Version number is increased by one for each new version. | ||
- NPM tags for subpackages. [Uses Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html) | ||
- `@sensebox/opensensemap-api-v1.0.0` | ||
- `@sensebox/opensensemap-api-models-v1.0.0` | ||
|
||
### Release new NPM versions | ||
Make sure you've documented your changes in the `CHANGELOG.md` file of the respective package and have comitted everything to the development branch. | ||
|
||
To create a new NPM version, use `npm version`. | ||
1. Have everything commited for the release | ||
1. Document your changes in `CHANGELOG.md` under `## Unreleased`. Do not `git add` the file | ||
1. Run `npm version [ major | minor | patch ] -m "[<PACKAGENAME>-v%s] <Your commit message>"` | ||
1. `git push origin development` | ||
1. `npm publish` | ||
|
||
### Docker container images | ||
#### Development images | ||
Every commit on branch `development` will be built with the tag `development`. Versions of `@sensebox/opensensemap-api` and `@sensebox/opensensemap-api-models` will be the current development snapshot. | ||
Git Tags are used for Docker hub builds (like `v1`). Version number is increased by one for each new version. Docker images are built automatically by the Docker hub for all tags starting with `v` | ||
|
||
#### Development container images | ||
Every commit on branch `development` will be built with the tag `development`. | ||
|
||
#### Versioned container images | ||
- Check out `master` branch | ||
- Go to root directory | ||
- Modify version of `@sensebox/opensensemap-api` and `@sensebox/opensensemap-api-models` to desired versions | ||
- Make sure versions of `@sensebox/opensensemap-api` and `@sensebox/opensensemap-api-models` are published on NPM | ||
- Optional | ||
- Run tests | ||
- Build docker image locally | ||
- Run `yarn` to update `yarn.lock` | ||
- Commit `package.json` and `yarn.lock` | ||
- Run tests | ||
- Optional: Build docker image locally | ||
- Commit everything needed for the container image | ||
- Run `npm run tag-container` | ||
- Run `git push origin master` | ||
- Docker images are built automatically by the Docker hub for all tags starting with `dockerhub-v` | ||
|
||
## Development | ||
- Have [Node.js] v6, [yarn](https://yarnpkg.com/), [Docker](https://docs.docker.com/engine/installation/) and [docker-compose](https://docs.docker.com/compose/install/) installed | ||
- Go to the subdirectory in which you want to develop | ||
- Only for [api](api): Run `yarn install` | ||
- Start your development database (`docker-compose up -d db`) | ||
|
||
## Running Tests | ||
You can run the tests in containers using Docker and docker-compose. | ||
``` | ||
# Only run this once or every time you change dependencies in package.json | ||
./run-tests.sh build | ||
./run-tests.sh | ||
``` | ||
|
||
## Running the API | ||
### Configuration | ||
These packages read their configuration either from their respective `src/config.js` file or environment variables starting with `OSEM_`. Environment variables override values in `src/config.js`. | ||
## License | ||
|
||
### Container based | ||
The repository [OSeM-compose](https://github.com/sensebox/osem-compose) contains a deployment of all services with docker compose. The image built from this repository is called [`sensebox/opensensemap-api`](https://hub.docker.com/r/sensebox/opensensemap-api/). | ||
[MIT](license.md) - Matthias Pfeil 2015 - now | ||
|
||
[Node.js]:http://nodejs.org/ | ||
[MongoDB]:http://www.mongodb.com/ | ||
[openSenseMap]:https://opensensemap.org/ | ||
[senseBox]:https://sensebox.de/ |
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.