How immers-space/activitypub-express works
Project Type and Purpose
This is an open-source middleware library that implements the ActivityPub decentralized social networking protocol for Express.js applications. The project provides a modular implementation with interchangeable storage interfaces.
Main Components
a. Core Components:
• ActivityPub Express Middleware (Central Component)
• Storage Interface Layer
• Network Layer (net/)
• Publication Layer (pub/)
• Vocabulary Definitions (vocab/)
b. External Components:
• Express.js Application
• MongoDB (default storage)
• Remote ActivityPub Servers
• Client Applications
[Client Layer]
• ↕️
[Express.js Application]
• ↕️
[ActivityPub Express Middleware]
• Network Layer
• Activity Handlers
• Collection Handlers
• Security
• Validators
• Publication Layer
• Activity Processing
• Actor Management
• Federation
• NodeInfo
• Storage Interface
• MongoDB Adapter
• Vocabulary Definitions
[External Federation]
Key Interactions to Highlight
a. Internal Flows:
• Request handling path from Express.js through the middleware
• Activity processing flow
• Storage operations
• Security validation chain
b. External Flows:
• Federation communication paths
• Client-to-server interactions
• Server-to-server interactions
Implementation Details to Note
• Main routes (/inbox, /outbox, /actor, etc.)
• Where custom handlers can be attached
• Points where the storage interface can be swapped
• Integration points with external authentication