URBO's API. This project is the backend application of URBO solution for smart cities.
This is the code repository for URBO Core API, the backend application for the URBO project.
This repository provides the base code for the web API and needs to be complemented with pluggable verticals.
- NodeJS version 6.x or greater.
- Docker version 17.06 or greater.
- We recommend using GNU/Linux as server, but is not mandatory.
In order to run this application you will need to install UrboCore API along with some pluggable verticals.
- Clone this repository
- Create the config file on
config.yml
takingconfig.sample.yml
as template and fill it. - Create the database environment file on
db-config.env
takingdb-config.sample.env
as template and fill it. - Set up the database as is explained in the Setting up the database section.
- Install node dependencies with npm (or using
yarn
if you prefer).
npm install
- Install needed verticals as is explained in the Managing pluggable verticals section.
- Run server using docker-compose. It will be built in case it does not exist yet.
docker-compose up api
First, create the data container:
docker create --name urbo_pgdata -v /data debian /bin/true
Start the database:
docker-compose up -d postgis
Create the database for API and execute the start scripts:
docker-compose exec -T postgis psql -U postgres -f /usr/src/db/all.sql
To install or update a vertical you just need to execute:
npm run-script install-vertical -- <vertical-source-path> <vertical-name>
Remember to restart the server in order to apply this changes.
The same way you can install a new vertical you can delete it too executing:
npm run-script delete-vertical -- <vertical-name>
Remember to restart the server in order to apply this changes.
To run the tests, just execute:
docker-compose run api npm run-script test
The API documentation is available at https://geographicags.github.io/UrboCore-api/.
To update and upload the API documentation:
- Install mkdocs:
pip install mkdocs
- Build and upload
rm -R site
mkdocs gh-deploy --clean
- In case you only want to build the documentation:
mkdocs build
UrboCore API is licensed under Affero General Public License (GPL) version 3.