How odoo/o-spreadsheet works
High-Level Architecture
a) Core Components:
• Model Layer (src/model.ts)
• Plugin System (src/plugins/)
• Evaluation Engine (src/formulas/, src/functions/)
• UI Components (src/components/)
• Blue: Core Model/State
• Green: Business Logic/Plugins
• Orange: UI Components
• Purple: External Integrations
Key Subsystems
And represent major subsystems:
a) Data Processing:
• Formula Evaluation Engine
• Cell Computation
• Data Validation
• Conditional Formatting
b) UI Components:
• Grid System
• Top Bar
• Side Panel
• Bottom Bar
• Composer
• Figures (Charts, Images)
c) Collaboration Features:
• Real-time Sync
• History Management
• OT (Operational Transform)
Integration Points
External integration capabilities:
a) Import/Export:
• XLSX Import/Export
• File Handling
• Custom Data Integration
b) Extensibility:
• Plugin System
• Custom Functions
• Business Features
• Translation System
Data Flow
a) User Input Flow:
• UI Events → Plugins → Model → State Updates → UI Refresh
b) Collaboration Flow:
• Local Changes → Transport Service → Remote Peers
• Remote Changes → Local Model → UI Updates
Component Relationships
Interactions between:
• Grid ↔ Selection Manager
• Formula Engine ↔ Cell Evaluation
• Plugins ↔ Core Model
• UI Components ↔ Stores
Specific Implementation Details
Technical details in subsections:
Core:
• Model (TypeScript-based state management)
• Plugin System (Core, UI, Feature plugins)
• Event Bus System
• Command Pattern Implementation
UI Layer:
• Component Registry
• Store Management
• XML Templates
• Event Handling
Extensions:
• Custom Function Registry
• Menu Registry
• Side Panel Registry
• Figure Registry
□ Core Components
○ Plugins
◇ UI Components
↔ Bidirectional Data Flow
→ Unidirectional Data Flow
• Plugin Registration
Important Notes
Annotations for:
• Real-time collaboration capabilities
• Excel compatibility
• Plugin extension points
• State management approach
• Component lifecycle
Data flow patterns
Remember to:
• Keep the abstraction level consistent
• Clear boundaries between systems
• Extension points
• Major subsystems
• Document data flow patterns
This will provide a clear understanding of the system's architecture while maintaining the necessary detail level for a principal software engineer to understand the complete system.