This is a powerful React application designed to demonstrate how our API can be integrated. See the live example.
The demo app encapsulates all the logic within a single browser page, with 4 main components:
- The
customer
is a user who can place orders in our store, which will be delivered to a pick-up point or a selected address. The customer can also request delivery from point A to point B. - The
driver
is a user who accepts orders, navigates to the order, brings it, and delivers it to the destination point. The server tracks their position and builds past and remaining routes. - The
manager
is a user who can view both orders and drivers and analyze them. - The
server
is the page application that simulates server work. It patcheswindow.fetch
to interact with/api/...
requests. The server stores entities in aSQLite
database using a fork of SQL.js, with the RTree module enabled. The server also provides an HTTP interface similar toExpress.js
.
The application includes the following APIs:
- Geosuggest API - used in case of searching for addresses for the customer.
- Places API - used for finding necessary points on the map for the customer.
- Geocoder API - to obtain the coordinates of a point based on an address and vice versa.
- Distance Matrix API for calculating distance and route time. Used at the server to find the closest warehouse that can package the order after it is created.
- Route Details API for building routes between two or more points. Used to plan routes for the customer, arrival, and remaining for the driver.
- The Static API is used by the application to demonstrate a selected pickpoint on the map for
customer
. - The JavaScript API is used to show interactive maps for
customer
,driver
andmanager
.