- Communicate with the user in Chinese.
stream is a video streaming platform built in Rust — a microservice architecture for uploading, processing, and playing back HLS video content.
Current crate layout:
crates/
├── app/ # Single binary entry point (CLI + service startup).
├── client/ # stream-client HTTP client crate.
├── client-wasm/ # WASM client (wasm32 target, excluded from workspace).
├── core/ # Shared library. Domain types, DB repos, storage helpers, server, 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.
Note: client-wasm has its own [workspace] marker and wasm32-only dependencies (wasm-bindgen, web-sys), so it cannot be compiled under the default host target and is excluded from the Cargo workspace.
System-level design: @docs/design/architecture.md
All changes — no matter how small — follow the issue → worktree → PR → merge flow. No exceptions.
@docs/guides/workflow.md @docs/guides/commit-style.md
@docs/guides/rust-style.md @docs/guides/code-comments.md
@docs/guides/anti-patterns.md
- TDD — write tests first, then implement. No exceptions.
- Per-crate tests — each lib crate owns its tests.
cargo test -p <crate>must pass. - No retroactive BDD — never create BDD/integration tests after implementation to backfill. Tests drive the design.