This guide will walk you through the necessary steps to setting up and running the software.
- Docker installed on your machine. Find the installation here at https://www.docker.com/get-started/
- Clone the repository to your local machine:
git clone https://github.com/BESTLisbon/CR-database
- Navigate to the directory of the repository:
cd /path/to/bd_proj_e2
- Start the Docker containers using Docker Compose:
docker-compose up --build -d
This will build and run the containers and now the application should be running on you local machine.
- Visit http://localhost:3000/ to visit the React app
- Visit http://localhost:5001/ to verify that the is successfully up and running
- Once the containers are up and running, access the PostgreSQL container by executing the following in your terminal:
docker exec -it cr-database bash
- Within the container, login to the PostgreSQL database using the following command:
psql -U postgres
- You are now logged into the PostgreSQL database. Now you can see the tables populated in the database, execute the following command:
\dt
This command will display a list of all tables in the database. You should see the companies table.
-
Do not change the any of the docker files or docker compose files
-
You can update the container locally to view any changes you made in the application files using the following command:
docker-compose up --build -d
- Once you're changes are ready, commit and push them to the repository.
-
Note that
psql
commands will only affect the instance of the database that you are connected to locally. psql can be used to interact with the PostgreSQL database for testing purposes and will not be recorded into version control. -
To contribute, place SQL queries in existing SQL files or create a new SQL file in the
data/
folder. -
You can verify the changes made through your added SQL code by restarting the container.
-
Once you're changes are ready, commit and push them to this repository.