How datapeopleconnected/buttress-js works
Main System Components
a) Core Services Layer:
• REST API Server (from app.sh)
• WebSocket Server (from app-socket.sh)
• Lambda Function Runner (from app-lambda.sh)
b) Data Layer:
• Multiple Datastore Adapters:
• MongoDB Adapter
• Buttress Adapter
• Empty Adapter
• Secure Store Component
c) Access Control Layer:
• Policy Management
• Conditions Handler
• Filtering System
• Projection System
d) Model Layer:
• Core Models (User, App, Token, etc.)
• Type System (Remote/Standard Types)
Component Relationships
a) External Interfaces:
• REST API Endpoints (→ Core Services)
• WebSocket Connections (→ Real-time Service)
• Lambda Function Endpoints (→ Lambda Runner)
b) Internal Flow:
• Access Control Layer ↔ Core Services
• Core Services ↔ Model Layer
• Model Layer ↔ Data Layer
Specific Implementation Details
Technical elements:
a) Service Communication:
• Federation capabilities between instances
• Data sharing pathways
• Real-time event propagation
b) Security Layer:
• Policy enforcement points
• Token validation flow
• Secure store interactions
┌─ Client Layer ─────────────────────────┐
• REST │ WebSocket │ Lambda │
• Access Control Layer ─────────────────┤
• Policies │ Conditions │ Filters │
• Core Services ────────────────────────┤
• REST API │ Socket Server │ Lambda Runner│
• Model Layer ──────────────────────────┤
• Core Models │ Type System │
• Data Layer ───────────────────────────┤
• MongoDB │ Buttress │ Empty │
• ┘
Important Notes
• Modular nature of the datastore adapters
• Federation capabilities between different ButtressJS instances
• Real-time aspects of the system
• Lambda execution environment isolation
• Schema-based routing system