Synchronized viewing, theater, live streaming, video, long-distance relationship
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Go to file
zijiren233 fe8bf50715
fix: ci lint
5 months ago
.cargo fix: ci lint 5 months ago
.config refactor: infra 6 months ago
.github fix: ci lint 5 months ago
.sqlx fix: ci lint 5 months ago
benches fix: ci lint 5 months ago
docs fix: ci lint 5 months ago
helm/synctv fix: ci lint 5 months ago
migrations fix: ci lint 5 months ago
synctv fix: ci lint 5 months ago
synctv-api fix: ci lint 5 months ago
synctv-cluster fix: ci lint 5 months ago
synctv-common fix: ci lint 5 months ago
synctv-core fix: ci lint 5 months ago
synctv-livestream fix: ci lint 5 months ago
synctv-management fix: ci lint 5 months ago
synctv-media-providers fix: ci lint 5 months ago
synctv-proto fix: ci lint 5 months ago
synctv-proxy fix: ci lint 5 months ago
synctv-xiu fix: ci lint 5 months ago
.dockerignore chore: infra 7 months ago
.env.example fix: ci lint 6 months ago
.gitignore fix: ci lint 5 months ago
CONTRIBUTING.md fix: ci lint 5 months ago
Cargo.lock fix: ci lint 5 months ago
Cargo.toml fix: ci lint 5 months ago
Dockerfile fix: ci lint 5 months ago
LICENSE fix: ci lint 5 months ago
README.md fix: ci lint 5 months ago
README.zh-CN.md fix: ci lint 5 months ago
SECURITY.md fix: ci lint 5 months ago
deny.toml fix: ci lint 5 months ago
docker-compose.dev.yml fix: ci lint 5 months ago
docker-compose.yml fix: ci lint 5 months ago
synctv.example.yaml fix: ci lint 5 months ago

README.md

SyncTV

简体中文

Rust Tokio Axum gRPC PostgreSQL Redis Docker Helm Kubernetes OpenAPI Astro Starlight License

SyncTV is a Rust implementation of a real-time synchronized video watching platform with media provider integration, livestreaming, HTTP/gRPC APIs, and Kubernetes-ready horizontal scaling.

Highlights

  • Synchronized room playback with real-time state updates.
  • Media providers including Bilibili, Alist, Emby, Jellyfin, and direct URLs.
  • RTMP push/pull, HLS, and HTTP-FLV livestream support.
  • HTTP REST, public gRPC, WebSocket, management gRPC, metrics, RTMP, and STUN runtime surfaces.
  • PostgreSQL-backed durable storage with optional Redis shared state, cache, rate limiting, and cluster coordination.
  • Docker Compose and Helm deployment templates.
  • Built-in management CLI and optional OpenAPI/Swagger UI.
  • Astro Starlight documentation site with English and Simplified Chinese content.

Quick Start

Development environment:

docker compose -f docker-compose.dev.yml up -d

Production Compose requires explicit secrets:

export SYNCTV_JWT_SECRET="$(openssl rand -base64 32)"
export SYNCTV_SECURITY_CREDENTIAL_ENCRYPTION_KEY="$(openssl rand -hex 32)"
export SYNCTV_SECURITY_OPAQUE_SERVER_SETUP_SECRET="$(openssl rand -base64 48)"
export SYNCTV_BOOTSTRAP_ROOT_PASSWORD="replace-with-a-strong-password"

docker compose up -d

Validate configuration:

cargo run -p synctv --bin synctv -- config validate

Optional migration preflight. The server also runs embedded SQLx migrations automatically during startup:

cargo run -p synctv --bin synctv -- db migrate

Start locally:

cargo run -p synctv --bin synctv -- serve

Documentation

The main documentation site lives in docs/. It contains detailed configuration reference, deployment guides, operations runbooks, CLI reference, development guide, and OpenAPI access instructions.

cd docs
npm install
npm run dev

Build the static docs site:

cd docs
npm run build

If the generated site is deployed below a subpath, set SYNCTV_DOCS_BASE at build time. Set SYNCTV_DOCS_SITE to the public origin used for canonical URLs and sitemaps.

cd docs
SYNCTV_DOCS_SITE=https://example.com SYNCTV_DOCS_BASE=/synctv npm run build

Important entry points:

Repository process documents:

Workspace Layout

  • synctv: application binary and CLI.
  • synctv-core: core business logic, configuration, services, and repositories.
  • synctv-api: HTTP/gRPC API layer.
  • synctv-livestream: RTMP/HLS/HTTP-FLV livestream support.
  • synctv-cluster: cluster coordination.
  • synctv-proxy: media proxy and slice cache.
  • synctv-proto: protobuf definitions.
  • synctv-media-providers: provider integration support.
  • synctv-management: management client/control-plane support.
  • synctv-common: shared utilities.
  • synctv-xiu: consolidated livestreaming components.
  • helm/synctv: Kubernetes Helm chart.
  • docs: Astro Starlight documentation site.

License

MIT. See LICENSE.