Verificando autenticación…

Skip to main content

Golden Path: Backend Spring Boot

Base template for Spring Boot (Java 21) services with hexagonal architecture, designed for high-performance enterprise microservices deployed on Cloud Run.

Repository

GitLab: templates/template-spring-bl

Detailed technical reference for the template: Spring BL Template.

Stack

ComponentValue
LanguageJava 21 (JDK 21)
FrameworkSpring Boot
BuildGradle 8.11.1 (wrapper included)
ArchitectureHexagonal (Domain / Infrastructure / Application)
RuntimeCloud Run
ObservabilityOpenTelemetry (Java Agent, OTLP)

Modular features (tags)

The template enables capabilities through tags when creating the project, so you only include what you need:

TagCapability
BaseHello World REST (/api/v1/greetings/hello). Always active
PubsubAsync messaging with Google Cloud Pub/Sub
DatabasePostgreSQL with Spring Data JPA (HikariCP)
LiquibaseDatabase migrations (requires Database)

Additionally, the template offers ready-to-use integration with Google Cloud Storage, Redis, Apache Kafka, and external REST services (OpenFeign), plus corporate security libraries and authorized base images.

Security

Security is configured in Google Cloud Endpoints (deploy/endpoints/openapi.yaml.erb) with two schemes:

  • API Key (x-api-key header) — identifies the calling app.
  • Azure ID Token (OAuth2, Authorization: Bearer header) — Azure AD authentication.

Local development requirements

  • JDK 21
  • Gradle 8.11.1 (or the ./gradlew wrapper)
  • Access to LATAM Artifactory (corporate dependencies, via gradle.properties)
  • Docker (optional, for local PostgreSQL)
# Create from Cursor with the lifecycle skill
/create-app --golden-path=java-spring-boot --product=my-product

The application becomes available at http://localhost:8080/template-spring.