Workspace monorepo with clear runtime boundaries
Why: The customer portal, API, worker foundation, database migrations, and shared validation contracts need to evolve together without becoming one tightly coupled application surface.
Architecture outcome: A maintainable foundation for operational workflows and background automation without retrofitting the core structure later.
Organisation-scoped data from the start
Why: CRM records, opportunities, projects, tickets, and audit activity must belong to a tenant by design, not through a UI convention.
Architecture outcome: PostgreSQL provides the source of truth while Drizzle brings schema definitions and migration discipline to customer-data boundaries.
Identity separate from product access
Why: Hosted authentication solves identity and session management, but Tessera still needs to govern organisations, memberships, roles, permissions, licences, modules, and business configuration.
Architecture outcome: Clerk can handle authentication without displacing the platform's tenant-specific access model.
Server-enforced module and permission checks
Why: Module availability and permissions cannot be treated as frontend concerns when users can reach an API outside the visible interface.
Architecture outcome: Each action can require the appropriate organisation context, module entitlement, and permission across CRM, Pipeline, Projects, Service Desk, and Admin.
Audit history as a platform capability
Why: Service teams need a dependable operational record of business changes, access changes, stage movement, and handoffs.
Architecture outcome: Meaningful actions are designed to create audit events, establishing a stronger foundation for future compliance, support, and operational review.