Skip to content

🗣 Renters Speak gives users a peek behind the curtain of the New York City rental market. Designed for renters looking for more information about their current or prospective landlords, this app provides a platform for users to write and share reviews of landlords and also presents data related to building ownership and building maintenance viol…

Notifications You must be signed in to change notification settings

mauratee/Renters-Speak

Repository files navigation

forthebadge made-with-python

✨ About this Project

Renters Speak gives users a peek behind the curtain of the New York City rental market. Designed for renters looking for more information about their current or prospective landlords, this app provides a platform for users to write and share reviews of landlords and also presents data related to building ownership and building maintenance violations from NYC housing datasets. Users can search for information by address and Renters Speak provides reviews and housing data in an easy to understand, visually appealing format.

alt text

Technologies Used:

Languages:

  • Python 3
  • JavaScript
  • SQL
  • CSS
  • HTML 5
  • Flask
  • SQLAlchemy
  • Flask-SQLAlchemy

Libraries/Frameworks:

  • Python unittest
  • Flask test_client
  • PostgreSQL
  • Flask
  • SQLAlchemy
  • Flask-SQLAlchemy
  • Jinja 2
  • AJAX
  • jQuery
  • jQuery UI
  • Chart.js
  • Bootstrap

APIs:

  • Google Maps for JavaScript API
  • NYC Geosearch API
  • NYC housing datasets via NYCDB

Features

Create New User Account and Existing User Login

Users can register for a new account on the "Create New Account" page and existing users can login on the "Login" page. Bootstrap modal boxes implemented with Javascript interactive elements notify users of a successful or unsuccessful login request.

alt text

Logged In Users Can Write a Review

Users that are logged in can write and submit a review on the "Write a Review" page. The review is then saved to the database and available for other viewers on the detail page for that address.

alt text

Search an Address

Using the NYC Geosearch API and an AJAX request utilizing the JQuery UI Autocomplete widget, user input is sanitized and normalized and a list of matching NYC addresses is presented to the user to choose from.

alt text

Address Details - Reviews

When a searched address is submitted, the database is queried to present detailed information for the matching address. The Google Maps API is implemented to display a styled map of the searched address. Below the map, the Bootstrap CSS framework is used to organize and display information by tabs including a tab for renter reviews that match the specific address.

alt text

Address Details - Landlord Information

Another tab displays ownership and landlord information for the address and includes interactive Javascript dropdowns with more detailed information.

alt text

Address Details - Violation Information: Charts

The violations tab displays information about NYC housing violations related to the address. The first section contains interactive dropdowns that expand to display charts created with the Chart.js library to visually represent housing violation information by class and over time.

alt text

Address Details - Violations List

The violations tab also contains a list of all violations for the searched address which includes information about the date, class and description of each violation. Interactive Javascript buttons and alerts allow the user to diplay fewer, more, or all violations for a particular address.

alt text

Instructions to Run Renters Speak Web App:

Setup:

Use git clone or other method to copy entire contents of this repository to your local machine.

Install dependencies from requirements.txt (pip3 install -r requirements.txt, python3 -m pip install or other).

Run source secrets.sh in terminal to execute contents of secrets.sh.

Seed the Database:

Clone the NYCDB tool to your local development environment.

Use the postgres command createdb <name of database> to create the database.

Load datasets from NYCDB into your database:

Run nycdb -U <postgres username> -P <postgres password> -D <name of database> --load hpd_registrations to load the hpd_registrations and hpd_contacts tables.

Run nycdb -U <postgres username> -P <postgres password> -D <name of database> --load hpd_violations to load the hpd_violations table.

Run run model.py interactively python3 -i model.py and then run db.create_all() to create all the other tables in the database.

Query the Database

To view and query test database using SQL queries, enter psql testdb from terminal and enter (\q to exit).

To query testdbusing SQLAlchemy queries, run model.py in interactive mode and use quit() to exit.

To Run the Server:

Create a virtual environment in your local directory using virtualenv env or another virtual environment library.

Activate virtual environment by entering source env/bin/activate in terminal
Your command prompt should then show (env) at the beginning of the line

In terminal, enter python3 server.py
You should then see:
"Connected to the db!
* Serving Flask app 'server' (lazy loading)"

Next, in a web browser, navigate to http://localhost:5000/
You should then see the Renters Speak homepage!

To exit and stop running server, enter CTRL + c or CMD + c

To Run Tests:

In terminal, enter python3 tests.py
The output will tell you how many tests ran and how many failed of the tests that ran.

👏 Acknowledgements

Thanks to the New York Housing Data Coalition, the programmers of NYCDB, and my teachers, classmates and mentors at the Hackbright Academy Engineering Fellowship.

About

🗣 Renters Speak gives users a peek behind the curtain of the New York City rental market. Designed for renters looking for more information about their current or prospective landlords, this app provides a platform for users to write and share reviews of landlords and also presents data related to building ownership and building maintenance viol…

Topics

Resources

Stars

Watchers

Forks