Designs software architecture and selects appropriate patterns for projects...
Copy this checklist and track progress:
Architecture Design Progress:
- [ ] Step 1: Understand requirements and constraints
- [ ] Step 2: Assess project size and team capabilities
- [ ] Step 3: Select architecture pattern
- [ ] Step 4: Define directory structure
- [ ] Step 5: Document trade-offs and decision
- [ ] Step 6: Validate against decision framework
| Size | Recommended Pattern |
|---|---|
| Small (<10K LOC) | Simple MVC/Layered |
| Medium (10K-100K) | Clean Architecture |
| Large (>100K) | Modular Monolith or Microservices |
| Team | Recommended |
|---|---|
| 1-3 devs | Monolith with clear modules |
| 4-10 devs | Modular Monolith |
| 10+ devs | Microservices (if justified) |
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Presentation ā ā UI, API Controllers
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā Application ā ā Use Cases, Services
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā Domain ā ā Business Logic, Entities
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā Infrastructure ā ā Database, External APIs
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Use when: Simple CRUD apps, small teams, quick prototypes
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Frameworks & Drivers ā
ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā
ā ā Interface Adapters ā ā
ā ā āāāāāāāāāāāāāāāāāāāāāāā ā ā
ā ā ā Application ā ā ā
ā ā ā āāāāāāāāāāāāāāā ā ā ā
ā ā ā ā Domain ā ā ā ā
ā ā ā āāāāāāāāāāāāāāā ā ā ā
ā ā āāāāāāāāāāāāāāāāāāāāāāā ā ā
ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Use when: Complex business logic, long-lived projects, testability is key
āāāāāāāāāāāā
ā HTTP API ā
āāāāāā¬āāāāāā
ā Port
āāāāāāāāāā¼āāāāāāāāā
ā ā
ā Application ā
ā Core ā
ā ā
āāāāāāāāāā¬āāāāāāāāā
ā Port
āāāāāā¼āāāāāā
ā Database ā
āāāāāāāāāāāā
Use when: Need to swap external dependencies, multiple entry points
Producer ā Event Bus ā Consumer
ā
āāā Consumer
ā
āāā Consumer
Use when: Loose coupling needed, async processing, scalability
āāāāāāāāāāāāāāā āāāāāāāāāāāāāāā
ā Commands ā ā Queries ā
ā (Write) ā ā (Read) ā
āāāāāāāā¬āāāāāāā āāāāāāāā¬āāāāāāā
ā ā
ā¼ ā¼
Write Model Read Model
ā ā
āāāāāāāāāā¬āāāāāāāāāāāā
ā¼
Event Store
Use when: Different read/write scaling, complex domains, event sourcing
src/
āāā features/
ā āāā users/
ā ā āāā api/
ā ā āāā components/
ā ā āāā hooks/
ā ā āāā services/
ā ā āāā types/
ā āāā orders/
ā āāā api/
ā āāā components/
ā āāā ...
āāā shared/
ā āāā components/
ā āāā hooks/
ā āāā utils/
āāā app/
āāā ...
src/
āāā controllers/
āāā services/
āāā models/
āāā repositories/
āāā utils/
When making architectural decisions, evaluate against these criteria:
Use this template to document architectural decisions:
## Decision: [What we're deciding]
### Context
[Why this decision is needed now]
### Options Considered
1. Option A: [Description]
2. Option B: [Description]
### Trade-offs
| Criteria | Option A | Option B |
| ---------------- | -------- | -------- |
| Complexity | Low | High |
| Scalability | Medium | High |
| Team familiarity | High | Low |
### Decision
We chose [Option] because [reasoning].
### Consequences
- [What this enables]
- [What this constrains]
After selecting an architecture, validate against:
Architecture Validation:
- [ ] Matches project size and complexity
- [ ] Aligns with team skills and experience
- [ ] Supports current requirements
- [ ] Allows for anticipated growth
- [ ] Dependencies flow inward (core has no external deps)
- [ ] Clear boundaries between modules/layers
- [ ] Testing strategy is feasible
- [ ] Trade-offs are documented
If validation fails, reconsider the pattern selection or adjust the implementation approach.