How thearnavrustagi/marketmenow works
1. Overall shape
MarketMeNow is a Python 3.12+ monorepo built around a central orchestration core plus platform-specific adapters. The system is designed to generate, transform, review, and publish marketing content across multiple channels from shared project config and reusable “capsules.”
2. Core boundary: src/marketmenow
The marketmenow package is the architectural center. It contains the domain models, workflow registry, pipeline/orchestrator logic, campaign manager/planner, scheduling, project management, prompt building, normalisation, and shared utilities like text sanitisation and embedding-based selection.
3. Ports-and-adapters contract
The core talks to the outside world through explicit ports in src/marketmenow/ports for renderer, uploader, platform adapter, and analytics concerns. This is the key boundary to show in a diagram: core logic never depends directly on platform APIs, browsers, or SDKs.
4. Platform adapters
Each platform lives under src/adapters/<platform> and owns its own CLI, settings, renderer, uploader, and any browser/API client code. Supported integration surfaces include Instagram, Twitter/X, Reddit, LinkedIn, YouTube, TikTok, Facebook, and Email, with each adapter encapsulating the platform-specific publishing mechanics.
5. Content generation flow
The typical flow is: load active project config and prompts, build content through a workflow, render it into platform-specific assets/text, sanitise the final text, and upload/publish via the adapter. This pipeline appears repeatedly across reels, posts, threads, replies, comments, outreach messages, and email sends.
6. Project configuration layer
Brand and strategy are not hardcoded; they live under projects/<slug>/ and global prompts/ plus platform-specific prompt YAMLs and templates. Each project carries product description, personas, targets, campaigns, feedback assets, and generation configs, so workflows resolve content from the active project first and then fall back to global defaults.
7. Workflow system
src/marketmenow/workflows contains the named end-to-end jobs such as Instagram reel, Instagram carousel, Twitter thread/engage/outreach, Reddit launch/engage/outreach, LinkedIn post, YouTube short, TikTok reel, email outreach, and capsule repurposing/posting. The workflow registry and step registry provide the composition layer that maps these jobs to reusable pipeline steps.
8. Reusable “content capsule” model
A major architectural concept is the capsule: generated content is packaged so it can be reposted or repurposed without regeneration. The capsule-related steps and workflows support cross-platform reuse, such as turning a reel into a YouTube short or a post/thread into another format.
9. Instagram-specific subsystem
Instagram is the most elaborate adapter. It includes carousel generation, grading, reel scripting/TTS, Figma export, and a substantial Remotion-based video rendering pipeline under src/adapters/instagram/reels/remotion. That subtree is a separate Node/TypeScript video composition app embedded inside the Python repo, used to render scenes, transitions, and assets for reels.
10. Twitter/X subsystem
Twitter has both content publishing and outreach automation. In addition to thread/reply generation and posting, there is a dedicated outreach area for profile scraping, vector-style discovery of prospects, DM sending, and performance tracking, which makes Twitter a richer “engage” pipeline than a simple post publisher.
11. Feedback and learning loop
The feedback subsystem under src/marketmenow/core/feedback stores and classifies feedback, generates guidelines, and tracks sentiment. Instagram has its own grading service as well. These pieces feed the system’s in-context-learning and example-selection behavior so future generations can adapt to prior performance.
12. Campaigns and scheduling
The repo supports campaign-level planning and daemonized execution through campaign_* core modules and YAML campaign definitions in projects/*/campaigns and top-level campaigns/. This is the layer that turns one-off content generation into scheduled, multi-step marketing runs.
13. Web dashboard
src/web is a separate FastAPI-style web application layer with routes, templates, static assets, queue worker, credential handling, and progress/events support. It is the human control plane for reviewing, generating, managing flows, monitoring queues, and submitting work to the same core services the CLI uses.
14. External dependencies and infrastructure
The repo integrates with LLM providers via src/marketmenow/integrations/providers (OpenAI, Anthropic, Gemini) and uses browser automation, SMTP, platform APIs, Google/YouTube auth, and Figma export where needed. Operationally it expects uv, Docker/PostgreSQL for persistence, Playwright/Chromium for browser-driven flows, and Node.js for Remotion-based reel rendering.
15. What to draw as the main diagram
The clean diagram boundary is: CLI/Web/Queue Worker at the top, then the marketmenow core orchestrator and workflow registry in the middle, then platform adapters and external services at the edge. Around that, show project YAML/prompts/templates as a configuration/data source, and feedback/analytics as the closed loop that informs future generations.
Main entry points: platform_adapter.py Platform Port · uploader.py Uploader Port · orchestrator.py Orchestrator · pipeline.py Pipeline
Components 30
Core
Shared orchestration, workflow, and domain logic
- CLI · Command-line entry into the system
src/marketmenow/cli.py - Orchestrator · Coordinates workflow execution and shared services
src/marketmenow/core/orchestrator.py - Workflow Registry · Maps named jobs to workflow definitions
src/marketmenow/core/workflow_registry.py - Step Registry · Resolves reusable pipeline steps
src/marketmenow/steps/registry.py - Pipeline · Shared step execution and data flow
src/marketmenow/core/pipeline.py - Capsule · Packages generated content for reuse and repurposing
src/marketmenow/core/capsule.py - Project Manager · Loads active project context and project-level defaults
src/marketmenow/core/project_manager.py - Prompt Builder · Builds prompts from project, global, and platform sources
src/marketmenow/core/prompt_builder.py - Sanitiser · Normalises and sanitises final content text
src/marketmenow/core/text_sanitiser.py - Feedback Loop · Stores, classifies, and turns feedback into guidelines
src/marketmenow/core/feedback/orchestrator.py - Campaigns · Plans and schedules multi-step marketing runs
src/marketmenow/core/campaign_manager.py - Distribution · Routes content to channels and publishers
src/marketmenow/core/distributor.py - Platform Port · Abstract boundary for platform adapters
src/marketmenow/ports/platform_adapter.py - Renderer Port · Abstract boundary for content rendering
src/marketmenow/ports/content_renderer.py - Uploader Port · Abstract boundary for publishing and upload
src/marketmenow/ports/uploader.py
Adapters
Platform-specific publishing and discovery implementations
- Instagram · Carousel, reels, grading, Figma, and publishing adapter
src/adapters/instagram/adapter.py - Twitter/X · Thread, replies, engage, outreach, and publishing adapter
src/adapters/twitter/adapter.py - Reddit · Post, comment, launch, and outreach adapter
src/adapters/reddit/adapter.py - LinkedIn · Post generation, browser/API publishing adapter
src/adapters/linkedin/adapter.py - YouTube · Shorts analytics, rendering, and upload adapter
src/adapters/youtube/adapter.py - TikTok · Reel publishing adapter
src/adapters/tiktok/adapter.py - Email · Email generation and sending adapter
src/adapters/email/sender.py
Web
Human control plane and queue worker
- Web App · Dashboard and workflow control plane
src/web/app.py - Queue Worker · Processes queued jobs and events
src/web/queue_worker.py
Config
Projects, prompts, templates, and campaign definitions
- Projects · Project-specific configs, personas, targets, feedback, and templates
projects/gradeasy/project.yaml - Prompts · Global and project prompt YAMLs and templates
prompts/prompt.md - Campaign YAMLs · Top-level and project campaign definitions
campaigns/twitter-outreach.example.yaml
External
Third-party services and runtimes
- LLM Providers · OpenAI, Anthropic, and Gemini model backends
src/marketmenow/integrations/providers/openai.py - Browser/Playwright · Browser-driven automation used by adapters
- Remotion App · Embedded TypeScript video composition app for Instagram reels
src/adapters/instagram/reels/remotion/src/Root.tsx
Connections 42
- CLI → Orchestrator: starts · CLI invokes core orchestration
- Web App → Orchestrator: uses · Web control plane calls the same core services
- Queue Worker → Pipeline: runs · Worker executes queued jobs through shared pipeline logic
- Orchestrator → Workflow Registry: selects · Chooses named end-to-end workflows
- Workflow Registry → Step Registry: composes · Workflows are built from reusable steps
- Step Registry → Pipeline: executes · Registered steps run through the shared pipeline
- Pipeline → Project Manager: loads · Execution resolves active project context
- Project Manager → Projects: reads · Project data provides brand, personas, targets, and feedback assets
- Project Manager → Prompts: falls back to · Global prompts and templates provide defaults
- Prompt Builder → Projects: reads · Builds prompts from project-local configuration
- Prompt Builder → Prompts: reads · Builds prompts from shared prompt assets
- Orchestrator → Prompt Builder: builds · Core prepares generation prompts before workflow steps
- Orchestrator → Sanitiser: cleans · Final text is normalised before publishing
- Pipeline → Capsule: packages · Generated content can be stored as reusable capsules
- Capsule → Pipeline: repurposes · Capsules feed repurposing and cross-platform reuse workflows
- Feedback Loop → Project Manager: informs · Feedback and guidelines influence future generation context
- Campaigns → Workflow Registry: schedules · Campaigns select workflows for scheduled runs
- Distribution → Platform Port: targets · Distribution routes content through the platform boundary
- Platform Port → Instagram: implemented by · Instagram adapter fulfills the platform contract
- Platform Port → Twitter/X: implemented by · Twitter/X adapter fulfills the platform contract
- Platform Port → Reddit: implemented by · Reddit adapter fulfills the platform contract
- Platform Port → LinkedIn: implemented by · LinkedIn adapter fulfills the platform contract
- Platform Port → YouTube: implemented by · YouTube adapter fulfills the platform contract
- Platform Port → TikTok: implemented by · TikTok adapter fulfills the platform contract
- Platform Port → Email: implemented by · Email adapter fulfills the platform contract
- Renderer Port → Instagram: implemented by · Instagram adapter provides rendering implementations
- Renderer Port → Twitter/X: implemented by · Twitter adapter provides rendering implementations
- Renderer Port → Reddit: implemented by · Reddit adapter provides rendering implementations
- Uploader Port → Instagram: implemented by · Instagram adapter uploads or publishes assets
- Uploader Port → Twitter/X: implemented by · Twitter adapter publishes content
- Uploader Port → Reddit: implemented by · Reddit adapter publishes content
- Uploader Port → LinkedIn: implemented by · LinkedIn adapter publishes content
- Uploader Port → YouTube: implemented by · YouTube adapter uploads shorts
- Uploader Port → TikTok: implemented by · TikTok adapter publishes content
- Uploader Port → Email: implemented by · Email adapter sends messages
- Instagram → Remotion App: renders via · Instagram reels use embedded Remotion for video composition
- Instagram → Browser/Playwright: uses · Instagram publishing can rely on browser automation
- Twitter/X → Browser/Playwright: uses · Twitter/X outreach and publishing may use browser automation
- LinkedIn → Browser/Playwright: uses · LinkedIn browser publishing and scraping flows use automation
- Reddit → Browser/Playwright: uses · Reddit engagement/publishing can use browser automation
- YouTube → LLM Providers: uses · Adapters and core generation depend on model providers
- Web App → Queue Worker: queues · Web app submits jobs to background processing