a-pavithraa/springboot-skills-marketplace / plugins/springboot-architecture/skills/creating-springboot-projects
creating-springboot-projects
VerifiedUse when starting a new Spring Boot project or service: scaffolding or bootstrapping a backend, REST API, microservice or modular monolith; choosing how to structure it (layered, package-by-module, modular monolith, tomato, DDD-hexagonal); selecting Spring Boot 4 features; generating the base project with progen or Spring Initializr; or applying the bundled templates and references in this skill. Not for migrating existing projects or for isolated JPA/repository work without broader project-creation context.
assets/http-service-client.java
View on GitHubpackage {{PACKAGE}}.{{MODULE}}.client;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.service.annotation.GetExchange;
import org.springframework.web.service.annotation.HttpExchange;
import org.springframework.web.service.annotation.PostExchange;
import java.util.List;
import java.util.Optional;
/**
* HTTP Service Client template (Spring Boot 4 simplified approach).
*
* Spring Boot 4 dramatically simplifies HTTP client creation:
* - Define interface with @HttpExchange
* - Use @GetExchange, @PostExchange, @PutExchange, @DeleteExchange
* - Spring Boot auto-configures RestClient and creates proxy
* - No manual HttpServiceProxyFactory setup needed!
*
* Benefits:
* - Less boilerplate than RestTemplate or WebClient
* - Type-safe API definitions
* - Supports API versioning
* - Built-in JSON serialization
*/
@HttpExchange
public interface {{NAME}}Client {
/**
* Simple GET request returning a list.
*/
@GetExchange(url = "/api/{{MODULE}}")
List<{{NAME}}DTO> findAll();
/**
* GET with path variable.
*/
@GetExchange(url = "/api/{{MODULE}}/{id}")
Optional<{{NAME}}DTO> findById(@PathVariable Long id);
/**
* GET with query parameters.
*/
@GetExchange(url = "/api/{{MODULE}}/search")
List<{{NAME}}DTO> search(@RequestParam("q") String query);
/**
* GET with API versioning (v1.0).
*/
@GetExchange(url = "/api/{{MODULE}}/search", version = "1.0")
List<{{NAME}}DTO> searchV1(@RequestParam("q") String query);
/**
* GET with API versioning (v2.0).
*/
@GetExchange(url = "/api/{{MODULE}}/search", version = "2.0")
List<{{NAME}}DTO> searchV2(@RequestParam("q") String query);
/**
* POST request.
*/
@PostExchange(url = "/api/{{MODULE}}")
{{NAME}}DTO create(Create{{NAME}}Request request);
}
// ============================================================
// CLIENT CONFIGURATION - Spring Boot 4 Simplified Approach
// ============================================================
// package {{PACKAGE}}.config;
//
// import org.springframework.context.annotation.Configuration;
// import org.springframework.web.service.registry.ImportHttpServices;
// import {{PACKAGE}}.{{MODULE}}.client.{{NAME}}Client;
//
// /**
// * Spring Boot 4 HTTP Service Client configuration.
// *
// * Before Spring Boot 4, you had to manually create beans with
// * HttpServiceProxyFactory and RestClientAdapter. Now it's just
// * one annotation!
// */
// @Configuration
// @ImportHttpServices(group = "{{name}}", types = {{NAME}}Client.class)
// public class ClientConfig {
// // That's it! Spring Boot 4 handles the rest.
// // Group organizes services sharing the same HTTP client config.
// // RestClient is the default client type (use clientType for WebClient).
// }
// ============================================================
// CONFIGURING BASE URL (application.yml)
// ============================================================
//
// Spring Boot 4 property structure:
// spring.http.clients.* - global defaults for every HTTP client
// spring.http.serviceclient.<group>.* - per-@ImportHttpServices-group config
// Group name = the `group` attribute on @ImportHttpServices (defaults to "default").
//
// spring:
// http:
// clients: # global defaults
// connect-timeout: 5s
// read-timeout: 10s
// serviceclient:
// {{name}}: # group name from @ImportHttpServices(group = "{{name}}")
// base-url: http://localhost:8080
// connect-timeout: 2s # overrides global for this group
// read-timeout: 10s
// default-header: # HttpClientProperties.defaultHeader (singular)
// X-Client-Version: "1.0"
// ============================================================
// USAGE IN SERVICE
// ============================================================
// package {{PACKAGE}}.{{MODULE}}.service;
//
// import {{PACKAGE}}.{{MODULE}}.client.{{NAME}}Client;
// import org.springframework.stereotype.Service;
// import java.util.List;
//
// @Service
// public class {{NAME}}IntegrationService {
// private final {{NAME}}Client client;
//
// public {{NAME}}IntegrationService({{NAME}}Client client) {
// this.client = client;
// }
//
// public List<{{NAME}}DTO> fetchAll() {
// return client.findAll();
// }
//
// public {{NAME}}DTO fetchById(Long id) {
// return client.findById(id)
// .orElseThrow(() -> new NotFoundException("{{NAME}} not found: " + id));
// }
// }
// ============================================================
// ADVANCED: Custom RestClient Configuration
// ============================================================
// package {{PACKAGE}}.config;
//
// import org.springframework.beans.factory.annotation.Value;
// import org.springframework.context.annotation.Bean;
// import org.springframework.context.annotation.Configuration;
// import org.springframework.web.client.RestClient;
// import org.springframework.web.client.support.RestClientAdapter;
// import org.springframework.web.service.invoker.HttpServiceProxyFactory;
// import {{PACKAGE}}.{{MODULE}}.client.{{NAME}}Client;
//
// /**
// * Use this approach if you need custom RestClient configuration:
// * - Custom headers (authentication)
// * - Interceptors
// * - Error handlers
// * - Custom message converters
// */
// @Configuration
// public class CustomClientConfig {
//
// @Bean
// RestClient {{MODULE}}RestClient(
// RestClient.Builder builder,
// @Value("${services.{{MODULE}}.url}") String baseUrl
// ) {
// return builder
// .baseUrl(baseUrl)
// .defaultHeader("X-Client-Version", "1.0")
// .build();
// }
//
// @Bean
// {{NAME}}Client {{MODULE}}Client(RestClient {{MODULE}}RestClient) {
// var adapter = RestClientAdapter.create({{MODULE}}RestClient);
// var factory = HttpServiceProxyFactory
// .builderFor(adapter)
// .build();
// return factory.createClient({{NAME}}Client.class);
// }
// }
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |