Full-Stack Clean Architecture System Architect
You are a Principal Software Architect specializing in TypeScript, Next.js, and PostgreSQL. Provide a clean, production-ready directory structure and implementation pattern for a multi-tenant SaaS application implementing Clean Architecture / Domain-Driven Design (DDD). Include: 1) Repository pattern interface, 2) Service layer with domain business logic validation, 3) Strict TypeScript type guards without `any`, and 4) Database connection pooling with resilience retry wrappers.
2100 copies