Skip to content

rararulab/stream

Repository files navigation

stream

Private video streaming platform built in Rust — microservice architecture for uploading, processing, and playing back HLS video content.

Architecture

graph TD
    Client["🖥️ Client<br/><small>WASM / CLI</small>"]
    Gateway["🚪 Gateway<br/><small>Reverse proxy · Rate limiting</small>"]
    Meta["📋 Meta<br/><small>Metadata CRUD · Share links</small>"]
    Ingestor["📤 Ingestor<br/><small>Upload + Transmux</small>"]
    Streamer["▶️ Streamer<br/><small>HLS Playback + Cache</small>"]
    SQLite[("🗄️ SQLite")]
    MinIO_I[("☁️ MinIO / S3")]
    MinIO_S[("☁️ MinIO / S3")]

    Client --> Gateway
    Gateway --> Meta
    Gateway --> Ingestor
    Gateway --> Streamer
    Meta --> SQLite
    Ingestor --> MinIO_I
    Streamer --> MinIO_S
Loading
Crate Description
app Single binary entry point (CLI + service startup)
core Shared library — domain types, DB repos, storage, config
gateway Reverse proxy + rate limiting
ingestor Upload + transmux pipeline
meta Video metadata CRUD, share links
server Unified HTTP server wiring
streamer HLS playback + segment caching
client-wasm WASM client (excluded from workspace, wasm32 target)

All backend services are stateless. State lives in dedicated stores (SQLite, S3/MinIO, cache).

Current Delivery Mode

This repository currently ships in standalone single-process mode by default:

  • run stream (no subcommand), or docker compose up
  • one process hosts meta + ingestor + streamer routes
  • runtime backing: SQLite + in-memory queue + in-memory object store
  • designed with service boundaries so it can be split later

Detailed runtime notes: docs/design/standalone.md

Quick Start

docker compose up

Optional: copy .env.example to .env to customize settings. It works without one.

Open http://localhost:8598 to access the web UI.

Development

Prerequisites

Commands

just fmt          # Format code (nightly rustfmt)
just check        # Compilation check
just clippy       # Run clippy
just test         # Run tests (nextest)
just lint         # Full lint suite (clippy + doc + deny)
just pre-commit   # All pre-commit checks
just build        # Build debug binary → bin/stream
just wasm         # Build WASM client
just web          # Start SvelteKit dev server (builds WASM first)

Configuration

Optional stream.toml config file. Override via environment variables.

Documentation

just book         # Render and serve docs locally (opens browser automatically)

For interview review, run just book to view the rendered documentation site (mdBook) instead of raw Markdown files. Detailed design docs source files live in docs/design/.

Tooling

  • Formatting: rustfmt (nightly)
  • Linting: clippy (pedantic + nursery) + cargo-deny
  • Testing: cargo-nextest
  • Changelog: git-cliff with conventional commits
  • Release: release-plz for automated version bumping
  • Pre-commit: prek hooks
  • CI/CD: GitHub Actions

License

MIT

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors