Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 1.85 KB

README.md

File metadata and controls

59 lines (41 loc) · 1.85 KB

Neighborhood

This is the "Neighborhood" module in our TopBunk web application that implements a scalable back-end on an existing project.

Related Projects

Installing Dependencies

From within the root directory:

npm install

Development

Set up postgreSQL and create a database named "neighborhood"

Create config.js file and save PostgreSQL password in this format:

module.exports = {
  DB_PASSWORD: "your_password"
}

To set up development environment:

# Compile bundle.js using Webpack
npm run build

# Create a CSV file with 10 million fake entries using Node.js
npm run load

# Alternatively, create a CSV file with 10 million fake entries using Go
go get github.com/icrowley/fake
npm run go-seed

# Seed Listings CSV, Neighborhood data, and Landmarks data into postgreSQL database
npm run seed

# Start the server
npm run start-dev

Access the application at (http://localhost:5001)

Data Schema

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

  • Listings: each record corresponds to one listing on TopBunk, 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