Setting up a Local DB (Windows) - SEAI-H-2020/Software GitHub Wiki
Database
Installing PostgreSQL
First things first, start by downloading the installer from the official page, we recommend using version 13.1
After downloading, click and run the installer using the default options.
- Remember to choose "postgres" as the password
- Choose "Portuguese, Portugal" as the locale because of timestamps and encoding
Accessing the postgreSQL server
After running the installer you should now have pgAdmin4 installed. Search in the windows menu for pgadmin and it should open in your default browser. Now if you go to Servers you should have a PostgreSQL <version_number> server click it and type the password you chose during the installation. If you can't see the postgresql server try adding a new server with the following connection properties:
- Host: localhost
- Port: 5432
Authentication method
To ensure the correct authentication method, add/change the following line in the pg_hba.conf file (located in Program Files\PostgreSQL\x\data)
host all all all md5
Then, restart the PostgreSQL service (accessible in Windows Services Manager - run services.msc)
Importing the database
Open pgadmin and run the query tool (Alt + Shift + Q). Copy the SQL code from 'db/DBCreationScript.sql' and execute the query (F5).
Backend Server
Installation
To install the backend server you need to install node.js the easiest way to do this is probably to run the installer from the official website.
Note: Altough you don't need to tick the additional tools option it will install useful stuff such as python (which will be needed for the simulation script) but python can also be installed separately and it also installs a lot of not needed stuff so chose whichever option you prefer
Deploying the server
After the node installation is done open a terminal of your choosing (I recommend Git Bash but it's up to you)
Start by cloning the github repo:
git clone https://github.com/SEAI-H-2020/Software.git
Change into the server directory
cd Software/server
Install all dependencies
npm install
Finally, run the server:
node index