|
1 | 1 | <div align="center">
|
2 | 2 | <img alt="pg_scheduleserv logo" src="./docs/images/logo.png" width="250px" />
|
3 | 3 |
|
4 |
| - # pg_scheduleserv - VRP scheduler over the web |
| 4 | +# pg_scheduleserv - VRP scheduler over the web |
5 | 5 |
|
6 |
| - [](https://pkg.go.dev/github.com/Georepublic/pg_scheduleserv) |
| 6 | +[](https://pkg.go.dev/github.com/Georepublic/pg_scheduleserv) |
7 | 7 | [](https://go.dev/doc/go1.17)
|
8 | 8 | [](https://goreportcard.com/report/github.com/Georepublic/pg_scheduleserv)
|
9 | 9 | [](https://github.com/Georepublic/pg_scheduleserv/releases)
|
|
17 | 17 |
|
18 | 18 | A RESTful API Server for scheduling VRP tasks using [vrpRouting](https://github.com/pgRouting/vrprouting), written in [Go](https://golang.org/).
|
19 | 19 |
|
20 |
| -API Documentation: [docs/api.md](./docs/api.md) |
| 20 | +API Documentation: [docs/api.md](./docs/api.md) |
21 | 21 | Release Notes: [NEWS.md](./NEWS.md)
|
22 | 22 |
|
23 | 23 | ## Status
|
24 | 24 |
|
25 |
| -Service | Main | Develop |
26 |
| ---- | --- | --- |
27 |
| -Test | [](https://github.com/Georepublic/pg_scheduleserv/actions/workflows/test.yml?query=branch%3Amain) | [](https://github.com/Georepublic/pg_scheduleserv/actions/workflows/test.yml?query=branch%3Adevelop) |
28 |
| -Lint | [](https://github.com/Georepublic/pg_scheduleserv/actions/workflows/lint.yml?query=branch%3Amain) | [](https://github.com/Georepublic/pg_scheduleserv/actions/workflows/lint.yml?query=branch%3Adevelop) |
29 |
| -Coverage | [](https://app.codecov.io/gh/Georepublic/pg_scheduleserv/branch/main) | [](https://app.codecov.io/gh/Georepublic/pg_scheduleserv/branch/develop) |
| 25 | +| Service | Main | Develop | |
| 26 | +| -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 27 | +| Test | [](https://github.com/Georepublic/pg_scheduleserv/actions/workflows/test.yml?query=branch%3Amain) | [](https://github.com/Georepublic/pg_scheduleserv/actions/workflows/test.yml?query=branch%3Adevelop) | |
| 28 | +| Lint | [](https://github.com/Georepublic/pg_scheduleserv/actions/workflows/lint.yml?query=branch%3Amain) | [](https://github.com/Georepublic/pg_scheduleserv/actions/workflows/lint.yml?query=branch%3Adevelop) | |
| 29 | +| Coverage | [](https://app.codecov.io/gh/Georepublic/pg_scheduleserv/branch/main) | [](https://app.codecov.io/gh/Georepublic/pg_scheduleserv/branch/develop) | |
30 | 30 |
|
31 | 31 | ## Getting Started
|
32 | 32 |
|
33 | 33 | ### Requirements
|
34 | 34 |
|
35 |
| -- Build Requirements: |
36 |
| - - [Go](https://golang.org/) == 1.17 |
| 35 | +- Build Requirements: |
37 | 36 |
|
38 |
| -- Usage Requirements: |
39 |
| - - [vrpRouting](https://github.com/pgRouting/vrprouting) >= 0.2.0 |
40 |
| - - [VROOM](https://github.com/VROOM-Project/vroom) >= 1.10.0 is required to build vrpRouting. |
41 |
| - - [pgRouting](https://github.com/pgRouting/pgrouting) |
42 |
| - - [PostGIS](https://postgis.net/) |
43 |
| - - [PostgreSQL](https://www.postgresql.org/) |
44 |
| - - C and C++ compilers with C++17 standard support |
45 |
| - - The Boost Graph Library (BGL) >= 1.65 |
46 |
| - - CMake >= 3.12 |
| 37 | + - [Go](https://golang.org/) == 1.17 |
| 38 | + |
| 39 | +- Usage Requirements: |
| 40 | + - [vrpRouting](https://github.com/pgRouting/vrprouting) >= 0.3.0 |
| 41 | + - [VROOM](https://github.com/VROOM-Project/vroom) >= 1.11.0 is required to build vrpRouting. |
| 42 | + - [pgRouting](https://github.com/pgRouting/pgrouting) |
| 43 | + - [PostGIS](https://postgis.net/) |
| 44 | + - [PostgreSQL](https://www.postgresql.org/) |
| 45 | + - C and C++ compilers with C++17 standard support |
| 46 | + - The Boost Graph Library (BGL) >= 1.65 |
| 47 | + - CMake >= 3.12 |
47 | 48 |
|
48 | 49 | ### Download and run
|
49 | 50 |
|
50 | 51 | Builds of the latest code can be found in the [releases](https://github.com/Georepublic/pg_scheduleserv/releases).
|
51 |
| -- Download the latest executable for Linux, say [pg_scheduleserv-0.1.0](https://github.com/Georepublic/pg_scheduleserv/releases/download/v0.1.0/pg_scheduleserv-0.1.0). |
52 |
| -- Change permissions to make it an executable: `chmod +x pg_scheduleserv-0.1.0` |
53 |
| -- Create `app.env`, and set the values to the environment variables: |
54 |
| - - POSTGRES_USER=username |
55 |
| - - POSTGRES_PASSWORD=password |
56 |
| - - POSTGRES_HOST=localhost |
57 |
| - - POSTGRES_PORT=5432 |
58 |
| - - POSTGRES_DB=scheduler |
59 |
| - - SERVER_BIND_ADDRESS=:9100 |
60 |
| -- Create the tables in the database with the help of the migrations file. |
61 |
| -- Run the executable to start the API server on http://localhost:9100 |
| 52 | + |
| 53 | +- Download the latest executable for Linux, say [pg_scheduleserv-0.2.0](https://github.com/Georepublic/pg_scheduleserv/releases/download/v0.2.0/pg_scheduleserv-0.2.0). |
| 54 | +- Change permissions to make it an executable: `chmod +x pg_scheduleserv-0.2.0` |
| 55 | +- Create `app.env`, and set the values to the environment variables: |
| 56 | + - POSTGRES_USER=username |
| 57 | + - POSTGRES_PASSWORD=password |
| 58 | + - POSTGRES_HOST=localhost |
| 59 | + - POSTGRES_PORT=5432 |
| 60 | + - POSTGRES_DB=scheduler |
| 61 | + - SERVER_PORT=:9100 |
| 62 | + - OSRM_URL=https://router.project-osrm.org |
| 63 | + - VALHALLA_URL=https://valhalla1.openstreetmap.de |
| 64 | +- Create the tables in the database with the help of the migrations file. |
| 65 | +- Run the executable to start the API server on http://localhost:9100 |
62 | 66 |
|
63 | 67 | ### Build from source
|
64 | 68 |
|
65 | 69 | All the steps are similar as above, except that the executable will be built from source.
|
66 | 70 |
|
67 | 71 | `pg_scheduleserv` is developed using Go 1.17. To build this project from source:
|
68 |
| -- Ensure that the Go compiler is installed |
69 |
| -- Download or clone this repository. |
70 |
| -- Copy `app.env.example` to `app.env`, and set the values to the environment variables. |
71 |
| -- Apply migrations from the `migrations/000001_init.up.sql` file to the database. |
72 |
| -- Run `go build` command inside the directory to create the executable named `pg_scheduleserv` |
73 |
| -- Run the executable to start the API server on http://localhost:9100 |
| 72 | + |
| 73 | +- Ensure that the Go compiler is installed |
| 74 | +- Download or clone this repository. |
| 75 | +- Copy `app.env.example` to `app.env`, and set the values to the environment variables. |
| 76 | +- Apply migrations from the `migrations/000001_init.up.sql` file to the database. |
| 77 | +- Run `go build` command inside the directory to create the executable named `pg_scheduleserv` |
| 78 | +- Run the executable to start the API server on http://localhost:9100 |
74 | 79 |
|
75 | 80 | ### Usage
|
76 | 81 |
|
77 |
| -Any API client can be used to interact with the API server. The API can also be tested using the Swagger documentation. These documenations can be accessed after running the API server on the following URLs: |
78 |
| -- Swagger UI: http://localhost:9100 |
79 |
| -- RapiDoc: http://localhost:9100/rapidoc |
80 |
| -- Redoc: http://localhost:9100/redoc |
| 82 | +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.udc.pgrouting.org/ |
| 83 | + |
| 84 | +These documenations can be accessed after running the API server on the following URLs: |
| 85 | + |
| 86 | +- Swagger UI: http://localhost:9100 |
| 87 | +- RapiDoc: http://localhost:9100/rapidoc |
| 88 | +- Redoc: http://localhost:9100/redoc |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | +### Demo Application |
| 93 | + |
| 94 | +A frontend demo application for the API resides in the `demo` directory. Sample deployed demo application can be found on https://vrpdemo.udc.pgrouting.org/ |
| 95 | + |
| 96 | +To run the demo application: |
| 97 | + |
| 98 | +- Change directory to the `demo` directory: `cd demo` |
| 99 | +- Make sure that node is installed. Install the other requirements: `npm install` |
| 100 | +- Run the application: `node server.js`. The application will run at http://localhost:9101 and will use the API running at http://localhost:9100 |
| 101 | +- To change the Server Base URL or the OSRM API URL, modify the `js/config.js` file. |
| 102 | + |
| 103 | + |
81 | 104 |
|
82 | 105 | ## LICENSE
|
83 | 106 |
|
|
0 commit comments