TorbatYar/docs/development/project-principles.md
Mortezakoohjani 5c6a2e78cf feat(platform): seed service registry, deploy all modules, and fix homepage catalog.
Register all active platform services and base features in core DB so admin can manage them, add delivery/hospitality/sports-center backend phases, update apps catalog and production deploy tooling.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 12:39:51 +03:30

3.7 KiB
Raw Blame History

Project Principles

These principles are mandatory for every implementation phase.

  1. Every feature must be tenant-aware. Business data always carries and filters by tenant_id.
  2. Every business action must be auditable. Persist audit metadata or equivalent domain events.
  3. Business logic only inside Services. Controllers/routers stay thin.
  4. Repositories contain no business logic. Persistence and queries only.
  5. Views / API handlers remain thin. Validate, authorize, delegate, map responses.
  6. Every phase must include tests. No phase complete without automated coverage for new behavior.
  7. Every phase must update documentation. Code and docs ship together.
  8. No TODO in completed phases. TODOs mean the phase is not done.
  9. No cross-tenant query. Platform-admin exceptions must be explicit and logged.
  10. No direct JournalEntry creation. Posting Engine only (ADR-010).
  11. Compliance is independent. Compliance controls are not optional UI features.
  12. AI is independent. Core business flows work when AI is off (ai-architecture.md).
  13. Everything event-ready. Prefer outbox-backed domain events for cross-service effects.
  14. Everything API-first. UI is a client, not the source of truth.
  15. Everything documented. Registries, ADRs, contracts, and progress stay current.
  16. Database-per-service. No cross-DB access (ADR-001).
  17. Frontend/Backend separation is absolute. (ADR-002).
  18. No hardcoded brand or secrets. Config/env/database only.
  19. Documentation before conflicting code. If implementation conflicts with architecture, stop and fix docs/ADR first.
  20. Phase completion gate. Follow the checklist in docs/README.md and ai-framework/quality-gates.md.
  21. Enterprise Definition of Done. Every phase must satisfy ai-framework/definition-of-done.md. CRUD is never sufficient.
  22. Mandatory production artifacts by default. Deliver applicable items from ai-framework/mandatory-phase-artifacts.md without waiting for the phase prompt to restate them.
  23. Boundary discipline. Never own another services responsibilities, duplicate its logic, access its database, or pull future-phase features forward (ai-framework/boundary-rules.md).
  24. Enterprise Completeness verification. Sign off ai-framework/enterprise-completeness.md before Complete; implement any missing current-phase requirement first (ADR-018).
  25. Enterprise Phase Discovery. Before Implementation, run ai-framework/enterprise-phase-discovery.md: inventory roadmap, architecture, boundaries, prior handover, codebase, APIs, domain, events, permissions, aggregates, tests, and docs; promote missing current-phase capabilities into Scope (ADR-019).