Challenge Overview
Project Overview
The app will allow users to view & rate interesting locations, based on their current location or an address they search on. Users will input their address in a google map, and the app will show related locations on the map.
Challenge Requirements
Create a Node.JS Backend, with REST APIs to support the use cases. The Node.JS application will be hosted on IBM BlueMix. Database could be Mongo Db or MySql
Business Requirements
There will be several different types of establishments that will be stored in the app database. Hotels, Restaurants, Office Addresses, will all appear and a user can add locations and reviews. Some of the Location points will be predefined, and cannot be changed or reviewed by the user e.g. office address.The predefined locations are stored in IBM Locations, IBM Hotels and IBM Merchants. These tables will be replaced every month by the Admin. Hence there are no related tables related to these 3 entities.
Technical Requirements
Database Schema
Database Schema Notes.
There are 4 common fields in the database created for auditing purpose. These fields will be automatically updated by the backend API, and will never be passed from front end.
Created By Id (The user creating the record)
Created Date (DateTime, System.now(), populated when record is created)
Last Modified By Id (The user modifying the record. When record is created for the first time, this value will be equal to Created By Id)
Last Modified Date (DateTime, System.now(), populated when record is modified, during creation this will be = Created Date.
Travel Comp Location Type
Stores the Location Types that the application can hold. sample values, Hotel, Restaurant, Location. Acts as the metadata store for various location types.
It also stores the Fields to be displayed for collecting a user review (Not all review fields are applicable to all types of reviews)
Mandatory fields for submitting a review.
Travel Comp Location
Stores the Address, that needs to be displayed
Location Id is Autonumber, generated by the system.
Location Code is generated by the user, and is unique for the same location types
LocationType should be one of the values in Location Type table
If Location Type Is User Add Allowed is marked as false, location of those type cannot be added by the user.
Review Photos
Review Photos will be tagged as menu, establishment etc. The metadata will be used to display images accordingly on the UI.
API Requirements
Two sets of APIs are needed, one for generic operation, another for specific operations
Authentication
Authentication will happen via IBM SSO. Can be ignored for this application.
Generic APIs
1. Generic Apis Need to support CRUD operation on all tables for single record
return example {Sucess:true|false, id:”Insert / Update Id”,error:”Optional showing error if any in operation”}
2. Location table Insert / Update Single Record
3. Should be able to insert / update Location Record along with related objects like Work hours
4. Review Insert / Update Single Record
Should be able to insert / update related records like Review Comments, Review Photos, Review Likes etc.
Other Specific APIs & Use Cases
Search will be a basic requirement for the application. The backend service should provide extensive method to search for locations based on Name of the establishment, /address / city and/ or postal code and/ or latitude longitude.
User will provide his location in any or many of the above forms. Need to return matching locations, of various types . By default the application returns IBM Locations, IBM Hotels and IBM Merchants. The search query will provide the parameters for various results expected.
One additional value that should be returned is distance from the input address. Please see the UI prototype as well.
eg Input {
Current Address : “User Address”
Sort By : Distance | Location Type
Search withIn : 10 miles | 5 km
User Added Only : true | false
Load Reviews : true | false
Search Params : [ {
Location Type: “Hotel”,
Size: 10 // If no size is specified, return all records matching
},
{
Location Type: “Office Address”,
}] }
Return {
Search Results [{
Location records
}]
}
2. Add New Location By Normal User (Should be use the generic apis)
3. Add Review to a Location (Should be able to use generic apis, validate however the mandatory fields are provided as per schema)
4. My Reviews
5. My Recently Added Locations
6. The admin needs to be able to completely drop and reload the IBM Locations, IBM Approved Hotel list and locations via csv file. Will be done by PHP Admin Panel or equivalent for database chosen, hence no coding is required.
Some scenarios that should be covered:
- If a Merchant gets reviews, the restaurant data should be copied over into Travel Comp Location table and if the restaurant is not in the IBM Merchants , it should be displayed as a user added restaurant.
- If someone marks an establishment as a favorite, the location/hotel/ Merchant should be copied to IBM Travel Comp table
Final Submission Guidelines
1. Complete Source Code along with Test code coverage and Sample Data
2. API documentation
3. Deployment Guide with Detailed Verification Steps