App for tracking your weight and calorie intake.
Google Style is used. Config can be found in intellij-java-google-style.xml located in the root directory.
- Java 21
- Maven
- Docker
- To build and run containers (PostgreSQL & pgAdmin4):
docker-compose up -d
- Go to pgAdmin on http://localhost:5050, login with:
- email: user@example.com
- password: password
- Right-click Servers -> Register -> Server
- In General type in any name. In Connection:
- Set Host name/adress to postgres
- Set Port to 5432
- Set Username to user
- Set Password to password
- Click Save
- To test connection, choose fittracker from left tab. From top bar choose: Tools -> Query Tool
- Query tab should appear. Write a query:
SELECT 42 - After running query with "play" sign, number 42 should appear in first row in first column
- Build the project:
./mvnw clean install -DskipTests - Run FitTrackerApplication.java in your IDE or use the command:
./mvnw spring-boot:run - Navigate to http://localhost:8080/health, you should see:
{ "status": "UP" }
FitTracker is containerized, use the command to build a docker image:
docker build -t fittracker .
In order to run the app in a container you can use docker compose:
docker-compose up -d
or run the container with the command:
docker run --network=fittracker -e DB_HOST=postgres -p 8080:8080 fittracker