Skip to content

ibrahimahmed/growthmate

Repository files navigation

GrowthMate

Open-source Twitter/X growth engine.
AI-powered replies, content generation, tweet scheduling, viral discovery, and analytics — all in one dashboard.

FeaturesQuick StartTech StackContributingLicense

MIT License Next.js 16 TypeScript Tailwind CSS 4 X API v2


Why GrowthMate?

Growing on Twitter/X takes consistent, high-quality engagement. GrowthMate gives you everything you need in a single self-hosted app — no monthly SaaS fees, no data leaving your machine, fully open source.

  • Find the right conversations — Search tweets by keyword, sorted by engagement score
  • Reply at scale with AI — Draft replies with GPT-4o, Gemini, or Claude, then send in one click
  • Generate viral content — AI writer with 6 style modes and image generation
  • Schedule everything — Queue tweets for optimal posting times
  • Track what works — Full analytics dashboard with engagement breakdown and growth charts
  • Stay inspired — Viral library, trend discovery, and curated inspiration feeds

Features

Search & Reply Engine

Find high-engagement tweets by keyword from the last 24 hours. Reply directly from the platform with AI-assisted draft generation. Auto-advance through a queue for efficient engagement.

AI Content Writer

Generate 3 tweet drafts at once across 6 style modes: Engaging, Thread Opener, Hot Take, Educational, Personal, and Promotional. Voice matching from your recent tweets. Image generation via DALL-E 3 or Gemini.

Daily Mix

AI-generated daily posts across 5 categories: For You, Products, Trending, Media, and Viral Rewrites — personalized from your configured context and interests.

Viral Library

Search high-performing tweets with filters for time period, minimum likes, and reply inclusion. Masonry grid layout with full engagement metrics.

Tweet Scheduler

Schedule tweets for specific dates and times. Track status across pending, posted, failed, and draft states. Post now or queue for later.

Analytics Dashboard

Posting streak heatmap, engagement breakdown (likes, retweets, replies, bookmarks), follower growth charts, per-tweet performance table. Period selectors for 7-day, 30-day, and 90-day views.

Trend Discovery

Niche-specific trends pulled from your configured interests. See top tweets, related hashtags, and engagement data per topic.

Monitored Accounts

Track any number of X accounts. See their latest tweets with engagement stats. Refresh on demand to stay on top of competitor activity.

Context & Personalization

Configure your bio, interests (36 categories across Business, Tech, Creativity, Lifestyle, Science, Finance), favourite creators, and products. Auto-detect from your X account. All AI features use this for personalized output.

Inspiration Feed

Curated high-engagement posts from your interest areas with filters for articles, media, and more. Use any post as a seed for the AI writer.

Niche Discovery

Search for accounts and content in any niche. Results show accounts sorted by followers and tweets sorted by impressions.

Tech Stack

Layer Technology
Framework Next.js 16 (App Router, Turbopack)
Auth NextAuth v5 with X/Twitter OAuth 2.0
Styling Tailwind CSS 4
Charts Recharts
AI Providers OpenAI (GPT-4o-mini, DALL-E 3), Google AI (Gemini, image gen), Anthropic (Claude)
X API twitter-api-v2
Database PostgreSQL via Drizzle ORM
Cache Redis via ioredis
Runtime Node.js 20.9+

Quick Start

Prerequisites

  • Node.js 20.9+ (or Bun)
  • Docker (for Postgres + Redis) — or bring your own
  • An X Developer account with OAuth 2.0 app

1. Clone and install

git clone https://github.com/yourusername/growthmate.git
cd growthmate
bun install        # or: npm install

2. Configure environment

cp .env.example .env
npx auth secret    # paste output into AUTH_SECRET

Edit .env with your X Developer credentials:

AUTH_SECRET=your-generated-secret

TWITTER_CLIENT_ID=your-client-id
TWITTER_CLIENT_SECRET=your-client-secret

DATABASE_URL=postgresql://growthmate:growthmate@localhost:5432/growthmate
REDIS_URL=redis://localhost:6379

# AI providers (at least one recommended)
OPENAI_API_KEY=sk-...
GOOGLE_AI_API_KEY=AIza...
ANTHROPIC_API_KEY=sk-ant-...

3. X Developer Portal setup

  1. Go to the X Developer Portal
  2. Create a project/app (or use existing)
  3. Enable OAuth 2.0 under User authentication settings:
    • Type: Web App
    • Callback URL: http://localhost:3000/api/auth/callback/twitter
    • Website URL: http://localhost:3000
  4. Copy Client ID and Client Secret into your .env
  5. Set app permissions to Read and Write (needed for posting)

