Track 2 Repo: https://github.com/david-fisher/320-F20-Track-II
Track 4 Repo: https://github.com/david-fisher/320-F20-Track-IV
-
Install postgreSQL:
https://www.postgresql.org/download/ -
Add
PostgreSQL/[version, either 12 or 13]/bin
andPostgreSQL/[version, either 12 or 13]/lib
to PATH (on Windows) or make it an environment variable on Mac/Linux -
in command prompt or terminal, call
psql -U postgres -f [full filepath to database_setup.sql]
. note: The filedatabase_setup.sql
can currently be found in theerd-implementation
branch in thedatabase
folder.
-
run
npm install all
within the directory containingpackage.json
to install all dependencies for the pg package, which is the library used to communicate between the PostgreSQL database and the react.js app, as well as all other dependencies outlined in thepackage_lock.json
file -
In
goon-universe
, the app can be run withnode app.js
. -
Using the functions outlined in
queries.js
, which implements the REST API enumerated inapp.js
, frontend teams can now interact with the database from their React.js app as usual. -
Worth noting: the
pg
package's use depends on certain user credentials used to access a common database (namely, the username/password for the postgresql database which you've set up usingdatabase_setup.sql
). Since the git repository is public, it's a security risk to store these credentials in public on the clear web. Thus, we are using a .env file (locally, for now) to store these credentials. You will not be able to access the database from the React app without a properly configured .env file!
-
Install Node.js:
https://nodejs.org/en/download/ -
Go into the folder
frontend
in the command line. -
Run
npm install
in the command line to install all dependencies required to run the app. -
Run
npm start
in the command line to start the app.
- in command prompt or terminal, run
psql -U [user] -f [full filepath to insert_example_data.sql]
. This file can currently be found in theerd-implementation
branch in thedatabase
directory.