Crate Map
ContentForge is organized as a Cargo workspace with 11 crates. This page describes what each crate does and how they relate.
Dependency Diagram
contentforge-app
├── contentforge-cli
├── contentforge-tui
├── contentforge-mcp
├── contentforge-api
│ ├── contentforge-publish
│ ├── contentforge-agent
│ ├── contentforge-schedule
│ └── contentforge-analytics
├── contentforge-db
└── contentforge-core (shared by all)
Crate Descriptions
contentforge-core
Path: crates/contentforge-core
Dependencies: serde, chrono, uuid, thiserror
The foundation crate with zero internal dependencies. Contains all domain types:
Content-- the central entity (title, body, status, tags, adaptations, media)ContentStatus-- lifecycle enum (Idea, Drafting, Review, Ready, Scheduled, Published, Archived)ContentType-- what kind of content (Article, Thread, ShortPost, Video, ImagePost, LinkShare)Platform-- supported platforms enum with metadata (char limits, markdown support, etc.)PlatformAdaptation-- platform-specific version of contentPlatformCredential-- authentication credential types (API key, OAuth2, token, cookie)PlatformAccount-- a configured platform connectionPublication-- record of a successful publishScheduleEntry-- a scheduled publication eventRecurringSchedule-- cron-based recurring rulesContentForgeError-- the project-wide error typeMediaAttachment-- attached files with MIME types
contentforge-db
Path: crates/contentforge-db
Dependencies: contentforge-core, rusqlite, serde_json, anyhow
SQLite persistence layer:
init_db(path)-- opens/creates database with WAL mode, runs migrationsinit_memory_db()-- in-memory database for testingContentRepo-- CRUD operations for content (insert, get_by_id, list_by_status, update_status, delete)- Migration framework in
migrations.rswith append-only SQL files
Schema tables: content, adaptations, media, platform_accounts, publications, schedule, recurring_schedules, analytics.
contentforge-publish
Path: crates/contentforge-publish
Dependencies: contentforge-core, reqwest, async-trait, serde_json
Platform adapter trait and implementations:
Publishertrait -- the interface every adapter implements (platform, validate, publish, delete, health_check)PublisherRegistry-- container for all configured adapters withget()andpublish_all()DevToPublisher-- DEV.to Forem API adapterTwitterPublisher-- Twitter/X API v2 adapter (single tweets + threads)LinkedInPublisher-- LinkedIn REST API adapterMediumPublisher-- Medium API adapter
contentforge-agent
Path: crates/contentforge-agent
Dependencies: contentforge-core, rig-core, serde_json, tokio
AI agent pipeline:
- Content generation from prompts
- Intelligent platform adaptation (not just truncation)
- Thread splitting with natural break points
- Content review and quality scoring
- Uses
rig-corefor LLM provider abstraction
contentforge-schedule
Path: crates/contentforge-schedule
Dependencies: contentforge-core, contentforge-db, contentforge-publish, cron, chrono, tokio
Scheduling engine:
- Polls the schedule table on a configurable interval
- Dispatches due entries to the appropriate publisher
- Handles retries with exponential backoff
- Manages recurring schedules via cron expressions
- Runs as a background Tokio task
contentforge-analytics
Path: crates/contentforge-analytics
Dependencies: contentforge-core, contentforge-db, reqwest
Engagement metrics collection:
- Periodically fetches metrics from platform APIs (views, likes, shares, comments, clicks)
- Stores snapshots in the analytics table
- Provides aggregation queries for dashboards
contentforge-api
Path: crates/contentforge-api
Dependencies: contentforge-core, contentforge-db, contentforge-publish, contentforge-agent, contentforge-schedule, contentforge-analytics, axum, tower-http, rust-embed
The Axum HTTP server:
- REST endpoints under
/api/for all CRUD operations - WebSocket at
/api/wsfor real-time updates - Embedded SvelteKit static files served for all non-API routes
- CORS configuration for development
- Request validation and error responses
contentforge-cli
Path: crates/contentforge-cli
Dependencies: contentforge-core, contentforge-db, contentforge-publish, contentforge-api, clap
Command-line interface:
new-- create contentlist-- list content with filtersshow-- display content detailsedit-- edit content bodyadapt-- create platform adaptationspublish-- publish to platformsschedule-- schedule future publicationsplatforms-- manage platform accountsanalytics-- view engagement metricsserve-- start the web servertui-- launch the TUImcp-- start the MCP serverdaemon-- run the scheduling daemondoctor-- diagnose configuration issues
contentforge-tui
Path: crates/contentforge-tui
Dependencies: contentforge-core, contentforge-db, contentforge-api, ratatui, crossterm
Terminal user interface:
- Dashboard with content list, platform status, and schedule overview
- Content editor with Markdown preview
- Platform adaptation preview
- Schedule management
- Keyboard-driven navigation
contentforge-mcp
Path: crates/contentforge-mcp
Dependencies: contentforge-core, contentforge-db, contentforge-publish, contentforge-agent, rmcp
MCP server implementation:
- stdio transport for Claude Code
- SSE transport for web clients
- Exposes tools: create_content, list_content, adapt_content, publish, schedule, list_platforms, get_analytics
- Handles JSON-RPC requests per the MCP specification
contentforge-app
Path: crates/contentforge-app
Dependencies: all other crates, tokio, tracing-subscriber
Binary entry point:
- Parses CLI arguments
- Initializes logging (tracing-subscriber with env-filter)
- Initializes the database
- Dispatches to the appropriate interface (CLI, TUI, Web, MCP)
- Wires all crates together