Database Layer
Every tenant-scoped table carries a tenant_id column, and composite foreign keys prevent cross-tenant references from existing.
Private build / Property operations
A multi-tenant SaaS platform for homeowners associations and the property management firms that operate them. The project is in early development, with database schema and tenant isolation already complete.
Architecture
Every tenant-scoped table carries a tenant_id column, and composite foreign keys prevent cross-tenant references from existing.
The scopedDb wrapper automatically applies tenant filtering on reads and tenant assignment on inserts, keeping raw database access out of the public module surface.
ESLint flags imports of the raw unscoped database client, requiring explicit justification for any SUPER_ADMIN-only bypass.
Stack
Framework: Next.js 15 App Router with TypeScript.
Styling: Tailwind CSS.
Database: PostgreSQL, with Supabase used in development.
ORM: Drizzle ORM and drizzle-kit migrations.
Testing: Tenant isolation runtime tests verify scoped queries, tenant context behavior, and composite foreign key protections.
Roles & Records
Roles include SUPER_ADMIN, PROPERTY_MANAGER, board positions, committee members, and homeowners.
Financial amounts are stored as signed integer cents. The ledger is append-only, with corrections posted as reversing entries rather than updates or deletes.
The platform is aimed at HOA operations where resident data, property records, board documents, and financial history must remain separated by tenant.