Documentation Index
Fetch the complete documentation index at: https://mintlify.com/MatthewSabia1/SubPirate-Pro/llms.txt
Use this file to discover all available pages before exploring further.
Welcome to SubPirate Pro
SubPirate Pro is a powerful Reddit marketing analysis platform that helps you discover high-value subreddits, understand their marketing potential, and run automated posting campaigns. Connect your Reddit accounts, analyze communities with AI, organize your targets into projects, and execute campaigns with precision.Quickstart guide
Get up and running in minutes with your first subreddit analysis
Environment setup
Configure your environment variables and API credentials
Reddit OAuth setup
Connect Reddit accounts with secure OAuth 2.0 authentication
Supabase configuration
Set up authentication and database with Supabase
Key features
AI-powered subreddit analysis
Analyze subreddit marketing potential using Google’s Gemini 3 Flash model via OpenRouter. Get detailed insights on community size, engagement patterns, content preferences, and optimal posting strategies.Analysis results are cached in IndexedDB for instant retrieval and processed via Web Workers for optimal performance.
Multi-account Reddit management
Connect multiple Reddit accounts securely with OAuth 2.0. All refresh tokens are encrypted at rest using AES-256-GCM encryption, ensuring your credentials stay protected.Project organization
Organize subreddits into projects with role-based access control. Invite team members with owner, admin, editor, or viewer permissions to collaborate on your marketing strategy.Automated campaign execution
Create and schedule posting campaigns with content versioning. The campaign runner automatically pairs your connected Reddit accounts with target subreddits and executes posts according to your schedule.Tech stack
SubPirate Pro is built with modern web technologies for performance and scalability:- Frontend: React 18 + TypeScript + Vite
- Routing: React Router v6
- API: Express (local dev) or Vercel Serverless Functions (production)
- Database & Auth: Supabase with row-level security (RLS)
- AI Analysis: OpenRouter API with Google Gemini 3 Flash
- Styling: Tailwind CSS with dark theme
- State Management: React Context + TanStack Query
Architecture overview
Dual-server setup
SubPirate Pro uses a dual-server architecture optimized for both development and production:- Frontend dev server runs on
:5173(Vite) and proxies API requests to the backend - API server runs on
:8787(Express) for local development - Production deployment uses Vercel serverless functions in the
api/directory
Reddit OAuth integration
SubPirate Pro implements Reddit’s web app OAuth flow:- Browser initiates OAuth with
VITE_REDDIT_APP_ID - Reddit redirects back with authorization code
- Server exchanges code for access/refresh tokens via
POST /api/reddit/oauth/exchange - Refresh tokens are encrypted with
TOKEN_ENCRYPTION_KEYand stored in the database
You must register a Reddit app at reddit.com/prefs/apps with app type “web app” and configure redirect URIs for both development and production.
Supabase integration
Authentication and data persistence powered by Supabase:- Auth: PKCE flow with email/password and Google OAuth support
- Database: PostgreSQL with comprehensive row-level security policies
- Migrations: Schema defined in
supabase/migrations/for version control - Profile auto-creation: Database trigger automatically creates user profiles on signup
Analysis workflow
The subreddit analysis pipeline is optimized for performance:AnalysisContextmanages state and user interactionsanalysisWorkerManagercoordinates background processing- Web Workers (
analysisWorker.ts/analysisSharedWorker.ts) handle heavy lifting - API endpoint
POST /api/openrouter/analyze-subredditcalls the LLM - Results cached in IndexedDB (
analysisIdb.ts) for instant retrieval
Getting started
Configure environment
Copy
.env.example to .env and fill in your API credentials.See Environment setup for detailed configuration.Ready to dive in?
Follow the quickstart guide to analyze your first subreddit
Development commands
Need help?
Explore the documentation to learn more:- Quickstart guide - Get your first analysis running
- Environment setup - Configure all required variables
- API reference - Comprehensive endpoint documentation