Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Method 2: Manual Setup (Not Recommended - Skip to Initial Database Migration if completed above)

  1. PostgreSQL Setup

    1. Mac Setup: The easiest way to install PostgreSQL on a Mac is with Postgres.app.

    2. Windows Setup: Install the newest PostgreSQL and follow all default steps. At points where it asks for any psql package installs, please include them. If a password or multiple are required, remember these passwords (they will be important later). After the installation, please restart your CLI of choice (Powershell, Command Prompt, etc).

  2. Database Initialization

    1. After downloading and installing PostgreSQL properly, you'll need to run PostgreSQL and create a database named nerpm. By default, PostgreSQL typically has a postgres database. You can use psql in the CLI to create a database by running this SQL statement (after running psql): CREATE DATABASE nerpm; (make sure to include the semicolon!). Naming the new database nerpm will ensure it matches with the database URL specified in the project preparation section below.

    2. Alternatively, if the psql command does not work (likely due to the PATH variable not being set), try the command psql -U postgres (as postgres is the default username) and mimic the above steps after that. If these both fail, you can use pgAdmin instead. Search for the "pgAdmin 4" application on your computer's search bar and open it. Here, click on "Servers" and right click on "Databases" and then navigate to "Create" and then "Database..." and then use the name nerpm (for the same reason as above).

  3. .env setup

    1. Navigate to the src/backend directory and add a .env file here via ni .env [Windows] or touch .env [Mac] in the CLI or create the new file manually in your IDE. 

    2. Mac setup: Paste the following line into the .env file and replace <USERNAME> with your computer username: DATABASE_URL="postgresql://<USERNAME>:@localhost:5432/nerpm?schema=public"

    3. Windows setup: Paste the following line into the .env file and replace <PASSWORD> with the password you created earlier: DATABASE_URL="postgresql://postgres:<PASSWORD>@localhost:5432/nerpm?schema=public" 

...