- Introduced Aggregator.sol for Chainlink-compatible oracle functionality, including round-based updates and access control. - Added OracleWithCCIP.sol to extend Aggregator with CCIP cross-chain messaging capabilities. - Created .gitmodules to include OpenZeppelin contracts as a submodule. - Developed a comprehensive deployment guide in NEXT_STEPS_COMPLETE_GUIDE.md for Phase 2 and smart contract deployment. - Implemented Vite configuration for the orchestration portal, supporting both Vue and React frameworks. - Added server-side logic for the Multi-Cloud Orchestration Portal, including API endpoints for environment management and monitoring. - Created scripts for resource import and usage validation across non-US regions. - Added tests for CCIP error handling and integration to ensure robust functionality. - Included various new files and directories for the orchestration portal and deployment scripts.
6.7 KiB
Architecture Diagrams Guide
This guide explains how to create and maintain architecture diagrams for the DeFi Oracle Meta Mainnet project.
Overview
Architecture diagrams are essential for understanding the system design, deployment topology, and component relationships. This project uses Azure Architecture Icons and diagram templates to create consistent, professional diagrams.
Directory Structure
assets/
├── azure-icons/ # Azure Architecture Icons
│ ├── svg/ # SVG format icons
│ ├── png/ # PNG format icons
│ └── metadata/ # Icon metadata and catalogs
├── diagrams/ # Architecture diagrams
│ ├── architecture/ # Architecture diagrams
│ ├── network/ # Network topology diagrams
│ ├── deployment/ # Deployment diagrams
│ └── templates/ # Diagram templates
└── stencils/ # Draw.io stencils
Creating Diagrams
Step 1: Setup Assets
# Setup assets directory
make -f Makefile.assets assets
# Download Azure icons
make -f Makefile.assets download-icons
Step 2: Choose a Tool
Draw.io / diagrams.net (Recommended)
- Open Draw.io
- Import Azure icons from
assets/azure-icons/svg/ - Create your diagram
- Export to SVG, PNG, or PDF
Lucidchart
- Open Lucidchart
- Use Azure icon library
- Create your diagram
- Export to desired format
Visio
- Open Microsoft Visio
- Use Azure stencils
- Create your diagram
- Export to desired format
Step 3: Use Templates
Templates are available in assets/diagrams/templates/:
- High-level architecture
- Network architecture
- Deployment architecture
- Security architecture
- Data flow diagrams
Step 4: Add Icons
Use icons from assets/azure-icons/svg/:
- Azure Kubernetes Service (AKS)
- Virtual Network
- Application Gateway
- Key Vault
- Storage Account
- And more...
See assets/azure-icons/metadata/icon-mapping.json for complete icon mapping.
Diagram Types
High-Level Architecture
Shows the overall system architecture:
- Components and their relationships
- Data flow
- Key services
- Integration points
Network Architecture
Shows network topology:
- Virtual networks
- Subnets
- Network security groups
- Network connectivity
- Private endpoints
Deployment Architecture
Shows deployment topology:
- Resource groups
- Deployment regions
- Availability zones
- Node pools
- Services
Security Architecture
Shows security controls:
- Key Vault integration
- Network security
- Access controls
- Security monitoring
- Compliance
Data Flow Diagram
Shows data flow:
- Transaction flow
- Oracle data flow
- API calls
- Data storage
- Data processing
Best Practices
Icon Usage
- Use Official Icons: Always use official Azure icons from Microsoft
- Maintain Consistency: Use the same icon set across all diagrams
- Use SVG Format: Prefer SVG for scalability
- Label Components: Label all components clearly
- Show Relationships: Show connections and data flows
Diagram Design
- Keep It Simple: Focus on key components and relationships
- Use Legends: Add legends for complex diagrams
- Use Colors: Use colors to distinguish components
- Group Related Components: Group related components together
- Show Data Flow: Show data flow with arrows
Documentation
- Include Descriptions: Add descriptions to diagrams
- Version Control: Keep diagrams in version control
- Document Changes: Document diagram changes in commits
- Update Regularly: Update diagrams when architecture changes
- Link to Documentation: Link diagrams to relevant documentation
Icon Mapping
Common Icons
| Service | SVG Icon | PNG Icon |
|---|---|---|
| Azure Kubernetes Service | Icon-service-kubernetes-Azure.svg |
Icon-service-kubernetes-Azure.png |
| Virtual Network | Icon-service-virtual-network-Azure.svg |
Icon-service-virtual-network-Azure.png |
| Application Gateway | Icon-service-application-gateway-Azure.svg |
Icon-service-application-gateway-Azure.png |
| Key Vault | Icon-service-key-vaults-Azure.svg |
Icon-service-key-vaults-Azure.png |
| Storage Account | Icon-service-storage-accounts-Azure.svg |
Icon-service-storage-accounts-Azure.png |
See assets/azure-icons/metadata/icon-mapping.json for complete mapping.
Diagram Templates
High-Level Architecture Template
# High-Level Architecture
## Components
- Azure Kubernetes Service (AKS)
- Virtual Network
- Application Gateway
- Key Vault
- Storage Account
- Monitor
## Data Flow
1. Client → Application Gateway
2. Application Gateway → AKS
3. AKS → Key Vault
4. AKS → Storage Account
Network Architecture Template
# Network Architecture
## Virtual Network
- Address Space: 10.0.0.0/16
## Subnets
- AKS Subnet: 10.0.1.0/24
- Validators Subnet: 10.0.2.0/24
- Sentries Subnet: 10.0.3.0/24
- RPC Subnet: 10.0.4.0/24
- App Gateway Subnet: 10.0.5.0/24
## Network Security Groups
- Validators NSG: Allow internal only
- Sentries NSG: Allow P2P (30303)
- RPC NSG: Allow HTTPS (443)
Updating Diagrams
When to Update
Update diagrams when:
- Architecture changes
- New components are added
- Components are removed
- Relationships change
- Deployment topology changes
How to Update
- Open the diagram file
- Make necessary changes
- Update icon references if needed
- Update documentation
- Commit changes with descriptive message
Version Control
Diagrams are tracked in Git:
- Keep diagrams in
assets/diagrams/ - Use descriptive file names
- Document changes in commit messages
- Include diagrams in pull requests
References
- Assets Guide
- Azure Architecture Center
- Azure Architecture Icons
- Azure Architecture Patterns
- Draw.io Documentation
Quick Reference
Setup Assets
make -f Makefile.assets assets
make -f Makefile.assets download-icons
Create Diagram
- Open Draw.io
- Import icons from
assets/azure-icons/svg/ - Use templates from
assets/diagrams/templates/ - Create diagram
- Export to SVG, PNG, or PDF
Icon Location
- SVG:
assets/azure-icons/svg/ - PNG:
assets/azure-icons/png/ - Metadata:
assets/azure-icons/metadata/
Diagram Location
- Architecture:
assets/diagrams/architecture/ - Network:
assets/diagrams/network/ - Deployment:
assets/diagrams/deployment/ - Templates:
assets/diagrams/templates/