Online marketplace enabling people to lease or rent apartments
The following instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

1) 'Angular 4' 2) Node.JS 3) Elasticsearch
A step by step series that tells you how to get a development env running
1) Clone the repository and go to the /backend folder
2) Run npm install -> This will download all the dependencies
3) Run npm start to start the server.
4) Open localhsot:3000 and it should print a welcome message
To run the automated test cases for this system
Go to the /backend folder and run npm test command. This should start the automated test cases.
This API is used to add or post new sublease apartments.
-
URL
http:// IP Address:3000/add -
Method:
POST -
URL Params
None -
Data Params
{ "title": "some title", "owner": "saptarshi", "location": "gainesville, Florida, USA", "zipcode": 32608, "description": "brief description about the apartment", "geolocation" : { "lat" : 40.12, "lon" : -71.34 }, "details": { "accomodates": 1, "bathrooms": 1, "bathroomtype": "private", "bedrooms": 2, "studio": false, "beds": 2, "petfriendly": true, "propertytype": "private", "roomtype": "private room" }, "amenities": { "kitchen": true, "internet": false, "tv": true, "essentials": false, "shampoo": true, "heating": false, "airconditioning": true, "washer": true, "dryer": true, "free_parking_on_premises": true, "free_parking_on_street": false, "paid_parking_off_premises": false, "wireless_internet": true, "cable_tv": true, "family_or_kid_friendly": true, "suitable_for_events": false, "smoking_allowed": false, "wheelchair_accessible": true, "elevator": true, "indoor_fireplace": false, "buzzer_or_wireless_intercom": false, "doorman": false, "pool": true, "hottub": true, "gym": true, "hangers": true, "laptop_friendly_workspace": true, "private_entrance": false, "window_guards": false, "bathtub": true }, "house_roles": ["No smoking", "No parties or events", "Check in time is 12PM (noon) - 5PM" ] } -
Success Response:
- Code: 200
Content:{ id : the identifier of the newly listed apartment }
- Code: 200
-
Error Response:
- Code: 401 UNAUTHORIZED
Content:{ error : "Log in" }
OR
- Code: 400 BAD REQUEST
Content:{ error : "JSON Invalid" }
- Code: 401 UNAUTHORIZED
-
Sample Call:
curl -H "Content-Type: application/json" -X POST -d '<your json data>' http://127.0.0.1:3000/add
This API is used to get all the apartments present in the DB.
-
URL
http:// IP Address:3000/get -
Method:
GET -
URL Params
None -
Data Params
None -
Success Response:
- Code: 200
Content:[{ id : the identifier of the newly listed apartment }] -> [id1, id2, id3]
- Code: 200
-
Error Response:
- Code: 401 UNAUTHORIZED
Content:{ error : "Log in" }
OR
- Code: 400 BAD REQUEST
Content:{ error : "Invalid Request" }
OR
- Code: 404 NOT FOUND
Content:{ error : "No entry found in DB" }
- Code: 401 UNAUTHORIZED
-
Sample Call:
curl http://127.0.0.1:3000/get
This API is used to delete all the apartments present in the DB.
-
URL
http:// IP Address:3000/get -
Method:
DELETE -
URL Params
None -
Data Params
None -
Success Response:
- Code: 200
Content:[{ true }]
- Code: 200
-
Error Response:
- Code: 401 UNAUTHORIZED
Content:{ error : "Log in" }
OR
- Code: 400 BAD REQUEST
Content:{ error : "Invalid Request" }
OR
- Code: 404 NOT FOUND
Content:{ error : "No entry found in DB" }
- Code: 401 UNAUTHORIZED
-
Sample Call:
curl -X "DELETE" http://127.0.0.1:3000/delete
This API is used to get a specific apartment, if it is present in the DB.
-
URL
http:// IP Address:3000/get_id?id=some id -
Method:
GET -
URL Params
id -
Data Params
None -
Success Response:
- Code: 200
Content:[{ information about the element with specific id }]
- Code: 200
-
Error Response:
- Code: 401 UNAUTHORIZED
Content:{ error : "Log in" }
OR
- Code: 400 BAD REQUEST
Content:{ error : "Invalid Request with non-existing id" }
OR
- Code: 404 NOT FOUND
Content:{ error : "No entry found in DB" }
- Code: 401 UNAUTHORIZED
-
Sample Call:
curl http://127.0.0.1:3000/get_id?id=12345cf234
This API is used to delete all the apartments present in the DB.
-
URL
http:// IP Address:3000/delete_id?id=someid" -
Method:
DELETE -
URL Params
id -
Data Params
None -
Success Response:
- Code: 200
Content:[{ id : the identifier of the newly listed apartment }] -> [id1, id2, id3]
- Code: 200
-
Error Response:
- Code: 401 UNAUTHORIZED
Content:{ error : "Log in" }
OR
- Code: 400 BAD REQUEST
Content:{ error : "Invalid Request" }
OR
- Code: 404 NOT FOUND
Content:{ error : "No entry found in DB" }
- Code: 401 UNAUTHORIZED
-
Sample Call:
curl -X "DELETE" http://127.0.0.1:3000/delete_id?id=12334cf2