We are going to prepare a few simple endpoints where we can monitor where a traveler is walking around in the day and where they have been most recently.
- MongoDB (MongooseJS as adapter)
- Expressjs
- Typescript (Optional)
** You need to manually create an example travaler object on mongodb traveler collection **
Example:
{
name: 'Markakod',
lastLocation: []
}
- name : String
- lastLocation : Array (coordinates lat, lng)
- traveler id: Reference
- lastLocation : Array (coordinates lat, lon)
- createdAt
You need to define an endpoint on expressJS and POST the location information of the traveler to this endpoint (lat, long). with another endpoint, we can pull the locations into an array.
//get traveler daily routes
[GET] localhost:5556/api/v1/summary/:TRAVELER_ID
//get traveler last location
[GET] localhost:5556/api/v1/traveler/route/:TRAVELER_ID
//new traveler coordinate
[POST] localhost:5556/api/v1/coordinate
[BODY] => {
"travelerId": "587e96c27ffdcf1cfb2ce5d4",//traveler id for new location
"coordinate": [41.001759, 29.095316] //traveler current location (lat, long)
}
What is expected is mainly the use of express, the use of asynchronous block, template engine working logic and using ORM. You do not have to work for the UI to look.
You should create a repository on any git services (github, bitbucket etc...) and you can send an email with the url of your repository after you finished the challange.
If you have any other questions about the challange project feel free to contact with omer.demircan@markakod.com