- Java 21
- Docker and Docker Compose
- Gradle wrapper included in the project
- IDE: IntelliJ IDEA recommended
Clone the repository and navigate to the backend directory:
cd sprintstart-backendThe backend uses two different local environment files:
.env -> used by Docker Compose
run.local.env -> used when running the backend locally
The real environment files must not be committed!!!
Create a local .env file based on .env.example:
cp .env.example .envExample .env:
POSTGRES_DB=sprintstart
POSTGRES_USER=sprintstart
POSTGRES_PASSWORD=change-meDocker Compose reads .env automatically when running commands.
Create a local run.local.env file based on run.local.env.example:
cp run.local.env.example run.local.envThis file is used when running the backend locally
The application uses these variables in application.yml:
Use this option during normal development when running the Spring Boot backend separately from the database.
Start only the database:
docker compose up -d databaseStop the database
docker compose down -v databaseThe local backend should use these values from run.local.env:
Run the backend locally:
./gradlew bootRunUse this option to run the complete backend setup inside Docker Compose.
Start database and backend:
docker compose up -dRemove -d if you want to have the outputs of docker in the terminal you are using
To stop the database and backend:
docker compose down -vWarning: docker compose down -v deletes the local PostgreSQL data.
Remove -v if you don't want the database volume to persist
Show running containers:
docker psShow logs:
docker compose logs -fShow backend logs only:
docker compose logs -f backendShow database logs only:
docker compose logs -f databaseRemove the -f to only get the outputs once and immediately close the terminal to the compose again.
Build the backend:
./gradlew buildBuild the bootable Spring Boot JAR:
./gradlew bootJarRun the JAR:
java -jar build/libs/*.jarBuild the Docker image manually:
docker build -t sprintstart-backend .