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.
- Python 3
- JavaScript
- SQL
- CSS
- HTML 5
- Flask
- SQLAlchemy
- Flask-SQLAlchemy
- Python unittest
- Flask test_client
- PostgreSQL
- Flask
- SQLAlchemy
- Flask-SQLAlchemy
- Jinja 2
- AJAX
- jQuery
- jQuery UI
- Chart.js
- Bootstrap
- Google Maps for JavaScript API
- NYC Geosearch API
- NYC housing datasets via NYCDB
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.
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.
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.
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.
Another tab displays ownership and landlord information for the address and includes interactive Javascript dropdowns with more detailed information.
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.
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.
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
.
Clone the NYCDB tool to your local development environment.
Use the postgres command createdb <name of database>
to create the 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.
To view and query test database using SQL queries, enter psql testdb
from terminal and enter (\q
to exit).
To query testdb
using SQLAlchemy queries, run model.py
in interactive mode and use quit()
to exit.
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
In terminal, enter python3 tests.py
The output will tell you how many tests ran and how many failed of the tests that ran.
Thanks to the New York Housing Data Coalition, the programmers of NYCDB, and my teachers, classmates and mentors at the Hackbright Academy Engineering Fellowship.