Skip to content

Repository files navigation

Project Forge

An Experimental Local-First AI Content Production Framework

License: MIT Rust TypeScript React Tauri


Overview

Project Forge is a local-first, modular content production framework built with Rust and TypeScript. It demonstrates senior-level software engineering patterns including trait-based architecture, dependency injection, event-driven systems, and a complete plugin SDK.

The framework processes content through a multi-stage pipeline: research, scripting, storyboarding, image generation, speech synthesis, timing analysis, and video assembly — all running locally with no cloud dependencies in the critical path.


Features

Core Pipeline

  • Research Module — Document ingestion, semantic chunking, vector search
  • Script Module — Structured script generation with versioning
  • Storyboard Module — Scene/shot planning with visual prompt building
  • Image Generation Module — AI image generation with model profiles
  • Speech Processing Module — Text-to-speech with voice profiles
  • Timing Engine — Word-level timestamp extraction (Whisper)
  • Analysis Engine — Narrative structure and pacing analysis
  • Video Pipeline — Multi-track timeline, subtitles, FFmpeg rendering
  • Validation Framework — Quality gate before final export

Orchestration

  • Workflow Coordinator — Agent scheduling, resource monitoring
  • Workflow Engine — DAG-based pipeline orchestration
  • Provider Framework — Pluggable AI provider abstraction
  • Extension SDK — Third-party plugin system

Architecture

  • Local-First — SQLite WAL, no cloud dependencies
  • Trait-Based — Clean interfaces for all components
  • Event-Driven — Tauri IPC with typed events
  • Actor Model — Serialized DB writes via actor pattern
  • Dependency Injection — Provider container pattern

Architecture

┌─────────────────────────────────────────────────────────────┐
│                       React WebView                          │
│           Zustand · TanStack Query · shadcn/ui               │
└──────────────────────────┬──────────────────────────────────┘
                           │ IPC (Tauri Commands + Events)
┌──────────────────────────┴──────────────────────────────────┐
│                    Tauri Rust Backend                         │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│  ┌──────────────┐  ┌──────────────┐  ┌───────────────────┐  │
│  │  Workflow     │  │  Workflow    │  │  Prompt Engine    │  │
│  │  Coordinator  │  │  Engine      │  │                   │  │
│  └──────┬───────┘  └──────┬───────┘  └───────────────────┘  │
│         │                  │                                  │
│  ┌──────┴──────────────────┴──────────────────────────────┐  │
│  │                   Production Pipeline                    │  │
│  │                                                          │  │
│  │  ┌───────────┐    ┌───────────┐    ┌────────────────┐   │  │
│  │  │ Research   │ →  │ Script    │ →  │ FORK           │   │  │
│  │  │ Module     │    │ Module    │    │                │   │  │
│  │  └───────────┘    └───────────┘    ├────────┐       │   │  │
│  │                                     │        │       │   │  │
│  │                            ┌────────┴──┐  ┌──┴────┐  │   │  │
│  │                            │Storyboard │  │Speech │  │   │  │
│  │                            │Module     │  │Process│  │   │  │
│  │                            └────┬──────┘  └──┬────┘  │   │  │
│  │                                 │             │       │   │  │
│  │                                 │    ┌────────┴────┐  │   │  │
│  │                                 │    │ Timing      │  │   │  │
│  │                                 │    │ Engine      │  │   │  │
│  │                                 │    └────────┬────┘  │   │  │
│  │                                 │    ┌────────┴────┐  │   │  │
│  │                                 │    │ Analysis    │  │   │  │
│  │                                 │    │ Engine      │  │   │  │
│  │                                 │    └────────┬────┘  │   │  │
│  │                                 │             │       │   │  │
│  │                            ┌────┴─────────────┴────┐  │   │  │
│  │                            │ Storyboard Refinement │  │   │  │
│  │                            └────────┬──────────────┘  │   │  │
│  │                            ┌────────┴──────────────┐  │   │  │
│  │                            │ Image Generation      │  │   │  │
│  │                            └────────┬──────────────┘  │   │  │
│  │                            ┌────────┴──────────────┐  │   │  │
│  │                            │ Video Pipeline        │  │   │  │
│  │                            └────────┬──────────────┘  │   │  │
│  │                            ┌────────┴──────────────┐  │   │  │
│  │                            │ Validation Framework  │  │   │  │
│  │                            └────────┬──────────────┘  │   │  │
│  │                                     │                 │   │  │
│  │                                     ▼                 │   │  │
│  │                              Final Output             │   │  │
│  └───────────────────────────────────────────────────────────┘  │
│                                                                  │
├──────────────────────────────────────────────────────────────┤
│  Provider Framework · Runtime Manager · Document Collections   │
├──────────────────────────────────────────────────────────────┤
│  SQLite WAL · DB Write Actor                                  │
└──────────────────────────────────────────────────────────────┘

