spring-boot-full-stack

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Spring Boot Full Stack Skill

Spring Boot 全栈技能

Overview

概述

This skill provides a complete, modular framework for building Java Spring Boot applications with enterprise-grade features.
本技能提供了一个完整的模块化框架,用于构建具备企业级特性的Java Spring Boot应用。

Quick Start

快速开始

bash
undefined
bash
undefined

Minimal setup (PostgreSQL + JWT only)

Minimal setup (PostgreSQL + JWT only)

mvn clean install -Pminimal
mvn clean install -Pminimal

With Redis caching

With Redis caching

mvn clean install -Dmodule.redis.enabled=true
mvn clean install -Dmodule.redis.enabled=true

Full stack (all modules)

Full stack (all modules)

mvn clean install -Pfull-stack
mvn clean install -Pfull-stack

Run application

Run application

mvn spring-boot:run -Dspring-boot.run.profiles=local
undefined
mvn spring-boot:run -Dspring-boot.run.profiles=local
undefined

Module Selection

模块选择

ModuleDefaultEnable Flag
PostgreSQLON
-Dmodule.postgresql.enabled=true
RedisOFF
-Dmodule.redis.enabled=true
KafkaOFF
-Dmodule.kafka.enabled=true
RabbitMQOFF
-Dmodule.rabbitmq.enabled=true
OAuth2OFF
-Dmodule.oauth2.enabled=true
模块默认状态启用参数
PostgreSQL开启
-Dmodule.postgresql.enabled=true
Redis关闭
-Dmodule.redis.enabled=true
Kafka关闭
-Dmodule.kafka.enabled=true
RabbitMQ关闭
-Dmodule.rabbitmq.enabled=true
OAuth2关闭
-Dmodule.oauth2.enabled=true

Development Workflow

开发流程

  1. Spec First: Define specifications in
    openspec/specs/
  2. TDD: Write tests first (RED)
  3. Implement: Write minimal code (GREEN)
  4. Refactor: Improve code quality
  5. Archive: Update specs after implementation
  1. 先定义规格:在
    openspec/specs/
    目录下定义规格
  2. 测试驱动开发(TDD):先编写测试(红阶段)
  3. 实现功能:编写最小化代码(绿阶段)
  4. 重构:提升代码质量
  5. 归档:实现完成后更新规格

Docker Options

Docker选项

bash
undefined
bash
undefined

Without Docker (services installed locally)

Without Docker (services installed locally)

make dev
make dev

With Docker infrastructure

With Docker infrastructure

make dev-docker
make dev-docker

Full Docker deployment

Full Docker deployment

docker compose --profile with-app up -d
undefined
docker compose --profile with-app up -d
undefined

Skills Included

包含的技能

Core (Always enabled)

核心模块(始终启用)

  • spring-project-init
    - Project initialization
  • spring-maven-modular
    - Maven profiles & BOM
  • spring-error-handling
    - Global exception handling
  • spring-validation
    - Request validation
  • spring-logging
    - Structured logging
  • spring-testing
    - Unit + Integration testing
  • spring-tdd-mockito
    - TDD with Mockito
  • spring-openspec
    - Spec-First Development
  • spring-project-init
    - 项目初始化
  • spring-maven-modular
    - Maven配置文件与BOM
  • spring-error-handling
    - 全局异常处理
  • spring-validation
    - 请求校验
  • spring-logging
    - 结构化日志
  • spring-testing
    - 单元测试 + 集成测试
  • spring-tdd-mockito
    - 基于Mockito的TDD
  • spring-openspec
    - 先定义规格再开发

Optional

可选模块

  • spring-redis
    - Redis caching
  • spring-kafka
    - Kafka messaging
  • spring-rabbitmq
    - RabbitMQ messaging
  • spring-oauth2
    - OAuth2/OIDC
  • spring-rbac
    - Role-based access control
  • spring-docker
    - Docker containerization
  • spring-api-docs
    - OpenAPI/Swagger
  • spring-monitoring
    - Actuator + Prometheus
  • spring-redis
    - Redis缓存
  • spring-kafka
    - Kafka消息队列
  • spring-rabbitmq
    - RabbitMQ消息队列
  • spring-oauth2
    - OAuth2/OIDC
  • spring-rbac
    - 基于角色的访问控制(RBAC)
  • spring-docker
    - Docker容器化
  • spring-api-docs
    - OpenAPI/Swagger
  • spring-monitoring
    - Actuator + Prometheus

File Structure

文件结构

src/
├── main/
│   ├── java/
│   │   └── com/company/app/
│   │       ├── config/           # Configuration classes
│   │       ├── controller/       # REST controllers
│   │       ├── service/          # Business logic
│   │       ├── repository/       # Data access
│   │       ├── domain/           # Entities
│   │       ├── dto/              # Data transfer objects
│   │       ├── exception/        # Custom exceptions
│   │       └── security/         # Security configuration
│   └── resources/
│       ├── application.yml
│       ├── application-local.yml
│       ├── application-dev.yml
│       ├── application-prod.yml
│       └── db/migration/         # Flyway migrations
├── test/
│   └── java/
│       └── com/company/app/
│           ├── unit/             # Unit tests
│           └── integration/      # Integration tests
└── openspec/
    ├── AGENTS.md
    ├── specs/                    # Feature specifications
    └── changes/                  # Proposed changes
src/
├── main/
│   ├── java/
│   │   └── com/company/app/
│   │       ├── config/           # Configuration classes
│   │       ├── controller/       # REST controllers
│   │       ├── service/          # Business logic
│   │       ├── repository/       # Data access
│   │       ├── domain/           # Entities
│   │       ├── dto/              # Data transfer objects
│   │       ├── exception/        # Custom exceptions
│   │       └── security/         # Security configuration
│   └── resources/
│       ├── application.yml
│       ├── application-local.yml
│       ├── application-dev.yml
│       ├── application-prod.yml
│       └── db/migration/         # Flyway migrations
├── test/
│   └── java/
│       └── com/company/app/
│           ├── unit/             # Unit tests
│           └── integration/      # Integration tests
└── openspec/
    ├── AGENTS.md
    ├── specs/                    # Feature specifications
    └── changes/                  # Proposed changes

References

参考资料