- cd into the /server folder.
- From the /server folder, run
npm install
(server dependencies). - Open a second terminal and cd into the /client folder.
- From the /client folder, run
npm install
(React dependencies). - Use
npm run server
from the /server terminal to start the server onhttp://localhost:3000/
- User
npm start
from the /client terminal to start the client on 3001
- From the /Final_Project folder, run
psql
. - From the psql terminal, run
CREATE DATABASE air_iq;
. - Use
\q
to leave the psql terminal. - Run
npx knex migrate:currentVersion
to check if a table already exists. - If a current version exists, run
npx knex migrate:rollback
then repeat from step 4 until it says none.
- Most versions of knex will only need you to rollback once to clear all of them
- Run
npx knex migrate:latest
to create the empty migration tables. - To populate the database with static data, run
npx knex seed:run
- For more informations about PostgreSQL on Ubuntu: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-18-04
- You will need to generate and add your own Google maps API key, following the unfortunate change to a paid use/access to the API in 2018.
These keys will need to be added in order to look up locations beyont the default geolocation/Montreal view, and and to view the 'mapview' of the Air Quality currently being retreived on the front page.
NOTE: To use the Maps JavaScript API, you must get an API key and you must enable billing in your account. The links above will explain the necessary steps in further detail. You can enable billing when you get your API key (see the Quick guide) or as a separate process (see Usage and Billing).
- Add API Key to two files.
First, in the client folder (/client/public/index.html), in the index.html file, at the line
script src="https://maps.googleapis.com/maps/api/js?key=INSERTAPIKEYHERE&libraries=places"
. Second, in the client folder, (/client/src/components/pages/MapView.js), in the MapView.js file, at line 287:apiKey: ('INSERTAPIKEYHERE')