This dashboard demonstrates how to integrate Flask with HTML and JavaScript code. This project will note run on LiveServer, a Flask server must be used.
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
templates
andstatic
folders. - 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.js
file in a variable calledconst API_KEY = "PUT YOUR KEY HERE";
and save the file. - In the
Project-2-Healthy-Neighborhoods
folder, 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_Neighborhoods
database, runNeighborhoodsTableSchema.sql
, found in the\schema\
folder, to generate tables for storing Neighborhood and Places data. - Open
Project 2 ETL notebook.ipynb
in Jupyter Notebook - Run all the cells. This will store all data needed for the site within the
MSP_Neighborhoods
database. This may take a few minutes to complete. - Run
python app.py
to launch a flask server connected to theMSP_Neighborhoods
database. - 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