B2B Collaboration Mode
Relevant source files
The following files were used as context for generating this wiki page:
B2B Collaboration Mode enables DJs to coordinate music preparation with partners in real time. This system synchronizes set structures and track metadata across multiple devices without moving raw audio files. It ensures that both performers share identical cues, sequences, and metadata before a live performance.
Sources: README.md:133-136, README.md:175-177
Architecture and Data Flow
The B2B system utilizes a hybrid local-first and cloud-assisted architecture. While the core analysis and audio storage remain local to the desktop application, the collaboration layer operates via an optional Cloud API.
Collaborative Components
- Desktop Shell (Tauri v2): Handles local metadata storage and user interaction.
- Cloud API (Fastify 5): Manages real-time synchronization and workspaces.
- PostgreSQL 16: Stores shared metadata and set configurations in the cloud.
- IPC Bridge: Facilitates communication between the React frontend and the Rust core for cloud syncing.
Sources: README.md:205-235, apps/desktop/src-tauri/Cargo.toml:34-40
Metadata Synchronization Flow
The following diagram illustrates how metadata propagates between collaborators while audio remains isolated.
The diagram shows that synchronization involves only the Cloud API and metadata databases, leaving raw audio files untouched on local disks.
Sources: README.md:205-245
Workspace Management
Collaboration occurs within defined workspaces. Each workspace isolates a specific set or library, allowing multiple DJs to contribute to a shared tracklist.
Data Model for Collaboration
The system uses the workspaces and tracks tables to maintain synchronization state.
| Entity | Description | Key Fields |
|---|---|---|
| Workspace | A shared environment for collaborators. | id, name, created_at |
| Track | Metadata representation of an audio file. | file_hash, title, artist, bpm, key_camelot |
| Skill Run | Tracks bulk changes (e.g., tag cleaning) for undo capability. | skill_name, before_state, after_state |
Sources: apps/desktop/src-tauri/migrations/001_initial_schema.sql:4-53
Workspace Relationship Diagram
This diagram defines the relationship between shared workspaces and the local metadata entities synchronized during B2B sessions.
Sources: apps/desktop/src-tauri/migrations/001_initial_schema.sql:4-65
Sync Verification
A sync check occurs before performance to ensure library consistency. The system compares local file fingerprints (BLAKE3 hashes) and metadata against the shared workspace records.
- Fingerprint Validation: The app verifies that both DJs possess the same audio files via hash comparison.
- Metadata Alignment: The system ensures BPM, key, and cue points match the cloud-stored canonical version.
- Conflict Resolution: DJs review differences before committing to a final "Gig Ready" state.
Sources: README.md:133-136, CHANGELOG.md:335-337
Security and Privacy Principles
B2B Collaboration Mode adheres to a non-destructive, privacy-first protocol:
- Audio Isolation: The system never transfers raw audio files over the network.
- Opt-in Sync: Network connectivity for B2B mode is strictly additive and requires explicit user activation.
- Fingerprint-only Identification: Files are identified by BLAKE3 hashes of the first 1MB and duration, protecting full file content from exposure during discovery.
Sources: README.md:118-125, README.md:205-210, apps/desktop/src-tauri/Cargo.toml:34-40
Implementation Status
B2B Collaboration is scheduled for Phase 4 of the development roadmap.
- Phase 0 (Complete): Established local SQLite schema and basic IPC commands.
- Phase 1 (In Progress): Analysis engine and local ONNX pipeline.
- Phase 4 (Planned): Full cloud API integration, real-time sync, and B2B workspace UI.
Sources: CHANGELOG.md:335-340, README.md:307-315
B2B Collaboration Mode transforms DJ Assistant from a solo preparation tool into a networked utility for performance partners. By focusing on metadata synchronization while keeping audio local, the system maintains high performance and user privacy throughout the preparation lifecycle.