Backend Architecture
This section documents the reactive architecture patterns used in the Sidechain VST Plugin. The plugin follows a modern C++26 reactive architecture with unidirectional data flow, eliminating callback hell and providing automatic UI updates.
Architecture Guide:
- Complete Architecture Guide
- Quick Start (5 Minutes)
- Core Principles
- Architecture Layers
- The 9 Core Stores
- Observable Collections
- Data Flow Patterns
- Threading Model
- Component Patterns
- Testing Strategies
- Common Best Practices
- Troubleshooting
- See Also
- Store Pattern
- Observable Pattern
- Reactive Components
- Data Flow Patterns
- Threading Model
- Service Layer
Overview
The Sidechain plugin architecture is built on three core concepts:
Store Pattern - Centralized state management with reactive subscriptions
Observable Pattern - Reactive data bindings with automatic updates
Unidirectional Data Flow - Predictable state changes and UI updates
Key Benefits
Single Source of Truth: All state lives in stores (PostsStore, ChatStore, UserStore)
Automatic UI Updates: Components automatically repaint when store state changes
Type Safety: Full C++26 type checking with templates
Thread Safety: Proper message thread marshalling with JUCE integration
Testability: Pure functions and dependency injection enable comprehensive testing
Architecture Diagram
┌─────────────────────────────────────────────────────────────┐
│ User Interface Layer │
│ (PostsFeed, MessageThread, ProfileView - ReactiveBoundComponent) │
└────────────────────┬────────────────────────────────────────┘
│ subscribe()
▼
┌─────────────────────────────────────────────────────────────┐
│ Store Layer │
│ (PostsStore, ChatStore, UserStore - Store<TState>) │
└────────────────────┬────────────────────────────────────────┘
│ dispatch()
▼
┌─────────────────────────────────────────────────────────────┐
│ Service Layer │
│ (FeedService, AudioService, AuthService) │
└────────────────────┬────────────────────────────────────────┘
│ API calls
▼
┌─────────────────────────────────────────────────────────────┐
│ Network Layer │
│ (NetworkClient, WebSocketClient, StreamChatClient) │
└─────────────────────────────────────────────────────────────┘
Modern C++ Features Used
C++26 Standard: Full use of modern C++ features
Smart Pointers:
std::unique_ptr,std::shared_ptrfor RAIITemplates:
ObservableProperty<T>,Store<TState>Lambda Expressions: Reactive subscriptions and callbacks
std::function: Type-safe function objects
std::atomic: Lock-free audio thread communication
Move Semantics: Efficient resource transfer
See Also
Store Pattern - Centralized state management
Observable Pattern - Reactive property bindings
Reactive Components - UI component integration
Data Flow Patterns - Data flow patterns and examples
Threading Model - Threading model and safety
Service Layer - Business logic layer
Backend Integration
For information about backend support and requirements:
Backend Investigation Notes - Assessment of backend support for real-time collaboration (OT, error tracking, rate limiting)
Known Issues:
Operational Transform: Not implemented on backend (required for Task 4.20)
Error Tracking API: Not implemented (required for Task 4.19)
Rate Limiting: Implemented with minor header bug in Retry-After header