A nodeJS backend application to serve a REST delivery service. The frontend of this application can be found at this address. The description of the project can be found in this document: HR-FrontendDeveloperTest-201118-1829-362.pdf
-
First install the needed packages:
npm install
-
Now you can run the application (Will listen to this
http://localhost:8000/
):node bin/www
-
If you want to develop the code, you can install nodemon and run it with nodemon to be able to watch the changes:
npm install nodemon nodemon bin/www
-
The application uses mockup data for shipments and users which are in the folder of mockupData
.
- For creating new mockup data, use this code:
# It is necessary to cd in the directory, to create the mockup data files in the appropriate directory. cd mockupData node createMockupShipments.js node createMockupUsers.js
- Why not using websocket instead? It is easier and more suitable for this purpose.
- Or at least use
long polling
to get the live data
- Or at least use
- Create a real authentication (Create login tokens with
nonce
andiv
and save the ip of the user) - Check the access of user in
guaed
(Do not let a user with the role ofbiker
see others' parcels) - Use a database instead of mockup data (SQLite3 is a good choice for the start)