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 0a6e7dda4d
chore
3 months ago
.cargo fix: ci lint 5 months ago
.config refactor: infra 6 months ago
.github feat: file storage 4 months ago
.sqlx feat: playback 3 months ago
benches fix: ci lint 5 months ago
docs feat: playback 3 months ago
helm/synctv feat: secondary read databse pool 3 months ago
migrations feat: pin message 3 months ago
scripts feat: secondary read databse pool 3 months ago
synctv chore 3 months ago
synctv-api chore 3 months ago
synctv-cluster chore 3 months ago
synctv-common chore: simplify 3 months ago
synctv-core chore 3 months ago
synctv-livestream chore 3 months ago
synctv-management chore 3 months ago
synctv-media-providers chore 3 months ago
synctv-proto chore: simplify 3 months ago
synctv-proxy chore 3 months ago
synctv-realtime chore 3 months ago
synctv-xiu chore: simplify 3 months ago
.dockerignore chore: infra 7 months ago
.env.postgres.example fix: ci lint 5 months ago
.env.redis.example fix: ci lint 4 months ago
.env.synctv.example fix: ci lint 3 months ago
.gitignore feat: playback 3 months ago
CONTRIBUTING.md fix: ci lint 4 months ago
Cargo.lock refactor: playback provider 3 months ago
Cargo.toml feat: database file compress 3 months ago
Dockerfile fix: ci lint 4 months ago
LICENSE fix: ci lint 5 months ago
Makefile fix: ci lint 3 months ago
README.md fix: ci lint 4 months ago
README.zh-CN.md fix: ci lint 4 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 4 months ago
synctv.example.yaml feat: secondary read databse pool 3 months ago

README.md

SyncTV

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-compatible servers (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 from a full repository checkout:

# Uses built-in local-only development settings.
docker compose -f docker-compose.dev.yml up -d

Production Compose can run from the repository root or from a directory containing docker-compose.yml, .env.postgres.example, .env.redis.example, .env.synctv.example, and scripts/init-compose-env.sh. It requires explicit secrets for PostgreSQL, Redis, and application auth/encryption:

# Requires Docker Compose, openssl, and python3.
./scripts/init-compose-env.sh

# Edit SYNCTV_BOOTSTRAP_ROOT_PASSWORD in .env.synctv before starting.
docker compose config
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-core/testing: reusable integration-test fixtures and service helpers.
  • 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.