Skip to content

Kasimkkn/linkedin-ai-agent

Repository files navigation

πŸ€– LinkedIn AI Automation System

Transform 2+ hours of daily LinkedIn content creation into 5 minutes of approval time while maintaining authentic personal voice and professional credibility.

License: MIT TypeScript React Supabase

🎯 What This System Does

A complete AI-powered LinkedIn automation platform built specifically for developers, founders, and tech professionals who want to maintain a consistent, authentic LinkedIn presence without spending hours on content creation.

The Problem We Solve

  • Time Drain: Creating LinkedIn content takes 2-3 hours daily
  • Inconsistency: Posting sporadically hurts professional visibility
  • Authenticity: Generic content doesn't reflect your unique voice
  • Trend Awareness: Missing relevant industry conversations and opportunities

Our Solution

  • AI Trend Discovery: Automatically finds relevant topics from HackerNews, Reddit, GitHub
  • Voice-Matched Content: Generates posts that authentically sound like you
  • Smart Scheduling: Posts at optimal times for maximum engagement
  • Performance Analytics: Tracks results and continuously improves

✨ Key Features

🧠 Intelligent Content Pipeline

  • 4-Agent AI System: TrendScout β†’ IdeaGenerator β†’ ContentWriter β†’ ApprovalManager
  • Real-time Trend Discovery: HackerNews, Reddit (r/programming, r/webdev), GitHub trending
  • Voice Learning: Analyzes your writing style for authentic content generation
  • Quality Scoring: Multi-dimensional content assessment (hook strength, authenticity, engagement potential)

πŸ“Š Advanced Analytics & Learning

  • Performance Tracking: Real LinkedIn engagement metrics and ROI analysis
  • A/B Testing: Automated testing of hooks, content types, and posting strategies
  • Growth Analytics: Profile development, audience insights, influence scoring
  • Continuous Optimization: System learns from your feedback and improves over time

⏰ Smart Automation

  • Intelligent Scheduling: Learns optimal posting times for your audience
  • Content Calendar: Visual scheduling with conflict detection and bulk operations
  • Publishing Queue: Automated posting with retry logic and success verification
  • Multi-method Posting: Copy-paste, browser automation, or LinkedIn API integration

🎨 Professional User Experience

  • Real-time Progress: Live pipeline execution with agent-by-agent updates
  • Modern UI: Clean, responsive interface with skeleton loading and smooth transitions
  • Multi-user Support: Secure authentication with data isolation via Supabase
  • Comprehensive Settings: Fine-tune automation, personalization, and safety controls

πŸ—οΈ Architecture Overview

Technology Stack

Frontend:     React 18 + TypeScript + Tailwind CSS + Shadcn/UI
Backend:      Supabase (PostgreSQL + Edge Functions + Real-time)
AI Services:  Groq API (Primary) + OpenAI (Fallback)
APIs:         HackerNews, Reddit, GitHub, LinkedIn (Future)
Deployment:   Vercel (Frontend) + Supabase (Backend)

System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Trend Sources │───▢│   AI Agents      │───▢│  User Interface β”‚
β”‚                 β”‚    β”‚                  β”‚    β”‚                 β”‚
β”‚ β€’ HackerNews    β”‚    β”‚ β€’ TrendScout     β”‚    β”‚ β€’ Dashboard     β”‚
β”‚ β€’ Reddit        β”‚    β”‚ β€’ IdeaGenerator  β”‚    β”‚ β€’ Approval      β”‚
β”‚ β€’ GitHub        β”‚    β”‚ β€’ ContentWriter  β”‚    β”‚ β€’ Analytics     β”‚
β”‚ β€’ Dev.to        β”‚    β”‚ β€’ QualityScorer  β”‚    β”‚ β€’ Calendar      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚   Supabase       β”‚
                    β”‚                  β”‚
                    β”‚ β€’ Database       β”‚
                    β”‚ β€’ Authentication β”‚
                    β”‚ β€’ Real-time      β”‚
                    β”‚ β€’ Edge Functions β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Supabase account
  • API keys (Groq, Reddit, GitHub)

Environment Variables

# Database & Authentication
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key

# AI Generation
VITE_GROQ_API_KEY=gsk_...
VITE_OPENAI_API_KEY=sk_...  # Fallback

# Trend Discovery
VITE_REDDIT_CLIENT_ID=your_reddit_client_id
VITE_REDDIT_CLIENT_SECRET=your_reddit_secret
VITE_GITHUB_TOKEN=ghp_...

# Optional: Direct LinkedIn Integration
VITE_LINKEDIN_CLIENT_ID=your_linkedin_client_id
VITE_LINKEDIN_CLIENT_SECRET=your_linkedin_secret

Installation

# Clone the repository
git clone https://github.com/yourusername/linkedin-ai-automation.git
cd linkedin-ai-automation

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Edit .env with your API keys

# Start development server
npm run dev

Supabase Setup

  1. Create a new Supabase project
  2. Run the database migrations:
-- Run the SQL schema from /database/schema.sql
-- This creates all necessary tables with proper relationships and security
  1. Configure Row Level Security (RLS) policies
  2. Set up Edge Functions for background processing

