Case studies, applied AI, and engineering notes from Nairobi.

case study

DocuClip — Building a Worker-Backed Desktop Media Pipeline

Media generation workflows are often fragmented across tools and cloud services. DocuClip centralizes the pipeline into a trackable desktop-first system.

10 min read

Definition

Role

Full-stack systems engineer

Timeline

Ongoing development — 2026

Outcome

Built the foundation of a modular desktop processing architecture combining Electron, worker orchestration, hosted provider services, licensing systems, and AI-assisted media generation.

Stack

ElectronReactNode.jsPrismaMongoDBTypeScriptworker processesAI provider services

System Snapshot

Input

User-uploaded documents, media assets, generation preferences, and licensing credentials submitted through the desktop application.

Processing

The local backend stages jobs, orchestrates worker processes, communicates with hosted provider services, and coordinates AI-assisted transcription, script generation, TTS, and media rendering.

Output

Generated audio and video artifacts written to the user filesystem alongside structured logs, subtitles, metadata, and job history.

Overview

DocuClip is an Electron-based desktop application designed to convert source documents into audio and video outputs through a staged worker-backed processing pipeline.

The system combines:

  • a local desktop interface
  • backend worker orchestration
  • hosted provider services
  • licensing infrastructure
  • AI-assisted media generation

The project explores how complex AI and media workflows can be packaged into a desktop-first experience while maintaining separation between:

  • local orchestration
  • runtime processing
  • external provider operations
  • secret-backed services

Rather than behaving like a thin wrapper around APIs, the application is designed as a structured orchestration system capable of managing long-running media generation workflows locally.

Problem

Document-to-media workflows are typically fragmented across:

  • multiple AI tools
  • browser-based SaaS platforms
  • disconnected export pipelines
  • manual editing steps
  • inconsistent runtime environments

This creates operational problems:

  • poor workflow visibility
  • unreliable job recovery
  • unclear output tracking
  • difficult local asset management
  • insecure handling of provider credentials

The project explores how to consolidate that workflow into a single desktop pipeline that can:

  • orchestrate processing locally
  • track long-running jobs
  • manage outputs consistently
  • isolate sensitive provider operations from the client runtime

System Philosophy

Local Orchestration, Remote Secrets

One of the core architectural decisions was separating orchestration from secret-bearing operations.

The desktop application owns:

  • UI interaction
  • job lifecycle management
  • worker orchestration
  • local filesystem operations
  • runtime state

The provider server owns:

  • AI credentials
  • activation secrets
  • license signing
  • external provider integrations

This prevents the desktop runtime from becoming a direct holder of sensitive provider credentials.

Worker-Driven Processing

Media generation tasks are treated as asynchronous processing jobs rather than synchronous UI actions.

Instead of a single “generate” request, the system stages work through:

  • job creation
  • worker assignment
  • processing execution
  • progress reporting
  • output generation
  • artifact persistence

This makes the pipeline more resilient and easier to reason about operationally.

Runtime Isolation

The architecture intentionally separates:

  • Electron shell responsibilities
  • renderer responsibilities
  • backend orchestration
  • provider communication
  • worker execution

This reduces coupling between layers and makes the system easier to extend over time.

High-Level Architecture

The project is divided into four primary layers:

Layer

Responsibility

Electron Shell

Desktop runtime and application container

Renderer UI

User interaction and workflow management

Local Backend

Job orchestration and worker management

Provider Server

Licensing, AI access, and secret-backed operations

System Design

Electron Desktop Layer

The Electron shell provides the desktop runtime environment and bridges local system capabilities into the React-based renderer.

Responsibilities include:

  • native application lifecycle
  • filesystem access
  • preload communication
  • runtime environment control

The desktop layer acts primarily as the execution container rather than the processing engine itself.

Renderer Layer

The renderer handles:

  • file uploads
  • workflow interaction
  • preferences management
  • job tracking
  • output browsing
  • progress visualization

The UI is designed around long-running asynchronous workflows rather than single-request interactions.

This allows users to monitor processing state continuously while workers execute independently in the backend.

Backend Orchestration Layer

The backend is the operational core of the system.

Responsibilities include:

  • job creation
  • worker orchestration
  • task scheduling
  • output management
  • pipeline coordination
  • process supervision

The backend launches child-process workers that execute document-to-media transformations independently from the renderer process.

