Skip to content

Latest commit

 

History

History
70 lines (50 loc) · 1.86 KB

File metadata and controls

70 lines (50 loc) · 1.86 KB

Contributing to Script Reader

Thank you for your interest in contributing! Here's how to get started.

Development Setup

Prerequisites

  • Rust ≥ 1.75 (via rustup)
  • Python ≥ 3.10
  • espeak-ng (brew install espeak-ng on macOS)

Local Setup

# Clone the repo
git clone https://github.com/MettaMazza/script-reader.git
cd script-reader

# Build
cargo build

# Set up Python TTS
python3 -m venv venv
source venv/bin/activate
pip install kokoro soundfile numpy

# Run tests
cargo test

# Start dev server
cargo run

Code Standards

  • Format: Run cargo fmt before committing
  • Lint: Run cargo clippy — fix all warnings
  • Test: All new code must include tests. Run cargo test to verify
  • Docs: Add doc-comments (///) to all public functions and types

Pull Request Process

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Make your changes with tests
  4. Run cargo fmt && cargo clippy && cargo test
  5. Commit with a descriptive message
  6. Push and open a PR

Architecture Notes

  • Parser (src/parser.rs): Handles all script/novel parsing. Add new format support here.
  • TTS Engines (src/tts/): Each engine implements the TtsEngine trait. Add new engines by creating a new module.
  • Audio Pipeline (src/audio_pipeline.rs): Orchestrates chapter-by-chapter generation.
  • Routes (src/routes.rs): API handlers. All state is in AppState.

Testing Guidelines

  • Unit tests: Place in the same file as the code (using #[cfg(test)] mod tests)
  • E2E tests: Place in tests/e2e.rs — test full API roundtrips
  • Integration tests: Place in tests/ — test with real file inputs

Reporting Bugs

Open an issue with:

  1. What you expected to happen
  2. What actually happened
  3. Steps to reproduce
  4. Your OS and Rust version (rustc --version)