mirror of
https://github.com/bybrooklyn/alchemist.git
synced 2026-04-18 01:43:34 -04:00
3.2 KiB
3.2 KiB
Alchemist Context
Alchemist is a media transcoding tool designed for simplicity and space-saving. It provides a web-based dashboard to manage media libraries, monitor transcoding progress, and configure encoding profiles with automatic hardware acceleration support.
Project Overview
- Purpose: Automated media transcoding and library management to save storage space.
- Backend: Rust 2024 (Tokio, Axum 0.7, SQLx 0.8 with SQLite).
- Frontend: Astro 5, React 18, Tailwind CSS (embedded in the Rust binary via
rust-embed). - Documentation: Docusaurus 3.9 (located in
docs/package.json). - Core Technologies: FFmpeg (analyzer and executor), SQLite (state management), Argon2 (security).
Architecture & Pipeline
The core logic is managed by an Agent in src/media/processor.rs that orchestrates the following pipeline:
- Scanner: Finds files in watch folders and enqueues jobs.
- Analyzer: Runs
ffprobeto build normalized media metadata. - Planner: Decides whether to skip, remux, or transcode based on quality profiles.
- Executor: Runs
ffmpegwith selected encoders (NVIDIA, Intel, AMD, Apple, or CPU fallback). - Post-Encode: Quality checks (optional VMAF), file promotion, and database updates.
Engine States & Modes
- States:
Running,Paused,Draining,SchedulerPaused. - Modes:
Background(1 job),Balanced(capped concurrency),Throughput(uncapped concurrency).
Building and Running
The project uses just as the primary task runner.
- Development:
just dev: Builds frontend assets and starts the backend server.just web: Starts the frontend development server (Astro) independently.just run: Starts the backend only (requiresweb/distto exist).
- Build:
just build: Performs a full production build (Frontend then Rust).just docker-build: Builds the local Docker image.
- Verification:
just release-check: Runs all checks (Rust fmt, clippy, check; Frontend typecheck, build).just check-rust: Rust-only verification.
- Testing:
just test: Runs all Rust tests.just test-e2e: Runs Playwright reliability tests inweb-e2e/.
Development Conventions
- MSRV: Rust 1.85 (Rust 2024 edition).
- Task Management: Always check the
justfilefor established workflows before adding new scripts. - Configuration: Respects
ALCHEMIST_CONFIG_PATHandALCHEMIST_DB_PATH. Hot-reloading is supported for the configuration file. - Database: Uses SQLx migrations located in
migrations/. Usejust db-resetto wipe the local database for testing. - Code Style: Standard Rust formatting (
cargo fmt) and clippy (cargo clippy) are enforced in CI. - Documentation: Maintain documentation in
docs/(Markdown) and the Docusaurus site.
Key Directories
src/: Backend source code.server/: Axum API routes and handlers.media/: Transcoding pipeline, planners, and processors.db/: SQLx database access layer.
web/: Frontend source code (Astro + React).docs/: Comprehensive technical documentation.migrations/: SQLite database migrations.tests/: Integration and unit tests for the backend.web-e2e/: Playwright end-to-end tests for the web interface.