Technology Stack

Backend (Rust)

Technology Purpose
Tauri 2.0 Desktop application framework
rusqlite SQLite database (bundled)
tokio Async runtime
reqwest HTTP client
serde Serialization
sysinfo System telemetry
nvml-wrapper NVIDIA GPU monitoring (optional)

Frontend (TypeScript)

Technology Purpose
React 19 UI framework
Zustand State management
TanStack Query Server state
Zod Schema validation
Tailwind CSS 4 Styling
Lucide React Icons
Drizzle ORM Database toolkit

Build Tools

Technology Purpose
Vite 7 Frontend build
Cargo Rust build
TypeScript 5.8 Type checking

Project Structure

project-forge/
├── src-tauri/                    # Rust backend
│   ├── src/
│   │   ├── commands/             # Tauri IPC commands
│   │   ├── db/                   # Database actor & migrations
│   │   ├── interfaces/           # Trait definitions
│   │   ├── orchestrator/         # Workflow coordinator
│   │   ├── providers/            # Provider framework
│   │   ├── plugin_sdk/           # Extension SDK
│   │   ├── research/             # Research module
│   │   ├── script/               # Script module
│   │   ├── storyboard/           # Storyboard module
│   │   ├── visual/               # Image generation
│   │   ├── voice/                # Speech processing
│   │   ├── video/                # Video pipeline
│   │   ├── automation/           # Workflow engine
│   │   ├── timestamp/            # Timing engine
│   │   ├── narrative_analysis/   # Analysis engine
│   │   ├── asset_validation/     # Validation framework
│   │   ├── knowledge/            # Document collections
│   │   ├── prompt_engine/        # Prompt engine
│   │   ├── runtime/              # Runtime manager
│   │   ├── lib.rs                # Library root
│   │   └── main.rs               # Entry point
│   ├── migrations/               # SQL migrations (15 files)
│   └── Cargo.toml                # Rust dependencies
│
├── src/                          # TypeScript frontend
│   ├── types/                    # Zod schemas & types
│   ├── stores/                   # Zustand stores
│   ├── features/                 # Feature modules
│   ├── components/               # Shared components
│   ├── db/                       # Drizzle schema
│   ├── utils/                    # Utility functions
│   ├── App.tsx                   # Root component
│   └── main.tsx                  # Entry point
│
├── public/                       # Static assets
├── package.json                  # Node dependencies
├── tsconfig.json                 # TypeScript config
├── vite.config.ts                # Vite config
└── index.html                    # Entry HTML

Engineering Highlights

1. Actor Pattern for Database Writes

All database writes go through a serialized actor, preventing write conflicts while allowing concurrent reads.

2. Trait-Based Interfaces

Every major component implements a defined trait, enabling clean separation and testability.

3. Event-Driven IPC

Type-safe communication between Rust backend and React frontend via Tauri commands and events.

4. Dependency Injection

Provider container pattern for managing AI provider instances.

5. DAG-Based Workflow Engine

Topological sort, cycle detection, and parallel group execution for pipeline orchestration.

6. Plugin SDK

Complete extension system with lifecycle management, permissions, and stable API interfaces.

7. Type-Safe State Management

Zustand stores with Zod schemas for runtime validation.

8. Database Migrations

15 versioned SQL migrations with proper indexing and foreign keys.


Extension SDK

Project Forge includes a complete plugin system for third-party extensions:

  • 10 Plugin Categories — Research, LLM, Image, Video, Voice, Prompts, Workflows, Validation, Export, Import
  • 7 Granular Permissions — Filesystem, Network, Models, Workspace, Notifications, Clipboard
  • 8 Stable API Interfaces — Versioned contracts for all modules
  • Lifecycle Management — Install, Load, Enable, Disable, Unload, Remove
  • Dependency Resolution — Circular dependency detection
  • Conflict Detection — Prevent incompatible plugins

Screenshots

[Screenshots placeholder — Add UI screenshots here]


Future Work

  • Export Engine (MP4, MOV, WebM)
  • Publishing Engine (Platform adapters)
  • Analytics Engine (Pipeline metrics)
  • Collaboration (Multi-user)
  • Cloud Rendering (Remote FFmpeg)

Contributing

See CONTRIBUTING.md for guidelines.


License

This project is licensed under the MIT License — see LICENSE for details.


Built with Rust, TypeScript, and Tauri

About

An Experimental Local-First AI Content Production Framework

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages