Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Torrent search provider URL (used by Elementum-compatible providers)
# STREAMX_TORRENT_PROVIDER_URL=
# Admin credentials for testing (not recommended for production)
# STREAMX_ADMIN_USER=admin
# STREAMX_ADMIN_PASSWORD=
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
42 changes: 21 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Generated by Cargo
# will have compiled files and executables
debug
target

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# Generated by cargo mutants
# Contains mutation testing data
**/mutants.out*/

# RustRover
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
target/
node_modules/
dist/
ui-dist/
result
result-*
.direnv/
*.swp
*.swo
*~
.env
.env.local
*.db
*.db-journal
downloads/
cache/
logs/
test-results/
test-results-live/
crates/server/test-media/
providers.toml
44 changes: 44 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# StreamX

Torrent-based video streaming player. Single static Rust binary serving a React UI.

## Build

All tools are managed via Nix. Run `nix develop` to enter the dev shell.

```bash
nix develop
cd web && pnpm install && pnpm build && cd ..
cargo build --manifest-path crates/server/Cargo.toml
```

## Code standards

- Rust: `cargo fmt --all`, `cargo clippy -- -D warnings`, `cargo check` must all pass with zero warnings
- No `.unwrap()`, `.expect()`, or `panic!()` anywhere in Rust code
- Error handling via `snafu` with context selectors
- All async code uses `tokio`
- TypeScript: strict mode, no `any` types
- No `dangerouslySetInnerHTML` in React
- All SQL queries must use parameterized statements (rusqlite)
- No hardcoded secrets; JWT secret auto-generated on first run
- No em-dashes in docs or comments
- No static obvious code comments
- Lean documentation

## Project structure

- `crates/server/` - Rust backend (Axum, librqbit, FFmpeg transcoding, SQLite). Cargo workspace member; binary still named `streamx`.
- `crates/` - future crates (`core`, `api`, `desktop`) land here. See feat/workspace-split.
- `web/` - React/TypeScript frontend (Vite, Radix UI, hls.js, framer-motion). Built assets (`web/dist/`) are embedded into the server binary via rust-embed.
- `flake.nix` - Nix flake for dev shell and builds

## Testing

- Rust: `cargo test` (unit + integration)
- Frontend: `pnpm test` (vitest) and `pnpm test:e2e` (Playwright)
- E2E tests use real backend with mock streaming endpoint
- All tests must run inside `nix develop`
- Performance metrics tracked in `benchmarks/e2e_perf.json` (git-tracked)
- After running E2E tests, serve the report for review: `python3 -m http.server 8997 -d /tmp/streamx_e2e_artifacts/html-report`
- Report port: 8997 (configurable via `STREAMX_REPORT_PORT`)
Loading