Skip to main content

Overview

Genie Helper’s post scheduler polls the scheduled_posts collection every 60 seconds and automatically publishes posts to X, Reddit, Instagram, TikTok, and other platforms using Stagehand browser automation. Collection: scheduled_posts
Worker: Media worker (BullMQ)
Poll interval: 60 seconds (configurable via POST_SCHEDULER_MS)

Architecture

Scheduling Flow

Collections

scheduled_posts

platform_meta Examples

Post Scheduler

Implementation: media-worker/index.js:1186-1241

Polling Logic

Publishing Operation

Operation: publish_post (media-worker)
Browser: Local Playwright (headless Chrome)
Vision LLM: ollama/qwen-2.5

Supported Platforms

X (Twitter) Publishing

Implementation: media-worker/index.js:879-890

Reddit Publishing

Implementation: media-worker/index.js:893-920
The worker automatically loads cookies from platform_sessions to bypass login:

Content Calendar UI

Page: dashboard/src/pages/ContentCalendar/index.jsx

Features

  1. AI Caption Generator (Modal 3A)
    • Platform selector (TikTok, Instagram, X, Reddit, OnlyFans)
    • Tone selector (flirty, playful, intimate, professional, casual, teasing)
    • Topic input (optional)
    • Length picker (short, medium, long)
    • Try Again feedback loop with adjustment notes
  2. Post Draft Editor (Modal 3B)
    • Platform specs validation (text limits, video dimensions)
    • Media attachment from scraped_media
    • Platform-specific clip generator (9:16 for TikTok/Snapchat)
    • Schedule time picker
    • Usage pill (plan limits)
  3. Media Picker (Modal 3C)
    • Grid view of scraped_media
    • Search filter
    • Video duration + codec display

Plan Limits

Tracked in: usage API (/api/usage/increment) Enforcement: dashboard/src/pages/ContentCalendar/index.jsx:220-227

AI Caption Generation

Endpoint: /api/captions/generate
Model: dolphin-mistral:7b (uncensored content writer)

Request

Feedback Loop

After first generation, user can click β€œTry Again” β†’ Enters feedback note β†’ Re-generates with adjustment:
Example feedback: β€œMake it shorter, add a call to action, more emojis”

Status Flow

Error Messages: Stored in scheduled_posts.error_message Common failures:
  • HITL_REQUIRED β€” No cookies available
  • Stagehand timeout β€” Page load failed
  • Auto-posting to {platform} not yet implemented β€” Platform stub

Logs & Debugging