Skip to content

Latest commit

 

History

History
72 lines (56 loc) · 4.1 KB

File metadata and controls

72 lines (56 loc) · 4.1 KB

Reddit Mastermind

Overview

Reddit Mastermind is a production-quality content planning web application that generates weekly Reddit content calendars for companies. Given company information, personas (representing Reddit accounts), subreddits, and SEO-style query targets, the system produces natural-looking posts and comment plans that avoid appearing manufactured or promotional.

The application is designed as a professional planning tool with features including:

  • Multi-company support with persona management
  • Weekly calendar generation with AI-powered content creation
  • Quality checks to prevent overposting, topic overlap, and unnatural patterns (0-100 scoring)
  • Multiple calendar views (week grid, kanban, timeline)
  • Seeded determinism for reproducible results
  • Reddit API integration for post tracking and subreddit validation
  • Analytics dashboard with interactive charts (quality trends, persona distribution, subreddit coverage)
  • Webhook notification system for event-driven integrations

User Preferences

Preferred communication style: Simple, everyday language.

System Architecture

Frontend Architecture

  • Framework: React 18 with TypeScript, using Vite as the build tool
  • Routing: Wouter for lightweight client-side routing
  • State Management: TanStack Query (React Query) for server state management with custom query client configuration
  • UI Components: shadcn/ui component library built on Radix UI primitives with Tailwind CSS
  • Design System: Linear-inspired productivity design with Inter font family, consistent spacing primitives, and a comprehensive color system supporting light/dark modes
  • Drag and Drop: @dnd-kit for kanban view interactions

Backend Architecture

  • Runtime: Node.js with Express.js
  • Language: TypeScript with ES modules
  • API Pattern: RESTful endpoints under /api/* prefix
  • Build Process: Custom build script using esbuild for server bundling and Vite for client bundling

Data Storage

  • Database: PostgreSQL via Drizzle ORM
  • Schema Location: shared/schema.ts contains all table definitions
  • Migrations: Drizzle Kit manages migrations in /migrations directory
  • Key Tables: companies, personas, subreddits, queryTargets, calendarWeeks, calendarItems, users, redditConnections, analyticsEvents, webhooks, webhookLogs

Content Generation System

  • AI Integration: OpenAI API via Replit AI Integrations for content generation
  • Planner Algorithm: Located in server/lib/planner.ts - handles weekly calendar generation with constraint satisfaction
  • Evaluator: server/lib/evaluator.ts scores calendars and identifies issues (persona distribution, subreddit limits, day spreading)
  • Content Generator: server/lib/content-generator.ts creates post titles and outlines using AI or template fallback

Key Design Decisions

  1. Shared Schema: Database schema is shared between client and server via @shared/* path alias, enabling type safety across the stack
  2. Seeded Randomness: Uses seedrandom library to ensure deterministic calendar generation for testing and reproducibility
  3. Storage Abstraction: server/storage.ts provides an interface layer over database operations
  4. Modular Integrations: Replit integrations (chat, image, batch processing) are organized in server/replit_integrations/

External Dependencies

Database

  • PostgreSQL: Primary data store, connection via DATABASE_URL environment variable
  • Drizzle ORM: Type-safe database operations with PostgreSQL dialect

AI Services

  • OpenAI API: Used for content generation via Replit AI Integrations
  • Environment Variables: AI_INTEGRATIONS_OPENAI_API_KEY and AI_INTEGRATIONS_OPENAI_BASE_URL

Third-Party Libraries

  • UI: Radix UI primitives, Tailwind CSS, class-variance-authority, Lucide icons
  • Forms: react-hook-form with zod validation via @hookform/resolvers
  • Date Handling: date-fns for calendar operations
  • Utilities: nanoid, uuid, seedrandom

Development Tools

  • Replit Plugins: vite-plugin-runtime-error-modal, vite-plugin-cartographer, vite-plugin-dev-banner (dev only)