How otiai10/chomex works
Main Components Identification
a) Router Component
• Represents message routing functionality
• Connects to Chrome Extension APIs
• SerialRouter as a variant
b) Client Component
• This on one side of the Router
• Represents the Promise-based message sending interface
c) Model Component
• This on another side
• Includes OnMemoryStorage implementation
• Connected to Chrome's storage system
d) Types Component
• Should be connected to the Model component
• Represents the schema definition system
Relationship Representation
a) External Interfaces:
• Chrome Runtime API connection to Router
• Chrome Storage API connection to Model
• Chrome Messaging API connection to Client
b) Internal Flows:
• Client → Router (message flow)
• Router → Controllers (message handling)
• Model → Types (schema validation)
• Model → Storage (data persistence)
Specific Elements
[Chrome Extension APIs]
• ↕
[Client] → [Router] ← [Controllers]
• ↓ ↓
[Message] → [Handler]
• ↓
[Response]
[Model] ← [Types]
• ↕
[Storage]
Important Details to Highlight
a) Router Features:
• Custom route handling
• Message listener registration
• Controller mapping
b) Client Features:
• Promise-based interface
• Message sending abstraction
• Response handling
c) Model Features:
• Schema validation
• Storage interface
• ActiveRecord-like pattern
Implementation Notes
• Use double lines for API boundaries
• Version/npm information
Remember to emphasize the main purpose: facilitating Chrome extension message routing and storage management through a clean, Promise-based API.