A Spring Boot application built with Kotlin and Gradle, providing a robust backend infrastructure.
- JDK 21 or later
- Gradle 8.x or later (or use the included Gradle wrapper)
- Docker and Docker Compose (for running the PostgreSQL database)
- Git
git clone <repository-url>
cd Hatchgrid./gradlew build./gradlew bootRun./gradlew build
java -jar build/libs/Hatchgrid-0.0.1-SNAPSHOT.jarThe application uses PostgreSQL as its database. The connection is configured in application.yml.
The project includes a compose.yaml file that sets up the required infrastructure services:
- PostgreSQL: Database server on port 5432
- Keycloak: Authentication server on port 9080
- GreenMail: Email testing server on port 3025 (SMTP) and 8080 (Web UI)
# Start all infrastructure services
docker compose up -d
# Stop all services
docker compose down
# Start only specific services
docker compose up -d postgresql greenmailAlternatively, Spring Boot's Docker Compose support will automatically start the required containers when you run the application.
This project uses Liquibase for database migrations. The changelog file is located at:
src/main/resources/db/changelog/db.changelog-master.yaml
This project uses Lefthook to manage Git hooks. Lefthook is a fast and powerful Git hooks manager that allows for parallel execution of commands and is configurable via a simple YAML file.
To install Lefthook and enable the Git hooks, run the following command from the root of the repository:
pnpm installThe prepare script in package.json will automatically run lefthook install.
The following tasks are run automatically on git commit:
- Biome: Runs the lint script defined in package.json using Biome. If linting issues are found, the commit will be blocked until they are fixed.
- Changed Files Summary: Shows a summary of changed files.
- Git Update: Updates the Git index to ensure all changes are included.
The following tasks are run automatically on git push (now running in parallel for improved performance):
- Link Check: Checks for broken links in Markdown files using Lychee.
- PNPM Check: Runs the check script defined in package.json.
- Kotlin Static Analysis: Runs Detekt for static code analysis.
- Secret Check: Checks for secrets in the codebase.
- Tests: Runs both frontend and backend tests.
- Builds: Builds both frontend and backend projects (skipping tests as they're run separately).
- Make changes to the code
- Run tests:
./gradlew testandpnpm test - Build the application:
./gradlew buildandpnpm build - Run the application:
./gradlew bootRunandpnpm dev
./gradlew testThe project uses Testcontainers for integration tests, which automatically spin up Docker containers for testing.
./gradlew integrationTestsrc/main/kotlin- Kotlin source filessrc/main/resources- Configuration files and resourcessrc/test/kotlin- Test source files.github/actions- Custom GitHub Actions for CI/CD.github/actions/docker- Specialized Docker composition actions.github/actions/setup- Setup actions for Java and Node.js
.github/workflows- GitHub Actions workflows for CI/CD
- Spring Boot 3.4.5
- Kotlin 1.9.25
- Reactive programming with Spring WebFlux
- OAuth2 Authorization Server with Keycloak integration
- Spring Security
- Spring Data R2DBC for reactive database access
- Email testing with GreenMail
- Internationalization (i18n) support with message bundles
- Liquibase for database migrations
- Spring Boot Admin for application monitoring
- Docker Compose support
- Testcontainers for integration testing
API documentation is generated using Spring REST Docs and is available at:
build/generated-snippetsThe application includes Spring Boot Actuator endpoints for monitoring:
- Health check:
/actuator/health - Metrics:
/actuator/metrics - Prometheus metrics:
/actuator/prometheus
The project uses GitHub Actions for continuous integration and deployment:
The CI/CD pipeline uses specialized Docker composition actions for building and pushing Docker images:
- Backend Docker Action: Builds Spring Boot applications using Gradle's
bootBuildImage - Frontend Web App Action: Builds Vue.js applications with multi-stage builds
- Frontend Landing Page Action: Builds Astro static sites with optimized configurations
- Security Scanning Action: Scans Docker images for vulnerabilities using Trivy
For detailed documentation on these actions, see:
deploy.yml: Builds and deploys all application componentsbackend-ci.yml: Runs tests and static analysis for backend codefrontend-ci.yml: Runs tests and static analysis for frontend code