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 5d891b62ec
feat: rank personal rooms by visit frequency
2 months ago
.cargo feat: expand media providers and playback lifecycle 2 months ago
.config refactor: infra 6 months ago
.github feat: expand media providers and playback lifecycle 2 months ago
.sqlx feat: expand media providers and playback lifecycle 2 months ago
docs feat: expand media providers and playback lifecycle 2 months ago
helm/synctv feat 3 months ago
migrations feat: rank personal rooms by visit frequency 2 months ago
scripts fix 3 months ago
synctv feat: expand media providers and playback lifecycle 2 months ago
synctv-adapter feat: expand media providers and playback lifecycle 2 months ago
synctv-api feat: rank personal rooms by visit frequency 2 months ago
synctv-cluster fix 3 months ago
synctv-common refactor case 3 months ago
synctv-core feat: rank personal rooms by visit frequency 2 months ago
synctv-livestream fix 3 months ago
synctv-management feat: expand media providers and playback lifecycle 2 months ago
synctv-media-providers feat: expand media providers and playback lifecycle 2 months ago
synctv-proto feat: rank personal rooms by visit frequency 2 months ago
synctv-proxy refactor 3 months ago
synctv-realtime refactor 3 months ago
synctv-xiu chore 3 months ago
.dockerignore chore 3 months ago
.env.postgres.example fix: ci lint 5 months ago
.env.redis.example fix: ci lint 4 months ago
.env.synctv.example chore 3 months ago
.gitignore chore 3 months ago
CONTRIBUTING.md feat: expand media providers and playback lifecycle 2 months ago
Cargo.lock feat: expand media providers and playback lifecycle 2 months ago
Cargo.toml feat: expand media providers and playback lifecycle 2 months ago
Dockerfile fix: ci lint 4 months ago
LICENSE fix: ci lint 5 months ago
Makefile feat: expand media providers and playback lifecycle 2 months ago
README.md feat: expand media providers and playback lifecycle 2 months ago
README.zh-CN.md feat: expand media providers and playback lifecycle 2 months ago
SECURITY.md fix: ci lint 5 months ago
deny.toml fic: ci 3 months ago
docker-compose.dev.yml feat: bump makefile 3 months ago
docker-compose.yml feat: bump makefile 3 months ago
rust-toolchain.toml feat: expand media providers and playback lifecycle 2 months ago
synctv.example.yaml fix 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 for Bilibili, Twitch, YouTube, Douyin, TikTok, Huya, Douyu, AcFun, CCTV, Alist, Cloudreve, Emby/Jellyfin, FNOS, QNAP, Synology, Nextcloud, Seafile, TrueNAS, direct URLs, and livestream sources.
  • 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:

# Starts PostgreSQL and Redis, then runs SyncTV locally with development settings.
make dev-serve

# Starts SyncTV in the background with the same development settings.
make dev-start
make dev-stop

# Starts optional media/auth/storage dependencies too.
make dev-stack

# Runs real CLI/curl provider smoke tests through the Makefile dev startup path.
make dev-smoke

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 +nightly run -p synctv --bin synctv -- config validate

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

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

Start locally:

cargo +nightly 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.