watch-finished-turbo

Timothy Pomeroy ca27d758e6 fix: correct queue processing logic for batchSize and concurrency 1 miesiąc temu
.devcontainer d4960bccce Add comprehensive dev container setup for consistent development environment 1 miesiąc temu
.vscode 7b7c4f0ac9 Initial commit 1 miesiąc temu
apps ca27d758e6 fix: correct queue processing logic for batchSize and concurrency 1 miesiąc temu
data b0d470b2e8 Add comprehensive Mermaid.js diagrams to all documentation files 1 miesiąc temu
docs ca27d758e6 fix: correct queue processing logic for batchSize and concurrency 1 miesiąc temu
packages c3f65becaf Update package README files with project-specific documentation 1 miesiąc temu
.cursorrules c53cbe19a2 Add .cursorrules file with comprehensive repository structure documentation for AI assistants 1 miesiąc temu
.gitignore 7b7c4f0ac9 Initial commit 1 miesiąc temu
.npmrc 7b7c4f0ac9 Initial commit 1 miesiąc temu
Dockerfile 0583888407 Optimize Docker multi-stage build and fix production compilation 1 miesiąc temu
README.md 0583888407 Optimize Docker multi-stage build and fix production compilation 1 miesiąc temu
docker-compose.yml 0583888407 Optimize Docker multi-stage build and fix production compilation 1 miesiąc temu
package.json c602da3791 Implement multi-stage Docker build with dev and prod modes 1 miesiąc temu
pnpm-lock.yaml b63ce13163 Update READMEs, add data README, remove legacy code, move dev notes to docs 1 miesiąc temu
pnpm-workspace.yaml 7b7c4f0ac9 Initial commit 1 miesiąc temu
turbo.json 0583888407 Optimize Docker multi-stage build and fix production compilation 1 miesiąc temu

README.md

Watch Finished Turbo

A modern, full-stack video processing system built with Turborepo. Automatically monitors directories, processes videos with HandBrake, and provides a complete web interface for management.

System Overview

graph TB
    subgraph "User Interfaces"
        WEB[Web Dashboard<br/>Next.js + React]
        CLI[Command Line<br/>Node.js CLI]
    end

    subgraph "API Service"
        NEST[NestJS Server<br/>REST + WebSocket]
    end

    subgraph "Core Services"
        WATCH[File Watcher<br/>Chokidar]
        QUEUE[Task Queue<br/>Background Processing]
        HANDBRAKE[Video Encoder<br/>HandBrake CLI]
    end

    subgraph "Data Storage"
        DB[(SQLite Database<br/>Files & Tasks)]
    end

    subgraph "File System"
        INPUT[Input Directories<br/>Video Files]
        OUTPUT[Output Directories<br/>Processed Videos]
    end

    WEB --> NEST
    CLI --> NEST
    NEST --> WATCH
    NEST --> QUEUE
    QUEUE --> HANDBRAKE
    WATCH --> DB
    QUEUE --> DB
    HANDBRAKE --> DB
    WATCH --> INPUT
    HANDBRAKE --> OUTPUT

    style WEB fill:#e3f2fd
    style NEST fill:#f3e5f5
    style DB fill:#e8f5e8
    style INPUT fill:#fff3e0
    style OUTPUT fill:#e0f2f1

Quick Start

Option 1: Dev Container (Recommended)

For the most consistent development experience, use the included dev container:

  1. Open in VS Code
  2. When prompted, click "Reopen in Container"
  3. Wait for the container to build and dependencies to install
  4. Start developing!

See .devcontainer/README.md for detailed setup instructions.

Option 2: Local Development

If you prefer local development:

# Install dependencies
pnpm install

# Start all services (web + API)
pnpm run dev

# Or start individually
pnpm run web      # Web interface on :3000
pnpm run service  # API server on :3001
pnpm run cli      # Interactive CLI

Docker Support

The project includes Docker support for containerized deployment and development.

Running with Docker Compose

# Build and run the application
docker-compose up --build

# Run in detached mode
docker-compose up -d

# View logs
docker-compose logs -f

# Stop the application
docker-compose down

Docker Image Features

The Docker image includes:

  • Node.js 20 with pnpm package manager
  • HandBrake CLI for video processing
  • FFmpeg for media operations
  • SQLite3 for database management
  • CLI as Default Shell: The container starts with the interactive CLI by default

Using the CLI in Docker

# Interactive CLI (default)
docker-compose run --rm app

# Direct CLI commands
docker-compose run --rm app files:list --dataset movies
docker-compose run --rm app task:list

# Override to run development servers
docker-compose run --rm app pnpm dev

Data Persistence

Database files are persisted in the ./data directory and mounted into the container for data persistence across container restarts.

Project Structure

├── apps/
│   ├── web/          # Next.js web interface
│   ├── service/      # NestJS API server
│   └── cli/          # Command-line interface
├── packages/         # Shared configurations
├── data/             # SQLite database
├── docs/             # Documentation
└── scripts/          # Build scripts
graph TD
    ROOT[watch-finished-turbo/] --> APPS[apps/]
    ROOT --> PACKAGES[packages/]
    ROOT --> DATA[data/]
    ROOT --> DOCS[docs/]
    ROOT --> SCRIPTS[scripts/]
    ROOT --> CONFIG[Configuration Files<br/>package.json, turbo.json, etc.]

    APPS --> WEB[web/<br/>Next.js UI]
    APPS --> SERVICE[service/<br/>NestJS API]
    APPS --> CLI[cli/<br/>Node.js CLI]

    PACKAGES --> ESLINT[eslint-config/<br/>Shared linting]
    PACKAGES --> TSCONFIG[typescript-config/<br/>Shared TS config]
    PACKAGES --> UI[ui/<br/>Shared components]

    DATA --> DB[(database.db<br/>SQLite)]
    DATA --> BACKUP[database.db.bak]

    DOCS --> ARCH[architecture.md<br/>System design]
    DOCS --> DEV[DEVELOPMENT_NOTES.md<br/>Dev guide]
    DOCS --> CLI_DOCS[cli.md<br/>CLI reference]

    WEB --> W_SRC[src/app/<br/>Pages]
    WEB --> W_COMP[src/components/<br/>UI components]
    WEB --> W_LIB[src/lib/<br/>Utilities]

    SERVICE --> S_SRC[src/<br/>Controllers & Services]
    SERVICE --> S_TEST[test/<br/>Unit tests]

    CLI --> C_SRC[src/<br/>CLI commands]
    CLI --> C_BIN[bin/<br/>Entry point]

    style ROOT fill:#e3f2fd
    style APPS fill:#f3e5f5
    style PACKAGES fill:#e8f5e8
    style DATA fill:#fff3e0
    style DOCS fill:#fce4ec