Skip to content

About

Event-sourced, non-blocking aggregation bridge and real-time SSE control plane for Number One (n1) streams — grouped by Tenant, Group, and Owner with hierarchical RBAC.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Number One Bridge (n1-bridge)

Event-sourced, non-blocking aggregation bridge and real-time Server-Sent Events (SSE) control plane for @shadow-software-platform/numberone streams.

CI License: AGPL v3


Overview

Number One Bridge aggregates Number One (.numberone/) workspace streams across repositories and teams into one real-time, cryptographically verifiable control plane:

  • Multi-Dimensional Stream Aggregation: Pivot and aggregate every stream dynamically by Tenant, Group, or Owner.
  • Hierarchical RBAC Authority Model:
    • Tenant — Overarching container (owner > member) that holds multiple Groups.
    • Group — Roles in strict order of authority: Group Owner (group_owner) > Collaborator (collaborator) > Reader (reader).
    • Repository / Stream — Roles in strict order of authority: Owner (owner) > Reader (reader).
  • 100% Event-Sourced: Every tenant, group, repo, RBAC grant/revoke, API token issuance, and ingested Number One stream event is persisted as an immutable, SHA-256 hash-chained BridgeEvent in a segmented NDJSON journal. Projections are deterministically rebuildable from seq 1.
  • 100% Non-Blocking: Zero synchronous filesystem I/O anywhere in src/. Uses async promise-serialized writes (AsyncWriteQueue), O(1)-memory async streaming replay, and backpressure-safe SSE fan-out (SseHub) that coalesces slow clients to snapshot resync frames without blocking healthy consumers.
  • Real-Time SSE Telemetry UI (bridge-main-viewer): Ships with a zero-build, air-gap-safe Karen-inspired optical HUD and smooth collapsible Tenant Dashboard (bridge-main-viewer) served automatically on port 8080 (default view), runnable natively as a Linux CLI Terminal HUD (bridge-main-viewer --cli) or Windows desktop/web/CLI launcher, and swappable via --api-only / --viewer-dir.
  • Full-Spectrum Deployment & Multi-Cloud IaC: Ready-to-install service packages and IaC modules for Windows Service (WinSW/NSSM/IIS), Linux (systemd/OpenRC/SysVinit/NGINX/Caddy/HAProxy/Apache/nFPM), AWS ECS (Fargate/EC2/CodeDeploy), Cloud Foundry (VCAP & rolling push), Docker/Podman, Kubernetes/Helm, Nomad, plus Terraform, OpenTofu, Pulumi, AWS CloudFormation, AWS CDK, Azure Bicep, Ansible, Crossplane, and Packer across AWS, Azure, GCP, DigitalOcean, and OCI.

Quick Start

Requires Node.js >= 22.

npm install
npm run build

# Launch in interactive Demo Mode (serves bridge-main-viewer on port 8080)
node dist/cli.js serve --demo

Open http://127.0.0.1:8080/ for the default bridge-main-viewer control plane, or launch it from your terminal:

# Linux / Windows Terminal real-time ANSI CLI HUD (100% SSE, upwards green size / downwards red latency bars)
bridge-main-viewer --cli --url http://127.0.0.1:8080

# Local web/app-window viewer proxy targeting a remote corporate Bridge service
bridge-main-viewer --web --app-window --url https://bridge.corp.example.com:8080 --token n1b_...

Production Service Mode (Port 8080, Token Auth, Optional TLS / Reverse Proxy)

BRIDGE_ADMIN_TOKEN="replace-with-strong-secret" \
BRIDGE_TRUST_PROXY="true" \
node dist/cli.js serve --service --host 0.0.0.0 --port 8080 --data-dir /var/lib/numberone-bridge

Generate native service descriptors directly from the CLI:

n1-bridge service print-systemd   # Hardened Linux systemd unit
n1-bridge service print-winsw     # Windows Service WinSW XML
n1-bridge service print-cf        # Cloud Foundry manifest.yml
n1-bridge service status --url http://127.0.0.1:8080

Connect a Live Local @shadow-software-platform/numberone Workspace

Stream events non-blockingly from any folder initialized with n1 attach .:

node dist/cli.js connect \
  --workspace /path/to/my-project \
  --bridge-url http://127.0.0.1:8080 \
  --repo-id rep_01... \
  --token n1b_...

Verify Cryptographic Integrity or Rebuild Projections

node dist/cli.js verify --data-dir ./.bridge-data
node dist/cli.js replay --data-dir ./.bridge-data

Documentation


Development & Testing

npm run typecheck
npm run build
npm test

License

Licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later) (see LICENSE and NOTICE), matching @shadow-software-platform/numberone.

About

Event-sourced, non-blocking aggregation bridge and real-time SSE control plane for Number One (n1) streams — grouped by Tenant, Group, and Owner with hierarchical RBAC.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages