docs: restructure server and web documentation into ADR files and a

routing table
This commit is contained in:
2026-07-17 22:07:55 +08:00
parent f8494a44ca
commit 519aa35f1f
23 changed files with 710 additions and 654 deletions
@@ -0,0 +1,23 @@
# ADR-0005: Keep Service Contracts Protocol-Neutral
Status: Accepted
Date: 2026-07-05
## Context
MyGO exposes REST today and is designed to support additional protocols. Business services need contracts that transport adapters can reuse.
## Decision
- Services return domain results and `model.AppError` values.
- HTTP handlers own REST response DTOs.
- `internal/api` maps domain error kinds to REST responses.
- HTTP packages obtain application behavior through service contracts and authenticated principals.
- Architecture tests enforce the package dependency boundaries.
## Consequences
- Additional protocol adapters can reuse the existing services.
- Each protocol adapter defines its own response mapping.
- Service tests exercise business behavior without constructing HTTP requests.
- Error responses can include `error.log_id` for failures recorded by the server.