Skip to content

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.

Namespring-boot-service
Version0.1.0
Categoryapplications
LicenseApache-2.0
Personaengineering
Tagsjava, spring-boot, jvm, api, service, rest
Sourcetemplates/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

ToolVersionWhy
java>=25JDK 25 (latest LTS) for compiling and running the Spring Boot service
mvn>=3.8Maven build tool for dependency resolution and packaging

Variables

Required

ProjectName string
Kebab-case project name, used as repo/directory name Must be lowercase kebab-case starting with a letter.
GroupId string
Maven groupId (reverse-DNS, dot-separated, lowercase) Must be a valid Maven groupId (e.g. com.example.acme).
ArtifactId string
Maven artifactId (kebab-case) Must be lowercase kebab-case starting with a letter.
JavaPackage string
Root Java package (dot form, used in source declarations) Must be a valid Java package (e.g. com.example.app).
PackageDir string
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

Description string — defaults to A Spring Boot HTTP service
Short project description for README and pom.xml
Database string — defaults to postgres
Default database driver. Known values: postgres, mysql, h2. Additional drivers can be added by editing pom.xml and application.yaml.
IncludeDocker bool — defaults to true
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.yaml

Composes with

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.