This separation improves runtime stability and isolates heavy processing workloads away from the UI thread.

Provider Server Layer

The provider server handles operations that should not live inside the desktop runtime.

This includes:

  • AI provider integrations
  • license activation
  • token management
  • secret-backed requests
  • signed validation responses

The desktop client communicates with the provider service as a consumer rather than embedding sensitive credentials directly into the application.

Processing Workflow

A typical processing lifecycle follows several stages.

1. Document Submission

The user uploads source documents and configures generation preferences through the desktop UI.

2. Job Registration

The backend creates a structured job object and stages required assets into the local workspace.

3. Worker Initialization

The backend spawns worker processes responsible for executing processing tasks independently.

4. AI-Assisted Processing

Workers coordinate operations such as:

  • document analysis
  • script generation
  • subtitle generation
  • SSML tagging
  • transcription
  • TTS generation
  • media composition

5. Progress Synchronization

Workers report execution state back to the backend, which synchronizes progress into the renderer UI.

6. Artifact Generation

Final outputs are written to disk alongside:

  • subtitles
  • logs
  • metadata
  • workspace artifacts

7. Export Management

Completed outputs are copied into user-facing directories for easier access outside the internal runtime workspace.

Licensing & Runtime Trust

Licensing is treated as part of runtime integrity rather than simply a payment gate.

The desktop application validates:

  • signed license payloads
  • activation envelopes
  • cached runtime state

The provider server retains:

  • private signing keys
  • activation authority
  • provider credentials

This creates a trust boundary between the desktop runtime and hosted infrastructure.

The desktop client is intentionally designed as a consumer of trust, not the owner of secrets.

Runtime Behavior

The system maintains structured runtime state inside local application directories.

This includes:

  • job workspaces
  • generated subtitles
  • logs
  • temporary artifacts
  • cached license state

User-facing exports are separated from internal runtime data to make generated media easier to access and manage.

This distinction helps preserve operational clarity between:

  • internal pipeline state
  • final deliverable artifacts

Project Structure

The repository is organized around operational boundaries.

electron/

Desktop shell and preload logic.

src/

React renderer and frontend modules.

backend/

Job APIs, orchestration systems, and worker execution logic.

provider-server/

Hosted services for licensing and AI-backed operations.

prisma/

Database schema and persistence models.

assets/ and runtime/

Bundled binaries, runtime dependencies, and media assets.

This structure makes ownership boundaries inside the codebase substantially clearer.

Engineering Challenges

Worker Coordination

Managing asynchronous media workflows introduced challenges around:

  • process supervision
  • job recovery
  • progress synchronization
  • runtime stability

Desktop Runtime Boundaries

Electron applications can easily become tightly coupled.

A major focus of the architecture was maintaining separation between:

  • UI logic
  • backend orchestration
  • provider communication
  • worker execution

Licensing & Secret Isolation

Keeping provider credentials outside the desktop runtime required careful separation between:

  • public verification state
  • signed activation data
  • secret-backed provider operations

Long-Running Pipeline Reliability

Media workflows can fail at multiple stages.

The system needed structured handling for:

  • retries
  • partial failures
  • workspace persistence
  • output recovery

Current Status

DocuClip is currently under active development.

Current progress includes:

  • Electron application foundation
  • backend orchestration architecture
  • worker execution pipeline
  • provider-server separation
  • licensing framework
  • filesystem output management

Ongoing work includes:

  • pipeline refinement
  • processing optimization
  • AI workflow expansion
  • recovery handling
  • deeper orchestration tooling
  • production hardening

What This Project Is

DocuClip is best understood as:

A desktop orchestration system for AI-assisted document-to-media generation workflows.

Not:

  • a simple Electron wrapper
  • a standalone AI model
  • a generic media converter

Its primary focus is orchestration, workflow management, and runtime coordination.

What I Learned

This project reinforced how quickly desktop applications become distributed systems once they involve:

  • worker orchestration
  • hosted services
  • licensing infrastructure
  • asynchronous processing pipelines

It also highlighted the importance of execution boundaries.

Separating:

  • renderer logic
  • backend orchestration
  • worker execution
  • provider infrastructure

made the system substantially easier to reason about as complexity increased.

Most importantly, the project demonstrated that media generation systems are less about individual AI calls and more about coordinating state, workflows, recovery behavior, and output management across multiple moving parts.