C4 Architecture Models
This section contains comprehensive architecture documentation using the C4 model approach, providing multiple levels of abstraction for understanding the Law Firm Backstage API System.
📐 What is C4?
The C4 model provides a way to visualize software architecture at different levels of detail:
- Level 1: System Context - The big picture
- Level 2: Container - High-level technology choices
- Level 3: Component - Internal structure of containers
- Level 4: Code - Implementation details
🏗️ Architecture Documentation
Backstage API System
The Backstage API is the unified backend system powering the law firm's internal operations, consisting of two major API surfaces:
- Complete Backstage API Architecture ⭐ START HERE - Comprehensive C4 documentation including:
- Admin API (34 endpoints) - Provisioning, user management, access control
- User API (37 endpoints) - Cases, clients, documents, time tracking
- Level 1: System Context - All actors and external systems
- Level 2: Container Diagram - APIs, databases, caches, queues
- Level 3: Component Diagram - Internal structure of both APIs
- Level 4: Code Examples - TypeScript implementation patterns
- Data Flow Diagrams - Key user journeys (case creation, user provisioning)
- Deployment Architecture - AWS multi-AZ infrastructure
- Security Architecture - Multi-layer defense-in-depth
- Monitoring & Observability - Metrics, logs, traces, alerting
Detailed API Architecture
Individual deep-dives for each API surface:
Admin API Architecture
Administrative/provisioning API documentation:
- Admin API System Context - Admin operations in the system landscape
- Admin API Container Diagram - Admin API technology components
- Admin API Component Diagram - Internal structure of Admin API
User API Architecture
User-facing API (lawyers, paralegals, staff) documentation:
- User API Complete Architecture - Full C4 documentation with all levels
General System Architecture
Platform-wide overview diagrams:
- System Context - Overall system landscape
- Container Diagram - Platform container structure
- Component Diagram - System component organization
🎯 Quick Navigation
By User Type
For Developers:
- Start with Backstage API Architecture - Complete overview
- Review Component Structure - Admin & User API internals
- Study Code Examples - TypeScript implementations
For Architects:
- Begin with Backstage API System Context - Big picture
- Examine Container Diagram - Technology stack
- Review Deployment Architecture - AWS infrastructure
For Product Managers:
- View Backstage System Context - All actors and features
- Explore Data Flow Diagrams - Key user journeys
- Review API Comparison - Feature matrix
For Security/Compliance:
- Review Security Architecture - Defense in depth
- Examine Authentication & Authorization - Logto integration
- Study Security Features - Compliance (GDPR, SOC 2)
By Concern
Backstage API Overview:
- Backstage API Architecture - Complete unified documentation ⭐
- Admin API vs User API - Feature comparison
Authentication & Authorization:
- System Context - Logto integration
- Security Architecture - Multi-layer security
- Permission Resolver - RBAC code
Data Management:
- Container Diagram - PostgreSQL, Redis, Elasticsearch
- Component Diagram - Repository pattern
Scalability & Performance:
- Deployment Architecture - Multi-AZ, auto-scaling
- Performance Targets - SLAs and metrics
- Monitoring - Observability stack
Integration Points:
- System Context - External systems (Logto, S3, SendGrid, etc.)
- Container Diagram - Service boundaries
🔗 Related Documentation
API Documentation
- Backstage API Reference - Unified Admin + User API docs
Technical Specifications
- Backstage API Technical Specification - Complete unified spec
Data & Schema
- Database Schema - Complete ERD with 23 slices, 100+ tables
Getting Started
- Introduction - Overview and getting started
📝 Diagram Format
All diagrams in this section use Mermaid syntax and can be rendered:
- In GitHub (native support)
- In VS Code (with Mermaid extension)
- In this documentation (Docusaurus with Mermaid plugin)
- At Mermaid Live Editor
Need to update these diagrams? Edit the Markdown files in the docs/c4-models/ directory to update Mermaid diagrams and descriptions.