Skip to content

Staybnb/Neighborhood

Repository files navigation

Neighborhood

This module displays information about the neighborhood of a specific Staybnb listing. To visit a page of the deployed Neighborhood service, go here.

Related Projects

Development

Setting up config.js

The database seed script will create a local PostgreSQL database that is configured in database/index.js. It relies upon a config.js file that you must create at the root level of the project with your PostgreSQL database's username (localDBUser) and password (localDBpw). The config.js file should also have a Google Maps API Key (GoogleMapsAPIKEY).

Launching the application locally

From within the root directory:

npm install

To run the application in non-development mode from within the root directory:

# Compile bundle.js using Webpack
npm run react-prod

# Create the local database
npm run seed

# Start server on localhost
npm start

Then access the application at: http://localhost:3001/listing?id=9873### replacing ### with any three-digit number from 1 to 100 to correspond the listing ID. For example, listing 27 would be http://localhost:3001/listing?id=9873027.

Data Schema

This module's data is stored in a PostgreSQL database. There are three tables:

  • Listings: each record corresponds to one listing on Staybnb, and includes location information (lat/long) and host-inputted descriptions.
  • Neighborhoods: each record corresponds to one of 15 neighborhoods in which all listings are located, and includes identifying names for different geographic levels related to the neighborhood as well as seven features of the neighborhood.
  • Landmarks: each record corresponds to a well-known landmark in London, along with its location (lat/long). This data will be used to display to the client the five nearest landmarks to a given listing.

The schema is shown below.

database schema

About

"About the Neighborhood" module

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published