Skip to content

Latest commit

 

History

History
40 lines (37 loc) · 1.05 KB

setup.md

File metadata and controls

40 lines (37 loc) · 1.05 KB

Setup instructions (local)

If you don't already, install Node and PostgreSQL on your computer.

NPM Packages

Run the following command:

npm i

Set up PostgreSQL database

  1. Open psql shell, login as a user
  2. Create a new database in the psql shell.
CREATE DATABASE DBNAME;
  1. To connect to this database, run this in psql.
\c DBNAME
  1. Get a sample database from the forum.sql file (with the data) by the following command on bash:
psql -d DBNAME -U USERNAME -f forum.sql

Alternatively, to create an empty database, run SQL commands from the file create_tables.sql. Do this in psql:

\i <absolute path of create_tables.sql in your PC>
  1. Check the database by running the following psql command
\d
  1. Change the value of the connectionString option in config/db.js to connect to your local database.
postgres://USERNAME:PASSWORD@localhost:5432/DBNAME
  1. Run the app by the following command
npm start