This dashboard demonstrates how to integrate Flask with HTML and JavaScript code to visualize and explore metrics for helping to choose a neighborhood that meets healthy lifestyle requirements. This project originally required to run on a Flask server. For future use to view the project, this version of the site has been convert to not need the Flask server. The original repo can be viewed here: https://github.com/nbullerds/Project-2-Healthy-Neighborhoods.
View revised dashboard on on GitHub pages: https://klharp.github.io/Healthy-Neighborhoods-Dashboard/templates/
Languages and libraries used:
- Python
- Pandas
- Flask
- SQLAlchemy
- JSON / GeoJSON
- D3
- Javascript
- HTML
- CSS
- Bootstrap
- Leaflet
- Plotly
- AnyChart
Please clone this repository and then do the following:
- Peruse the files and the project directory structure in the cloned directory to get familier with the project methodology. Note the use of the
templatesandstaticfolders. - In the
Project-2-Healthy-Neighborhoods/static/js/folder, create a file calledconfig.js - Go to https://www.mapbox.com/ and sign up for an API key. Copy that API key and place in in the
config.jsfile in a variable calledconst API_KEY = "PUT YOUR KEY HERE";and save the file. - In the
Project-2-Healthy-Neighborhoodsfolder, create a file calledconfig.py. - Assign your pgAdmin username to a variable called username, like so:
username = [pgAdmin username]. - Assign your pgAdmin password to a variable called password, like so:
password = [pgAdmin password]. - Assign your gkey (google API key to a variable called gkey, like so:
gkey = [google places API key], then saveconfig.py. If you don't have a google API key, see information here on how to get one https://developers.google.com/maps/documentation/places/web-service/get-api-key - In pgAdmin, create a new database called
MSP_Neighborhoods. - In the
MSP_Neighborhoodsdatabase, runNeighborhoodsTableSchema.sql, found in the\schema\folder, to generate tables for storing Neighborhood and Places data. - Open
Project 2 ETL notebook.ipynbin Jupyter Notebook - Run all the cells. This will store all data needed for the site within the
MSP_Neighborhoodsdatabase. This may take a few minutes to complete. - Run
python app.pyto launch a flask server connected to theMSP_Neighborhoodsdatabase. - Observe that the Flask server starts and tells you which port it's running on. Don't close this window.
- With the Flask server running, enter this address in your Chrome browser: http://127.0.0.1:5000/. You'll see that it loads the index page, allowing you to navigate the website with the data from
MSP_Neighborhoods.
- Nick Buller
- Kerry Harp
- Sofanit Mengesha
