Spring Boot HTTP Service
Scaffolds a Java Spring Boot 4 HTTP service with Spring Web MVC, Spring Boot Actuator for health and metrics, Spring Data JPA + Flyway migrations, Micrometer + OpenTelemetry instrumentation, structured JSON logging, graceful shutdown, and a repository pattern service layer. Includes a Makefile, GitHub Actions CI, k6 load test scaffolding, Testcontainers integration tests, and optional Docker support. Auth-neutral — stack `module-spring-security` alongside when you need authentication.
| Name | spring-boot-service |
| Version | 0.1.0 |
| Category | applications |
| License | Apache-2.0 |
| Persona | engineering |
| Tags | java, spring-boot, jvm, api, service, rest |
| Source | templates/spring-boot-service |
Render it
Three front doors, one catalog. Pick whichever suits the caller.
# CLI
npx @nanohype/sdk render spring-boot-service --out ./my-app
# SDK
import { LocalSource, renderTemplate } from "@nanohype/sdk";
const result = await renderTemplate(source, "spring-boot-service", variables);
# MCP — from an agent
get_template({ name: "spring-boot-service" })Prerequisites
| Tool | Version | Why |
|---|---|---|
java | >=25 | JDK 25 (latest LTS) for compiling and running the Spring Boot service |
mvn | >=3.8 | Maven build tool for dependency resolution and packaging |
Variables
Required
ProjectNamestring- Kebab-case project name, used as repo/directory name Must be lowercase kebab-case starting with a letter.
GroupIdstring- Maven groupId (reverse-DNS, dot-separated, lowercase) Must be a valid Maven groupId (e.g. com.example.acme).
ArtifactIdstring- Maven artifactId (kebab-case) Must be lowercase kebab-case starting with a letter.
JavaPackagestring- Root Java package (dot form, used in source declarations) Must be a valid Java package (e.g. com.example.app).
PackageDirstring- Root Java package as a directory path (slash form, used for the source tree layout). Must be the slash-form of JavaPackage — e.g. if JavaPackage is 'com.example.app' then PackageDir is 'com/example/app'. Must be lowercase segments separated by slashes (e.g. com/example/app).
Optional
Descriptionstring — defaults toA Spring Boot HTTP service- Short project description for README and pom.xml
Databasestring — defaults topostgres- Default database driver. Known values: postgres, mysql, h2. Additional drivers can be added by editing pom.xml and application.yaml.
IncludeDockerbool — defaults totrue- Include Dockerfile and docker-compose.yml
What it produces
28 files. Placeholder names such as __APP_NAME__ are what the renderer substitutes into.
.env.example
.github/workflows/ci.yml
.gitignore
docker-compose.yml
Dockerfile
load-test/k6/config.json
load-test/k6/script.js
load-test/README.md
Makefile
pom.xml
README.md
src/main/java/__PKG_DIR__/Application.java
src/main/java/__PKG_DIR__/config/ObservabilityConfig.java
src/main/java/__PKG_DIR__/config/OpenApiConfig.java
src/main/java/__PKG_DIR__/domain/ExampleEntity.java
src/main/java/__PKG_DIR__/repository/ExampleRepository.java
src/main/java/__PKG_DIR__/service/ExampleService.java
src/main/java/__PKG_DIR__/web/ExampleController.java
src/main/java/__PKG_DIR__/web/GlobalExceptionHandler.java
src/main/java/__PKG_DIR__/web/HealthController.java
src/main/resources/application-local.yaml
src/main/resources/application.yaml
src/main/resources/db/migration/V1__init.sql
src/main/resources/logback-spring.xml
src/test/java/__PKG_DIR__/ApplicationTests.java
src/test/java/__PKG_DIR__/ExampleIntegrationTest.java
src/test/java/__PKG_DIR__/web/HealthControllerTest.java
src/test/resources/application-test.yamlComposes with
- Pairs with
k8s-deploy - Pairs with
monitoring-stack - Pairs with
module-spring-security - Nests inside
monorepo
Composites that use it
- Identity-Aware Spring Boot Microservice — Spring Boot 4 microservice on JDK 25 with identity enforced at both the service-mesh edge (Istio RequestAuthentication + AuthorizationPolicy) and the application boundary (Spring Security OAuth 2.0 resource server) — defense in depth against the same OIDC issuer.
- Spring Boot Microservice — Java Spring Boot 4 HTTP service on JDK 25 with a Kubernetes deployment and an optional Grafana + Prometheus + Loki observability stack.