SalesSheet.ai — Architecture: Before

Before: Monolith Components

Problem

All data access, business logic, and UI rendering in a single file per view

ContactDetail.tsx
Single file doing everything
Supabase Queries
Direct DB calls scattered throughout
~320 lines
Business Logic
Activity creation, comment handling, change tracking
~380 lines
UI Rendering
JSX, event handlers, local state
~340 lines
Error Handling
Toast notifications, retry logic, rollbacks
~160 lines
1,200
lines in a single component file
Untestable. Cannot test business logic without rendering the full component tree.
Duplicated queries. 47 Supabase queries copy-pasted across 4 components.
Merge conflicts. Every feature touches the same massive file.
12% test coverage. Only smoke tests, no unit tests for logic.