How digidem/comapeo-core works
Main Components
a. Core Components:
• MapeoManager (central orchestrator)
• MapeoProject (project management)
• DataStore (data persistence layer)
• CoreManager (manages hypercore instances)
• BlobStore (handles binary data storage)
b. Sync Components:
• LocalDiscovery (peer discovery)
• PeerSyncController (sync orchestration)
• SyncApi (sync interface)
• CoreSyncState (sync state management)
• NamespaceSyncState (namespace sync)
c. API Layers:
• BlobApi
• IconApi
• InviteApi
• MemberApi
• TranslationApi
• FastifyController (HTTP API)
Architectural Patterns to Highlight
a. Data Flow:
• How data flows from API layer through to storage
• Peer-to-peer sync paths
• Demonstrate local discovery mechanisms
b. Storage Architecture:
• Hyperdrive/Hypercore (underlying p2p storage)
• BlobStore (binary data)
• DataStore (structured data)
Component Relationships
[Client Applications]
• ↕
[FastifyController/API Layer]
• ↕
[MapeoManager]
• ↙ ↓ ↘
[Projects] [Sync] [Storage]
• ↓ ↓ ↓
[DataTypes] [Peers] [Blobs]
• ↘ ↓ ↙
• [P2P Network Layer]
Implementation Details
• Clear labels for all components
• Version information where relevant
• Database schema relationships
API interfaces
Remember to include version control and migration paths in the architecture, as indicated by the presence of schema versioning files in the project structure.
This architecture should be represented as a living document that can evolve with the project, particularly given the warning in the README that the package is not yet ready for use.