πŸ“– Usage Guide

1. Initial Setup

  1. Sign up with email or social login
  2. Complete onboarding: Set expertise areas, writing preferences
  3. Train your voice: Upload 3-5 existing LinkedIn posts
  4. Configure automation: Set posting frequency and content types

2. Daily Workflow

6 AM  β†’ System discovers trending topics
7 AM  β†’ Generates content ideas from trends  
8 AM  β†’ Creates LinkedIn-ready posts
9 AM  β†’ Sends approval notification
      β†’ You review and approve (5 minutes)
      β†’ System schedules and posts automatically

3. Voice Training

  • Upload existing posts: Paste text, upload files, or import from URLs
  • Analysis: System extracts vocabulary, style, and tone patterns
  • Confidence building: More training data = better voice matching
  • Continuous improvement: Learns from your approvals and edits

4. Content Management

  • Review generated content: Quality scores and trend context
  • Edit or approve: One-click approval or inline editing
  • Schedule optimization: System finds optimal posting times
  • Performance tracking: Real engagement metrics and insights

πŸ”§ Configuration Options

Content Preferences

interface ContentPreferences {
  favoriteTopics: string[];        // React, SaaS, AI, etc.
  avoidTopics: string[];          // Topics to filter out
  contentTypes: ContentType[];     // hot-take, dev-tip, build-story
  postingFrequency: number;       // Posts per week
  technicalDepth: number;         // 1-10 scale
}

Automation Settings

interface AutomationSettings {
  autoApproveHighQuality: boolean;  // Auto-approve 9+ rated content
  schedulingEnabled: boolean;       // Auto-schedule approved content
  weekendPosting: boolean;         // Include weekends
  optimalTimingOnly: boolean;      // Only post at peak times
}

Safety Controls

  • Rate limiting: Maximum posts per day/week
  • Content review: Human-in-the-loop approval required
  • Account safety: Monitor for unusual activity
  • API usage tracking: Cost monitoring and alerts

πŸ“Š Analytics & Insights

Performance Metrics

  • Engagement: Likes, comments, shares, impressions
  • Growth: Profile views, connection requests, followers
  • Content: Top-performing posts, optimal content types
  • ROI: Time saved, engagement improvement, opportunity generation

Learning Analytics

  • Approval patterns: What content you consistently approve/reject
  • Voice confidence: How well the system matches your style
  • Trend relevance: Success rate of trend-to-content pipeline
  • Optimization impact: Measured improvements over time

Strategic Insights

  • Audience analysis: Demographics, engagement patterns
  • Competitive benchmarking: Industry performance comparisons
  • Growth opportunities: Content gaps and trending topics
  • Thought leadership: Influence scoring and recognition tracking

πŸ” Security & Privacy

Data Protection

  • Row Level Security: Complete data isolation between users
  • Encrypted storage: All sensitive data encrypted at rest
  • API key management: Secure credential storage and rotation
  • Audit logging: Complete activity tracking for security

LinkedIn Compliance

  • Terms of Service: Multiple compliance options (copy-paste, API, automation)
  • Rate limiting: Respectful platform usage with human-like behavior
  • Account safety: Monitoring and alerts for suspicious activity
  • User education: Clear guidance on automation best practices

πŸ—ΊοΈ Roadmap

Phase 1: Core Intelligence βœ…

  • AI agent pipeline with real trend discovery
  • Voice learning and content personalization
  • Multi-user authentication and data isolation

Phase 2: Advanced Automation βœ…

  • Smart scheduling and publishing pipeline
  • Comprehensive analytics and A/B testing
  • Performance optimization and strategic insights

Phase 3: LinkedIn Integration 🚧

  • Direct LinkedIn posting via multiple methods
  • Real-time performance metrics collection
  • Audience insights and engagement analytics

Phase 4: Scale & Enhance πŸ“‹

  • Multi-platform support (Twitter, Medium, Dev.to)
  • Team collaboration and agency features
  • Advanced AI models and personalization
  • Enterprise security and compliance

Phase 5: Monetization πŸ“‹

  • Subscription tiers and payment processing
  • Usage-based billing and optimization
  • Partner integrations and white-labeling
  • Marketplace for content strategies

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

# Fork the repository
# Create feature branch
git checkout -b feature/amazing-feature

# Make changes and test
npm run test
npm run lint

# Commit with conventional commits
git commit -m "feat: add amazing feature"

# Push and create pull request
git push origin feature/amazing-feature

Architecture Decisions

  • AI-First: Every feature designed around intelligent automation
  • User Control: Human-in-the-loop for authenticity and safety
  • Performance: Real-time updates and efficient API usage
  • Scalability: Multi-tenant architecture from day one

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Groq for fast, reliable AI inference
  • Supabase for excellent backend-as-a-service
  • Shadcn/UI for beautiful, accessible components
  • The developer community for inspiration and feedback

πŸ“ž Support & Contact


Built with ❀️ for the developer community

Transform your LinkedIn presence from time-consuming obligation to automated growth engine.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published