springboot-patterns
Master Spring Boot architecture through practical patterns for REST API design, service layering, data access, caching, and async operations. Covers controller-service-repository organization, validation, exception handling, pagination, and observability for production-grade Java applications.
Spring Boot Patterns teaches architecture and design patterns for building scalable REST APIs in Java.
AI-generated summary based on this skill's SKILL.md
Install
xu-xiang/everything-claude-code-zh/springboot-patterns · repository language: JavaScript
git clone https://github.com/xu-xiang/everything-claude-code-zh
cp -r everything-claude-code-zh/skills/springboot-patterns ~/.claude/skills/springboot-patternsnpx skillfed install xu-xiang/everything-claude-code-zh/springboot-patternsFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What is springboot-patterns and how does it teach REST API design?
springboot-patterns is an MIT-licensed skill that teaches Spring Boot architecture through practical patterns for building scalable REST APIs. It covers REST API design patterns, service layering with controllers, services, and repositories, plus production-grade error handling and observability techniques for Java applications.
How does springboot-patterns structure layered architecture?
springboot-patterns teaches implementing layered service architecture by organizing code into controllers, services, and repositories. This separation of concerns approach enables maintainability and testability, with each layer handling specific responsibilities—controllers managing HTTP requests, services containing business logic, and repositories managing data access.
What caching, async processing, and transaction management does springboot-patterns cover?
springboot-patterns covers configuring caching with @Cacheable annotations, async processing for non-blocking operations, and transaction management for data consistency. These techniques improve performance and responsiveness in production applications by reducing latency and enabling concurrent request handling.
How does springboot-patterns address spring boot global exception handling?
springboot-patterns teaches production-grade error handling through global exception handling strategies, including RFC 7807 problem statement formats. It demonstrates setting up centralized exception handlers, proper HTTP status code mapping, and structured error responses for consistent API error communication.
What observability and security features does springboot-patterns include?
springboot-patterns covers observability through metrics and tracing for monitoring production applications, plus security best practices including rate limiting with Bucket4j, request filtering middleware, and validation. These features ensure applications are secure, observable, and can handle production workloads reliably.
Does springboot-patterns cover pagination, sorting, and retry logic?
Yes, springboot-patterns includes pagination and sorting patterns for efficient data retrieval, retry logic for handling external service calls reliably, and scheduled jobs for background tasks. It also covers logging best practices and constructor injection for dependency management in Spring Boot applications.
SKILL.md
rendered from the published skill — quoted content, verbatim
Spring Boot 开发模式
适用于可扩展、生产级服务的 Spring Boot 架构和 API 模式。
何时启用
- 使用 Spring MVC 或 WebFlux 构建 REST API
- 组织 控制器 (Controller) → 服务 (Service) → 存储库 (Repository) 层
- 配置 Spring Data JPA、缓存或异步处理
- 添加验证、异常处理或分页
- 为开发/测试/生产环境设置配置文件(Profiles)
- 使用 Spring 事件(Spring Events)或 Kafka 实现事件驱动模式
REST API 结构
```java @RestController @RequestMapping("/api/markets") @Validated class MarketController { private final MarketService marketService;
MarketController(MarketService marketService) { this.marketService = marketService; }
@GetMapping ResponseEntity<Page<MarketResponse>> list( @RequestParam(defaultValue = "0") int page, @RequestParam(defaultValue = "20") int size) { Page<Market> markets = marketService.list(PageRequest.of(page, size)); return ResponseEntity.ok(markets.map(MarketResponse::from)); }
@PostMapping ResponseEntity<MarketResponse> create(@Valid @RequestBody CreateMarketRequest request) { Market market = marketService.create(request); return
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 1 file
skills/springboot-patterns/SKILL.md