-
Notifications
You must be signed in to change notification settings - Fork 0
Building the application
This page presents two ways to build the application.
The preferred way to run the application is to use Docker Compose. This option lets you quickly and seamlessly start the application using a single command.
Requirements: Git, Docker, and Docker Compose must be installed on your machine.
Carry out the following steps to run the application:
- Open the folder of choice and run:
git clone https://github.com/amosproj/amos2022ws04-specitem-database.git
. - Change the directory to the project's root:
cd amos2022ws04-specitem-database
. - Run the following command:
docker-compose up
. - You can now visit
localhost:3000
and start interacting with the app.
If you're encountering any problems running the app using docker, please check on the following points.
- Make sure that these properties are set as follows:
spring.datasource.url=jdbc:postgresql://db:5432/specitems
spring.datasource.username=postgres
spring.datasource.password=password123
- Run
docker ps
and make sure that no other containers are running that have the same name and/or use the ports:5432
,8080
,3000
.
Requirements: Git, Maven, npm, and postgres should be installed on your machine.
If you can't run the docker or option 1 fails to run the app (for whatever reason), you can set up each component of the app manually.
Please note that you must adjust the configuration file for this option to function correctly. To edit the properties, you can run: vim amos2022ws04-specitem-database/code/src/main/resources/application.properties
. Adjust the file as follows:
spring.datasource.url=jdbc:postgresql://localhost:5432/specitems
spring.datasource.username=dbuser
spring.datasource.password=user123
To run the app, follow these steps:
- Open the psql console (
psql postgres
). Create thespecitems
database and the user for interacting with it:
CREATE DATABASE specitems;
CREATE ROLE dbuser WITH LOGIN PASSWORD 'user123';
- Create the folder for the project, open it and run:
git clone https://github.com/amosproj/amos2022ws04-specitem-database.git
. - To run the backend execute these commands (test is optional):
cd amos2022ws04-specitem-database/code
mvn test
mvn package
java -jar target/specitem-database-0.0.1-SNAPSHOT.jar
You should see a message that the backend listens on :8080
.
- To run the frontend, go back to the root of the project, then change to the frontend folder:
cd frontend/specitem
and run:npm install && npm start
- You can now visit
localhost:3000
and start interacting with the app.