A RESTful API Server for scheduling VRP tasks using vrpRouting, written in Go.
API Documentation: docs/api.md
Release Notes: NEWS.md
Service | Main | Develop |
---|---|---|
Test | ||
Lint | ||
Coverage |
-
Build Requirements:
- Go == 1.17
-
Usage Requirements:
- vrpRouting >= 0.3.0
- VROOM >= 1.11.0 is required to build vrpRouting.
- pgRouting
- PostGIS
- PostgreSQL
- C and C++ compilers with C++17 standard support
- The Boost Graph Library (BGL) >= 1.65
- CMake >= 3.12
- vrpRouting >= 0.3.0
Builds of the latest code can be found in the releases.
- Download the latest executable for Linux, say pg_scheduleserv-0.2.0.
- Change permissions to make it an executable:
chmod +x pg_scheduleserv-0.2.0
- Create
app.env
, and set the values to the environment variables:- POSTGRES_USER=username
- POSTGRES_PASSWORD=password
- POSTGRES_HOST=localhost
- POSTGRES_PORT=5432
- POSTGRES_DB=scheduler
- SERVER_PORT=:9100
- OSRM_URL=https://router.project-osrm.org
- VALHALLA_URL=https://valhalla1.openstreetmap.de
- Create the tables in the database with the help of the migrations file.
- Run the executable to start the API server on http://localhost:9100
All the steps are similar as above, except that the executable will be built from source.
pg_scheduleserv
is developed using Go 1.17. To build this project from source:
- Ensure that the Go compiler is installed
- Download or clone this repository.
- Copy
app.env.example
toapp.env
, and set the values to the environment variables. - Apply migrations from the
migrations/000001_init.up.sql
file to the database. - Run
go build
command inside the directory to create the executable namedpg_scheduleserv
- Run the executable to start the API server on http://localhost:9100
Any API client can be used to interact with the API server. The API can also be tested using the Swagger documentation. Sample deployed API can be found on https://api-v0.udc.pgrouting.org/
These documenations can be accessed after running the API server on the following URLs:
- Swagger UI: http://localhost:9100
- RapiDoc: http://localhost:9100/rapidoc
- Redoc: http://localhost:9100/redoc
A frontend demo application for the API resides in the demo
directory. Sample deployed demo application can be found on https://demo-v0.udc.pgrouting.org/
To run the demo application:
- Change directory to the
demo
directory:cd demo
- Make sure that node is installed. Install the other requirements:
npm install
- Run the application:
node server.js
. The application will run at http://localhost:9101 and will use the API running at http://localhost:9100 - To change the Server Base URL or the OSRM API URL, modify the
js/config.js
file.
This project is licensed under the GNU Affero General Public License v3.0. View LICENSE for more details.