3.5 KiB
How to run the application
To run the application, follow these steps:
-
Build the Project:
- Ensure you have Java 24, Gradle, and Node.js installed.
- Run the following command to build the project:
./gradlew build
- Prepare Frontend Resources:
- Build the Angular frontend by navigating to the
jambotron-uidirectory and running
cd jambotron-ui- next:
npm install- next:
npm run build - Build the Angular frontend by navigating to the
- This will generate the frontend files in the
jambotron-ui/dist/jambotron-ui/browserdirectory.
-
Copy Frontend Resources:
- Use the Gradle task to copy the frontend resources to the
jumbotron/src/main/resources/publicdirectory:cd ..- next:
./gradlew copyResources
then
- Use the Gradle task to copy the frontend resources to the
-
Create postgres server and database:
-
Create a PostgreSQL database
- named
jambotronDBwith the - user
adminand - password
postgrespw.
- named
-
You can use a PostgreSQL client or run the following command in your terminal:
CREATE DATABASE jambotronDB; CREATE USER admin WITH PASSWORD 'postgrespw'; GRANT ALL PRIVILEGES ON DATABASE jambotronDB TO admin; -
If you are using Docker, you can run PostgreSQL using the following command:
docker run --name postgresDB -p 5432:5432 -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=postgrespw -e POSTGRES_DB=jambotronDB -d postgres -
if you are wont to use pgadmin
docker run --name pgadmin -e "PGADMIN_DEFAULT_EMAIL=name@example.com" -e "PGADMIN_DEFAULT_PASSWORD=admin" -p 5050:80 -d dpage/pgadmin4then
-
create a network for the containers to communicate:
docker network create --driver bridge pgnetwork- Show list of networks:
docker network ls- Connect pgadmin to the network:
docker network connect pgnetwork pgadmin- Connect postgresDB to the network (postgresDB must by running):
docker network connect pgnetwork postgresDB- Inspect the network to ensure both containers are connected:
docker network inspect pgnetwork
-
-
Run the Application:
- Start the Spring Boot application:
./gradlew bootRun
- Start the Spring Boot application:
-
Access the Application:
- Open your browser and navigate to
http://localhost:8080.
- Open your browser and navigate to
Make sure all dependencies and configurations are correctly set up before running these steps.
How to run the application in Docker
To run the application in Docker, follow these steps:
- build jar file
./gradlew bootJar
- Run docker compose to start the application and PostgreSQL:
docker-compose -f src/Docker/docker-compose.yml up -d
Reference Documentation
For further reference, please consider the following sections:
Additional Links
These additional references should also help you:
For docker-compose db connect with pgAdmin used host.docker.internal