Archived design reference — not the current architecture
These docs describe a proposed Simplified Hexagonal Architecture from an internal design exploration that was not adopted. The design principles (entity invariants, contracts, dependency inversion, load → authorize → validate → execute, in-memory-fake testing) remain useful, but the specifics below do not exist in this codebase: the package paths packages/core / packages/infra / packages/shared, the @packages/* import aliases, the main.ts wiring entry point, and the EnableArchitectureTransition feature flag. Do not follow the paths, aliases, or imports here as-is.
Tutorial: Building a Products Feature from Scratch
What You'll Build
This tutorial walks through creating a complete Products feature for an e-commerce system. By the end, you'll have:
- A
Productentity with business rules - A repository contract and implementation
- Authorization policies
- Actions for creating, updating, and discontinuing products
- API endpoints with validation
- Tests using fakes
Prerequisites
Before starting, read:
- 00-quick-reference.md - File paths and signatures
- 01-core-concepts.md - The 3-concept model
Final Result: What We're Building
packages/
├── core/
│ └── src/
│ └── products/
│ ├── Product.ts # Entity
│ ├── ProductRepository.ts # Contract