-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
github-actions[bot] edited this page Apr 26, 2026
·
1 revision
A high-level orientation. The full design is in docs/ARCHITECTURE.md.
┌────────────────────────────────────────────┐
│ Browser SPA (public/) │
│ - Vite, BaseView/BaseModal framework │
│ - WebSocket client (BackendAPIClient) │
└────────────────────────────────────────────┘
│ WebSocket + REST
▼
┌────────────────────────────────────────────┐
│ api/ HttpServer · WebSocketServer │
│ CommandRegistry · CommandHandler │
└────────────────────────────────────────────┘
│
▼
┌────────────────────────────────────────────┐
│ Domain services │
│ midi/ devices · routing · playback · │
│ adaptation · messages · files · gm │
│ transports/ BLE · RTP-MIDI · Serial │
│ lighting/ drivers · effects engine │
│ audio/ DelayCalibrator │
│ files/ FileManager · BlobStore │
└────────────────────────────────────────────┘
│
▼
┌────────────────────────────────────────────┐
│ repositories/ (business-named wrappers) │
│ persistence/ Database · BackupScheduler │
│ tables/* · dbHelpers │
│ SQLite (better-sqlite3, WAL mode) │
└────────────────────────────────────────────┘
| File | Responsibility |
|---|---|
src/core/Application.js |
Composition root, lifecycle (start/stop) |
src/core/ServiceContainer.js |
DI container, lazy factories, circular-dep detection |
src/core/EventBus.js |
In-process pub/sub between command handlers and services |
src/core/Logger.js |
JSON logging with rotation |
src/core/Config.js |
Layered config (file → .env → env vars) |
src/core/errors/ |
Structured error hierarchy |
-
Dependency Injection via
ServiceContainer— every service is registered explicitly; no service-locator anti-patterns. -
Command pattern — every WebSocket message is a named command resolved by
CommandRegistry, which auto-discovers modules undersrc/api/commands/. -
Repository pattern — domain code talks to
*Repositoryclasses; the SQLite schema is hidden behind per-table managers insrc/persistence/tables/. - Observer / EventBus — decouples command handlers from real-time fan-out (UI updates, MIDI input echoes, lifecycle hooks).
-
Driver pattern — lighting backends extend
BaseLightingDriver; transports follow the same shape (BluetoothManager,NetworkManager,SerialMidiManager).
- Browser opens WebSocket (auth via
?token=ifGMBOOP_API_TOKENis set). - UI sends
{ command, id, ...params }. -
WebSocketServer→CommandHandler→ resolves command inCommandRegistry. - Handler calls one or more services / repositories.
- Services emit
EventBusevents; the WS layer broadcasts them to subscribed clients. - Response
{ type: "response", id, data }returns to the caller.
- Custom
BaseView/BaseModalframework (no React/Vue). - Each feature lives under
public/js/features/(40+ modules, e.g.midi-editor/,lighting/,auto-assign/). -
BackendAPIClientwraps the WebSocket with request correlation, auto-retry, and event subscriptions. - i18n via JSON dictionaries in
public/locales/(28 languages).
- SQLite via
better-sqlite3in WAL mode. - Migrations in
migrations/(29 files;001_baseline.sqlis the consolidated baseline). - Daily automated backups via
BackupScheduler. - File blobs use a content-addressable store (SHA-256 keys) in
src/files/BlobStore.jsfor deduplication.
ADRs are tracked under docs/adr/ — read these before proposing structural changes.
Général Midi Boop · MIT License · Sources tracked in wiki/ — edits synced on push to main.
Getting Started
Interface — Pages & Modals
- Interface-Main-Page
- Interface-Instrument-Creation
- Interface-Virtual-Piano
- Interface-Loop-Manager
- Interface-Lighting-Control
- Interface-Playlist
- Interface-Microphone
- Interface-Settings
- Interface-Hand-Management
Core Concepts
Reference
Operations
Community