Triatu Architecture
Quick start
- Follow dependency direction: UI -> Application -> Domain <- Infrastructure.
- Keep use cases framework-agnostic (no Next.js or Supabase types in core use cases).
- Validate inputs with Zod before touching infrastructure.
- Update architecture docs on any structural change.
Workflow
- Read
arquitectura_triatu.mdfor the current model. - Identify the layer for new logic (Domain, Application, Infrastructure, UI).
- Add interfaces/ports in Domain when infrastructure is involved.
- Implement adapters in Infrastructure and wire them in Application.
- Keep UI thin: call Application use cases and map view models.
- Add tests first (TDD), then code.
- Update docs:
guia.md,arquitectura_triatu.md,docs/PROJECT_AUDIT.md.
Guardrails
- No direct infrastructure access from Domain.
- Avoid global state unless justified (Zustand only for ephemeral UI).
- Avoid logs with PII; use
lib/loggeranddebugin dev only.
References
arquitectura_triatu.mddocs/CORE.mdguia.mddocs/DEVELOPMENT.mddocs/PROJECT_AUDIT.md