Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 1.94 KB

09-development.md

File metadata and controls

54 lines (40 loc) · 1.94 KB

09 · Development Guide

← Index · ← Security · Next → Backlog


1. Prereqs

Tool Version
JDK 17 (toolchain target);Java 25 planned — see backlog
Maven wrapper ./mvnw included
Docker for full stack

2. Commands

./mvnw clean compile          # build
./mvnw test                   # tests (needs RabbitMQ reachable — see 06-testing.md)
./mvnw spring-boot:run        # run against H2 + local broker
./mvnw package -DskipTests    # jar → target/email-0.0.1-SNAPSHOT.jar
docker compose up --build     # full stack
docker compose up email_ms    # just this service + deps

3. Package conventions

Package Rule
domain/* no framework I/O annotations beyond jakarta.persistence; ports as interfaces
application/usecase/** one class = one action, execute(...)
application/policy/** cross-cutting semantics (status, retry)
infra/** @Configuration beans

4. Code style notes (current reality → target)

Current Target
field @Autowired constructor injection
e.printStackTrace() log.error("...", e) via SLF4J
stray imports (e.g. javax.swing.text.html.Option) removed
Optional-orchestrated flow keep, but persist ERROR audit

5. Adding a feature — checklist

  1. Use case in application/usecase/** with the narrowest port dependency.
  2. Wire in EmailServiceImpl (or new domain service) — keep @Transactional boundary explicit.
  3. Message contract change? update 03 Messaging + producer in ems_user.
  4. Schema change? add Flyway migration (post-backlog) — never rely on ddl-auto.
  5. Tests per 06 Testing pyramid before PR.

6. Useful URLs (local)

http://localhost:8081/swagger-ui/index.html · http://localhost:15672 (RabbitMQ) · http://localhost:5050 (pgAdmin)