# Java Spring Boot Skill Sets
Bแป skill tแปng hแปฃp cho AI Coding Assistants, giรบp tแบกo ra code Java Spring Boot chแบฅt lฦฐแปฃng cao.
## Tแปng quan
| Skill Set | Mรด tแบฃ | Phรน hแปฃp vแปi |
|-----------|-------|-------------|
| [java-spring-skills](java-spring-skills/) | Monolithic application | Team nhแป, MVP, CRUD apps |
| [java-spring-microservices](java-spring-microservices/) | Microservices architecture | Team lแปn, scaling ฤแปc lแบญp |
## Chแปn bแป skill nร o?
### Bแบฃng so sรกnh nhanh
| Tiรชu chรญ | java-spring-skills | java-spring-microservices |
|----------|:------------------:|:-------------------------:|
| **Team size** | 1-5 developers | > 5 developers |
| **Infrastructure** | VM / Simple hosting | Kubernetes / Docker Swarm |
| **DevOps maturity** | Basic CI/CD | Advanced (K8s, Service Mesh) |
| **Database** | Single DB | DB per service |
| **Message Queue** | Optional | Required (Kafka) |
| **Monitoring** | Basic (Actuator) | Distributed tracing |
| **Deploy complexity** | 1 artifact | Multiple services |
| **Development speed** | Nhanh hฦกn ban ฤแบงu | Chแบญm hฦกn ban ฤแบงu |
| **Scaling** | Vertical (scale cแบฃ app) | Horizontal (scale tแปซng service) |
| **Cost** | Thแบฅp | Cao hฦกn |
### Decision Flowchart
```
โโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ฤรกnh giรก dแปฑ รกn cแปงa bแบกn โ
โโโโโโโโโโโโโฌโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ TEAM SIZE โ โ INFRASTRUCTURE โ โ REQUIREMENTS โ
โโโโโโโโโโโโโโโโโค โโโโโโโโโโโโโโโโโโโค โโโโโโโโโโโโโโโโโโโค
โ > 5 devs? โ โ Cรณ K8s/Docker โ โ Scale ฤแปc lแบญp? โ
โ Multi-team? โ โ Swarm? โ โ Fault isolation?โ
โ ฤแปc lแบญp deployโ โ Cรณ Kafka? โ โ Multi-domain? โ
โ tแปซng team? โ โ DevOps mature? โ โ High traffic? โ
โโโโโโโโโฌโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ
โ โฅ 2 cรขu trแบฃ lแปi โ โ < 2 cรขu trแบฃ lแปi โ
โ lร YES โ โ lร YES โ
โโโโโโโโโโโโฌโโโโโโโโโโโ โโโโโโโโโโโโฌโโโโโโโโโโโ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ
โ java-spring- โ โ java-spring-skills โ
โ microservices โ โ (Monolithic) โ
โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ
```
### Dรนng java-spring-skills khi:
**Team & Organization:**
- Team 1-5 developers
- Single team ownership
- Startup giai ฤoแบกn ฤแบงu, MVP
**Infrastructure:**
- Deploy trรชn VM hoแบทc simple hosting
- Chฦฐa cรณ Kubernetes/Docker orchestration
- Chฦฐa cรณ message queue (Kafka/RabbitMQ)
- DevOps team nhแป hoแบทc chฦฐa cรณ
**Requirements:**
- CRUD application
- Traffic vแปซa phแบฃi
- Khรดng cแบงn scale tแปซng module riรชng
- Muแปn time-to-market nhanh
### Dรนng java-spring-microservices khi:
**Team & Organization:**
- Team > 5 developers
- Multiple teams, mแปi team own 1-2 services
- Cแบงn deploy ฤแปc lแบญp giแปฏa cรกc team
**Infrastructure:**
- ฤรฃ cรณ Kubernetes hoแบทc Docker Swarm
- ฤรฃ cรณ Kafka/message queue
- Cรณ DevOps team vแปi experience vแป container orchestration
- Cรณ budget cho infrastructure phแปฉc tแบกp hฦกn
**Requirements:**
- High traffic, cแบงn scale horizontal
- Fault isolation (1 service fail khรดng แบฃnh hฦฐแปng cแบฃ hแป thแปng)
- Multiple domains vแปi business logic phแปฉc tแบกp
- Polyglot persistence (mแปi service cรณ thแป dรนng DB khรกc nhau)
---
## java-spring-skills (Monolithic)
```
java-spring-skills/
โโโ src/main/java/com/company/app/
โ โโโ domain/ # Entities, Repositories
โ โโโ application/ # Services, DTOs
โ โโโ infrastructure/ # JPA, External APIs
โ โโโ interfaces/ # Controllers
โโโ src/test/ # Unit + Integration tests
โโโ pom.xml # Maven build
```
### Quick Start
```powershell
cd java-spring-skills
# Build
mvn clean compile
# Test (18 tests)
mvn test
# Run
mvn spring-boot:run
```
### Tรญnh nฤng
- DDD package structure
- TDD vแปi Mockito
- Maven profiles (dev, prod, docker)
- Optional Docker support
- Spring Data JPA + Flyway
- Bean Validation
- Global Exception Handling
---
## java-spring-microservices
```
java-spring-microservices/
โโโ services/ # Microservices
โ โโโ user-service/
โ โโโ order-service/
โ โโโ gateway-service/
โโโ shared/ # Shared Libraries
โ โโโ common-lib/ # DTOs, Exceptions
โ โโโ event-lib/ # Domain Events
โ โโโ api-contracts/ # OpenAPI specs
โโโ infrastructure/
โ โโโ docker/ # Docker Compose
โ โโโ kubernetes/ # K8s manifests
โโโ tools/generators/ # Service generator
โโโ openspec/ # Specifications
```
### Quick Start
```powershell
cd java-spring-microservices
# 1. Build shared libraries
mvn install -pl shared/common-lib,shared/event-lib -DskipTests
# 2. Start infrastructure
cd infrastructure\docker
docker-compose up -d
# 3. Create new service
cd ..\..
.\tools\generators\new-service.ps1 -Name "product" -Type "core"
# 4. Run service
cd services\product-service
mvn spring-boot:run
```
### Service Types
| Type | Mรด tแบฃ | Command |
|------|-------|---------|
| Core | Business logic + DB | `new-service.ps1 -Name "x" -Type "core"` |
| Event | Kafka consumer | `new-service.ps1 -Name "x" -Type "event"` |
| Gateway | API Gateway | Copy tแปซ templates |
| BFF | Backend for Frontend | `new-service.ps1 -Name "x" -Type "bff"` |
### Architecture
```
โโโโโโโโโโโโโโโ
โ Gateway โ :8080
โโโโโโโโฌโโโโโโโ
โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ
โ User โ โ Order โ โ Payment โ
โ Service โ โ Service โ โ Service โ
โโโโโโโฌโโโโโโโ โโโโโโโฌโโโโโโโ โโโโโโโฌโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโ
โ
โโโโโโโผโโโโโโ
โ Kafka โ
โโโโโโโโโโโโโ
```
---
## AI IDE Support
Cแบฃ 2 bแป skill ฤแปu hแป trแปฃ cรกc AI IDE:
| IDE | File |
|-----|------|
| Claude Code | `CLAUDE.md` |
| Cursor | `.cursorrules` |
| Windsurf | `.windsurfrules` |
| GitHub Copilot | `.github/copilot-instructions.md` |
| Continue.dev | `.continuerc.json` |
### OpenSpec (Spec-First Development)
Cแบฃ 2 bแป skill ฤแปu hแป trแปฃ [OpenSpec](https://github.com/Fission-AI/OpenSpec) - **viแบฟt spec trฦฐแปc, code sau**:
```
โโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโ โโโโโโโโ โโโโโโโโโโโ
โ Draft โโโโโถโReview/Align โโโโโถโ Implement โโโโโถโ Ship โโโโโถโ Archive โ
โproposal โ โ with AI โ โ tasks โ โ โ โ specs โ
โโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโ โโโโโโโโ โโโโโโโโโโโ
```
**Cแบฅu trรบc chung:**
```
openspec/
โโโ specs/ # Source of truth (current state)
โโโ changes/ # Proposed changes (spec-first)
โโโ {feature}/
โโโ proposal.md # WHY - Rationale
โโโ tasks.md # HOW - Checklist
โโโ specs/ # WHAT - Delta (ADDED/MODIFIED/REMOVED)
```
**Vรญ dแปฅ cรณ sแบตn:**
- Monolithic: `java-spring-skills/openspec/changes/example-user-registration/`
- Microservices: `java-spring-microservices/openspec/changes/example-add-inventory-service/`
---
## Technology Stack
| Layer | Technology |
|-------|------------|
| Language | Java 21 |
| Framework | Spring Boot 3.2, Spring Cloud 2023 |
| Database | PostgreSQL 16 |
| Messaging | Apache Kafka (microservices) |
| Caching | Redis |
| Build | Maven 3.9+ |
| Testing | JUnit 5, Mockito |
| Container | Docker |
| Orchestration | Kubernetes |
---
## Yรชu cแบงu hแป thแปng
- Java 21+ ([Download](https://adoptium.net/))
- Maven 3.9+ ([Download](https://maven.apache.org/download.cgi))
- Docker Desktop ([Download](https://www.docker.com/products/docker-desktop/)) - Optional cho monolithic, Required cho microservices
---
## Documentation
### java-spring-skills
- [SKILL.md](java-spring-skills/SKILL.md) - Skill overview
- [QUICKSTART.md](java-spring-skills/QUICKSTART.md) - Getting started
### java-spring-microservices
- [SKILL.md](java-spring-microservices/SKILL.md) - Skill overview
- [QUICKSTART.md](java-spring-microservices/QUICKSTART.md) - Getting started
- [Architecture Overview](java-spring-microservices/docs/architecture/overview.md)
- [Event Flows](java-spring-microservices/docs/architecture/event-flows.md)
- [OpenSpec](java-spring-microservices/openspec/README.md)
---
## License
MIT License