Architecture
Technical architecture documentation for the TVL Platform, including diagrams, deployment views, and sequence flows.
Overview
The TVL Platform follows a domain-driven design (DDD) architecture with 14 bounded contexts, built as a multi-tenant SaaS platform using Node.js, TypeScript, PostgreSQL, and React.
Architecture Documentation
- Context Diagram - System context and external integrations
- Logical Architecture - Component structure and relationships
- Deployment Views - Infrastructure and deployment topology
- Sequence Flows - Key interaction patterns and workflows
Key Architectural Patterns
Multi-Tenancy
- 3-tier isolation: Organization → Account → User
- Row-Level Security (RLS) policies in PostgreSQL
- Tenant-scoped data access patterns
Domain-Driven Design
- 14 bounded contexts with clear boundaries
- Domain events for cross-context communication
- Aggregate roots and entity relationships
Event-Driven Architecture
- Transactional outbox pattern for reliable events
- Event sourcing for audit trails
- Asynchronous processing with BullMQ
Database Patterns
- JSONB for flexible schemas
- GIST exclusion constraints for date ranges
- Time-based partitioning for audit tables
- Optimistic locking for concurrency
Related Documentation
- Database Reference - Schema and migrations
- API Reference - REST API specifications
- Implementation Guides - Development patterns and practices
- Domain Specifications - Business domain details