-
Starting the Database
Build the database image
cd data docker build -t scooters-postgis-image .
Run the image
docker run -d --name scooters-postgis-container -p 5555:5432 scooters-postgis-image
If the external port is changed (other than 5555), change the
server/.env
filePG_PORT=<NewPort>
-
Backend code is present in the server folder. Backend is configured to run at port 4000.
Install dependencies
npm install
Start the backend
npm start
-
Front end code is present in the client folder Install dependencies
npm install
Start the frontend
npm start
Your goal is to code a system that can fetch the closest x scooters for a given lat,lon within y meters and plot it on a map. This exercise will include front-end, backend and data storage, and you can choose any technology you’d like for each.
Steps:
- Create the data storage for the scooters and populate data for scooters placed randomly throughout Singapore.
- Write a backend service that can provide data to the front end for plotting the closest x scooters within y meters of a given lat,lon
- Write front end that allows you to set: x scooters y search radius lat, and long It should fetch the data based on these params from the backend service, and it should plot on a map.
Singapore max bounds are derieved from this link
Postgis base image link
Mapping library leaflet