2025-11-07 22:34:54 -08:00
# Architecture Documentation
2025-11-13 09:32:55 -08:00
**Last Updated**: 2025-01-27
**Status**: Comprehensive Architecture Guide
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
## Overview
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
This directory contains comprehensive architecture documentation for The Order platform, including system design, data models, deployment architecture, and architectural decision records (ADRs).
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
## Documentation Index
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
### Core Architecture
- [Cloud for Sovereignty Landing Zone ](CLOUD_FOR_SOVEREIGNTY_LANDING_ZONE.md ) - Complete multi-region architecture
- [Sovereignty Landing Zone Summary ](SOVEREIGNTY_LANDING_ZONE_SUMMARY.md ) - Executive summary
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
### System Design
- **Microservices Architecture**: See service documentation in `services/*/README.md`
- **Data Models**: Entity relationships and database schema
- **API Design**: RESTful APIs with OpenAPI/Swagger documentation
- **Security Architecture**: Zero-trust, defense in depth
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
## Architecture Principles
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
### Well-Architected Framework
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
The Order follows Azure Well-Architected Framework principles:
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
1. **Cost Optimization **
- Right-sized resources
- Reserved instances
- Cost allocation tags
- Budget alerts
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
2. **Operational Excellence **
- Infrastructure as Code
- Automated deployments
- Centralized logging
- Runbooks and playbooks
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
3. **Performance Efficiency **
- Regional proximity
- CDN for global delivery
- Auto-scaling
- Performance monitoring
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
4. **Reliability **
- Multi-region redundancy
- Availability Zones
- Automated failover
- RTO: 4 hours, RPO: 1 hour
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
5. **Security **
- Zero-trust architecture
- Defense in depth
- Data encryption
- Identity and access management
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
### Cloud for Sovereignty
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
- **Data Residency**: All data within specified regions
- **Data Protection**: Customer-managed keys, private endpoints
- **Compliance**: GDPR, eIDAS, regional requirements
- **Operational Control**: Management groups, policy governance
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
## System Architecture
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
### High-Level Overview
2025-11-07 22:34:54 -08:00
```
2025-11-13 09:32:55 -08:00
┌─────────────────────────────────────────────────────────────┐
│ Frontend Applications │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ MCP Legal │ │ Portal Public│ │Portal Internal│ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ API Gateway / Load Balancer │
└─────────────────────────────────────────────────────────────┘
│
┌───────────────────┼───────────────────┐
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Identity │ │ Intake │ │ Finance │
│ Service │ │ Service │ │ Service │
└──────────────┘ └──────────────┘ └──────────────┘
│ │ │
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Dataroom │ │Legal Docs │ │ e-Residency │
│ Service │ │ Service │ │ Service │
└──────────────┘ └──────────────┘ └──────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Shared Infrastructure │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │PostgreSQL│ │ Redis │ │OpenSearch│ │ Azure │ │
│ │ │ │ │ │ │ │ Storage │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
└─────────────────────────────────────────────────────────────┘
2025-11-07 22:34:54 -08:00
```
2025-11-13 09:32:55 -08:00
### Service Architecture
Each service follows a consistent architecture:
2025-11-07 22:34:54 -08:00
```
2025-11-13 09:32:55 -08:00
Service
├── API Layer (Fastify)
│ ├── Routes
│ ├── Middleware
│ └── Validation
├── Service Layer
│ ├── Business Logic
│ ├── External Integrations
│ └── Error Handling
├── Data Layer
│ ├── Database Queries
│ ├── Caching
│ └── Storage
└── Infrastructure
├── Health Checks
├── Metrics
└── Logging
2025-11-07 22:34:54 -08:00
```
## Data Models
### Core Entities
- **User**: Member of The Order
- **Identity**: Digital identity (eIDAS/DID)
- **Credential**: Verifiable credential
2025-11-13 09:32:55 -08:00
- **Document**: Legal document
- **Matter**: Legal matter
- **Deal**: Business transaction
- **Payment**: Financial transaction
2025-11-07 22:34:54 -08:00
### Relationships
2025-11-13 09:32:55 -08:00
See entity relationship diagrams in service-specific documentation.
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
## Deployment Architecture
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
### Regional Deployment
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
The Order is deployed across 7 non-US commercial Azure regions:
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
1. **West Europe ** (Netherlands) - Primary
2. **North Europe ** (Ireland) - Secondary
3. **UK South ** (London)
4. **Switzerland North ** (Zurich)
5. **Norway East ** (Oslo)
6. **France Central ** (Paris)
7. **Germany West Central ** (Frankfurt)
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
### Per-Region Architecture
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
Each region includes:
- Hub Virtual Network (gateway, firewall, management)
- Spoke Virtual Network (application, database, storage)
- Azure Firewall
- Key Vault (with private endpoint)
- Storage Account (with private endpoint)
- Log Analytics Workspace
- AKS Cluster (optional)
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
### Network Architecture
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
- **Hub-and-Spoke**: Centralized connectivity
- **Private Endpoints**: Secure service access
- **Azure Firewall**: Centralized security
- **VNet Peering**: Hub-to-spoke connectivity
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
## Security Architecture
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
### Zero-Trust Principles
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
- **Identity Verification**: Always verify identity
- **Least Privilege**: Minimum required access
- **Network Segmentation**: Isolated networks
- **Encryption**: At rest and in transit
- **Monitoring**: Continuous security monitoring
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
### Defense in Depth
1. **Perimeter ** : Azure Firewall, WAF
2. **Network ** : NSGs, Private Endpoints
3. **Application ** : Authentication, Authorization
4. **Data ** : Encryption, Access Controls
5. **Identity ** : MFA, RBAC, PIM
2025-11-07 22:34:54 -08:00
## Monitoring & Observability
### Metrics
- Application metrics (Prometheus)
2025-11-13 09:32:55 -08:00
- Infrastructure metrics (Azure Monitor)
- Business metrics (Custom dashboards)
2025-11-07 22:34:54 -08:00
### Logging
- Structured logging (JSON)
2025-11-13 09:32:55 -08:00
- Centralized log aggregation (Log Analytics)
- Log retention (90 days production)
2025-11-07 22:34:54 -08:00
### Tracing
- Distributed tracing (OpenTelemetry)
- Request flow visualization
- Performance analysis
## Disaster Recovery
2025-11-13 09:32:55 -08:00
### Strategy
- **RTO**: 4 hours
- **RPO**: 1 hour
- **Primary Region**: West Europe
- **Secondary Region**: North Europe
- **Backup Regions**: Other 5 regions
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
### Backup Strategy
- Database: Daily full, hourly incremental
- Storage: Cross-region replication
2025-11-07 22:34:54 -08:00
- Configuration: Version controlled
2025-11-13 09:32:55 -08:00
## Technology Stack
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
### Frontend
- React 18+
- Next.js 14+
- TypeScript
- Tailwind CSS
- Material-UI
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
### Backend
- Node.js 18+
- TypeScript
- Fastify
- PostgreSQL
- Redis
2025-11-07 22:34:54 -08:00
2025-11-13 09:32:55 -08:00
### Infrastructure
- Azure (non-US commercial)
- Kubernetes
- Terraform
- Docker
### Monitoring
- Prometheus
- Grafana
- OpenTelemetry
- Log Analytics
## Design Decisions
### Why Microservices?
- Independent scaling
- Technology diversity
- Team autonomy
- Fault isolation
### Why Azure (Non-US)?
- Data sovereignty requirements
- GDPR compliance
- Regional data residency
- Cloud for Sovereignty
### Why Kubernetes?
- Container orchestration
- Auto-scaling
- Rolling updates
- Service discovery
## Related Documentation
- [Cloud for Sovereignty Landing Zone ](CLOUD_FOR_SOVEREIGNTY_LANDING_ZONE.md )
- [Deployment Guides ](../deployment/README.md )
- [Service Documentation ](../../services/*/README.md )
- [Infrastructure Documentation ](../../infra/README.md )
---
**Last Updated**: 2025-01-27