4. Start services

docker compose up -d    # Postgres 16 + Redis 7
npx drizzle-kit push    # Create database tables
bun dev                 # or: npm run dev

Open http://localhost:3000 and sign in with your X account.

AI Provider Setup

At least one provider is needed for AI writer, daily mix, reply drafts, and image generation. You can use any combination — the app auto-selects the best available or lets you pick manually.

Provider Env Variable Capabilities Get Key
OpenAI OPENAI_API_KEY GPT-4o-mini text + DALL-E 3 images platform.openai.com/api-keys
Google AI GOOGLE_AI_API_KEY Gemini text + image generation aistudio.google.com/apikey
Anthropic ANTHROPIC_API_KEY Claude Sonnet text console.anthropic.com

Usage

  1. Set up Context — Go to /context, fill in your bio, select interests, add creators and products. Click "Refresh" to auto-detect from your tweets.
  2. Search & Reply — Go to /search, enter a keyword, browse tweets sorted by engagement, draft AI replies, and send.
  3. Generate Content — Use /compose to create tweet drafts in different styles. Copy, improve, post, or schedule.
  4. Daily Mix — Visit /daily-mix for AI-crafted tweets across 5 personalized categories.
  5. Discover — Use /viral for viral tweets, /trends for niche trends, /inspiration for curated content.
  6. Analytics — Check /analytics for engagement data and /dashboard for reply activity and API costs.
  7. Monitor — Add accounts at /monitored to track competitor tweets and engagement.

Keyboard Shortcuts

Shortcut Action
Ctrl+Enter Send reply
Enter Trigger search

Data Storage

All data stays on your machine. No third-party tracking or data collection.

Store Backend Contents
Analytics Postgres analytics_events Reply logs, API call tracking, follower snapshots
Scheduler Postgres scheduled_posts Scheduled, draft, posted, and failed tweets
Context Postgres user_context Personalization (bio, interests, products, writing DNA)
Monitored Postgres monitored_accounts + monitored_tweets Tracked accounts and cached tweets
Cache Redis (TTL keys) Trends, viral, discover, and inspiration data

Production Deployment

bun run build    # or: npm run build
bun start        # or: npm start

For production, update your .env:

  • AUTH_URL — your production domain (e.g. https://your-domain.com)
  • DATABASE_URL — production Postgres connection string
  • REDIS_URL — production Redis URL
  • Update OAuth callback URL in X Developer Portal to match

Run npx drizzle-kit push against your production database.

Project Structure

src/
├── app/
│   ├── (app)/              # Authenticated pages
│   │   ├── analytics/      # Engagement analytics
│   │   ├── compose/        # AI tweet writer
│   │   ├── context/        # Personalization settings
│   │   ├── daily-mix/      # AI daily content
│   │   ├── dashboard/      # Overview dashboard
│   │   ├── discover/       # Niche discovery
│   │   ├── inspiration/    # Curated content feed
│   │   ├── monitored/      # Account tracking
│   │   ├── scheduler/      # Tweet scheduler
│   │   ├── search/         # Search & reply engine
│   │   ├── settings/       # App settings
│   │   ├── trends/         # Trend discovery
│   │   └── viral/          # Viral tweet library
│   ├── api/                # API routes
│   └── page.tsx            # Landing page
├── components/             # Shared UI components
├── lib/                    # Core logic, DB, cache, X API
└── types/                  # TypeScript declarations

Contributing

Contributions are welcome! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Commit (git commit -m 'Add amazing feature')
  5. Push to the branch (git push origin feature/amazing-feature)
  6. Open a Pull Request

Please make sure your code follows the existing style and passes linting (bun lint).

Ideas for Contributions

  • Thread composer (multi-tweet threads)
  • Bookmark collections and categorization
  • More AI providers (Mistral, Llama, etc.)
  • Browser extension for quick replies
  • Mobile-responsive improvements
  • Dark/light theme toggle
  • Export analytics to CSV
  • Webhook integrations (Slack, Discord notifications)

License

This project is licensed under the MIT License — free to use, modify, and distribute.


Built with Next.js, X API v2, and AI.
If GrowthMate helps you grow, consider giving it a star.

Releases

No releases published

Packages

 
 
 

Contributors

Languages