Skip to content

santosh5603/instantIQ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ Instant!Q

Turn Every Saved Reel Into Knowledge You Own


Typing SVG



Version Status License PRs Welcome

Python FastAPI Next.js Playwright

Supabase Redis Docker Notion



πŸ“‹ Table of Contents

Click to expand

🧠 What is Instant!Q?

"Every reel you forward becomes a resource you own."

Instant!Q is a personal knowledge automation system that transforms the passive act of saving an Instagram reel into an active, fully automated pipeline. It detects the creator's call-to-action (CTA), comments the required keyword, captures the DM response, and stores the resource in your Notion knowledge base β€” all with zero manual follow-up.

Think of it as a personal bridge between Instagram's creator economy and your second brain.

πŸ“± You save a reel  β†’  πŸ€– Instant!Q does everything else  β†’  πŸ“š Resource lands in Notion

πŸ”₯ The Problem

Instagram creators gate valuable resources behind engagement mechanics:

Creator CTA Pattern What Happens
"Comment GUIDE below πŸ‘‡" Automation DMs you a PDF or link
"Follow + Comment PDF" Requires follow before triggering resource
"DM me START" Direct message triggers a drip sequence
"Drop AI in the comments πŸ”₯" Resource sent via DM after keyword comment

😩 Why Users Fail to Claim Resources

❌  Scroll past at high speed β†’ forget within seconds
❌  Friction of switching from watching to commenting breaks flow
❌  Save the reel to "do it later" β†’ never happens
❌  Comment the keyword β†’ never check DMs for the response
❌  Resources buried in DMs β†’ impossible to find later
❌  No organization, search, or retrieval system

πŸ“‰ The Knowledge Loss

Career guides, programming tutorials, AI toolkits, fitness protocols β€” all lost despite the user explicitly showing interest by saving the reel.


✨ The Solution

Instant!Q automates the entire pipeline from reel share to structured knowledge entry β€” with just one manual action: sharing the reel to a collector account.

graph LR
    A["πŸ“± Share Reel"] -->|"DM to collector"| B["πŸ” Detect CTA"]
    B -->|"keyword found"| C["πŸ’¬ Auto Comment"]
    B -->|"follow required"| C2["πŸ‘€ Auto Follow"] --> C
    C --> D["πŸ“© Monitor DMs"]
    D --> E["πŸ“¦ Extract Resource"]
    E --> F["πŸ’Ύ Store in Supabase"]
    F --> G["πŸ“š Sync to Notion"]

    style A fill:#6C63FF,stroke:#333,color:#fff
    style B fill:#FF6584,stroke:#333,color:#fff
    style C fill:#00C853,stroke:#333,color:#fff
    style C2 fill:#FFB74D,stroke:#333,color:#fff
    style D fill:#29B6F6,stroke:#333,color:#fff
    style E fill:#AB47BC,stroke:#333,color:#fff
    style F fill:#3FCF8E,stroke:#333,color:#fff
    style G fill:#000000,stroke:#333,color:#fff
Loading

🎯 Key Features

Feature Description Status
πŸ”Ž DM Detection Monitors collector inbox for forwarded reels via instagrapi βœ…
πŸ“ Caption Extraction Opens reel URL, extracts caption text via Playwright βœ…
🎯 CTA Detection Engine Keyword-based pattern matching with confidence scoring βœ…
πŸ‘€ Auto Follow Follows creators when required, with daily limits & cooldowns βœ…
πŸ’¬ Auto Comment Posts detected keyword with human-like typing & delays βœ…
πŸ“© DM Monitoring Watches inbox for creator response up to 30 minutes βœ…
πŸ“¦ Resource Extraction Downloads PDFs, links, media, and text from DMs βœ…
πŸ’Ύ Supabase Storage PostgreSQL + file storage as single source of truth βœ…
πŸ“š Notion Sync Auto-creates categorized pages in Notion knowledge base βœ…
πŸ“Š Dashboard Next.js pipeline monitor with analytics & search βœ…
πŸ”„ Retry & Recovery Exponential backoff, checkpointed stages, dead-letter queue βœ…
🩺 Health Monitoring API, Redis, DB, and worker health endpoints βœ…
πŸ” Full-Text Search PostgreSQL GIN index search across captions & resources βœ…
πŸ“‹ Process Logging Every pipeline step audited with error context βœ…

πŸ€– Human-Like Automation

Instant!Q is engineered to behave like a real user:

  • πŸ• Randomized delays between actions (5–30 seconds)
  • ⌨️ Character-by-character typing with 50–150ms per keystroke
  • πŸ”„ Consistent user agent (not random rotation)
  • πŸ“ Realistic viewport sizes
  • πŸ›‘οΈ Daily action limits (configurable follow/comment caps)
  • πŸͺ Persistent session cookies β€” no repeated logins

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         INSTANT!Q ARCHITECTURE                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

  [Admin User]
       β”‚
       β”‚  (1) Shares reel via Instagram app
       β–Ό
  [Instagram App]
       β”‚
       β”‚  Share to DM β†’ @collector_account
       β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚              GOOGLE CLOUD VM (Ubuntu)               β”‚
  β”‚                                                     β”‚
  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
  β”‚  β”‚  DM Listener    β”‚    β”‚  Automation Worker   β”‚   β”‚
  β”‚  β”‚  (instagrapi)   │───▢│  (Playwright)        β”‚   β”‚
  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
  β”‚                                    β”‚               β”‚
  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
  β”‚  β”‚              Redis Queue (RQ)               β”‚  β”‚
  β”‚  β”‚  reel_queue / comment_queue / notion_queue   β”‚  β”‚
  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”‚β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                       β”‚
                                       β”‚ HTTP
                                       β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚              RAILWAY (FastAPI Backend)              β”‚
  β”‚                                                     β”‚
  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”‚
  β”‚  β”‚ Reels    β”‚ β”‚Resources β”‚ β”‚Analytics β”‚           β”‚
  β”‚  β”‚ Router   β”‚ β”‚ Router   β”‚ β”‚ Router   β”‚           β”‚
  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β–Ό               β–Ό               β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚  Supabase    β”‚ β”‚  Supabase   β”‚ β”‚  Notion API  β”‚
  β”‚  PostgreSQL  β”‚ β”‚  Storage    β”‚ β”‚  Dashboard   β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β–²
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  β–Ό
  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
  β”‚              VERCEL (Next.js 14 Frontend)           β”‚
  β”‚                                                     β”‚
  β”‚  Dashboard / History / Resources / Logs / Search   β”‚
  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“ Project Structure

instantiq/
β”‚
β”œβ”€β”€ 🐍 backend/                    # FastAPI REST API
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ main.py               # Application entry point
β”‚   β”‚   β”œβ”€β”€ config.py             # Pydantic settings
β”‚   β”‚   β”œβ”€β”€ database.py           # SQLAlchemy async engine
β”‚   β”‚   β”œβ”€β”€ models/               # SQLAlchemy ORM models
β”‚   β”‚   β”‚   β”œβ”€β”€ reel.py           #   ↳ Reel records
β”‚   β”‚   β”‚   β”œβ”€β”€ dm_resource.py    #   ↳ Extracted resources
β”‚   β”‚   β”‚   β”œβ”€β”€ creator_relationship.py  #   ↳ Follow tracking
β”‚   β”‚   β”‚   └── process_log.py    #   ↳ Pipeline audit trail
β”‚   β”‚   β”œβ”€β”€ routers/              # API route handlers
β”‚   β”‚   β”‚   β”œβ”€β”€ reels.py          #   ↳ CRUD + pipeline control
β”‚   β”‚   β”‚   β”œβ”€β”€ resources.py      #   ↳ DM resource management
β”‚   β”‚   β”‚   β”œβ”€β”€ creators.py       #   ↳ Creator relationships
β”‚   β”‚   β”‚   β”œβ”€β”€ analytics.py      #   ↳ Dashboard analytics
β”‚   β”‚   β”‚   β”œβ”€β”€ search.py         #   ↳ Full-text search
β”‚   β”‚   β”‚   β”œβ”€β”€ logs.py           #   ↳ Process log viewer
β”‚   β”‚   β”‚   └── health.py         #   ↳ Health checks
β”‚   β”‚   β”œβ”€β”€ schemas/              # Pydantic request/response
β”‚   β”‚   β”œβ”€β”€ services/             # Business logic
β”‚   β”‚   β”‚   β”œβ”€β”€ notion_service.py #   ↳ Notion API integration
β”‚   β”‚   β”‚   └── supabase_service.py  #   ↳ Storage operations
β”‚   β”‚   └── queue/                # Redis queue client
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ requirements.txt
β”‚   └── .env.example
β”‚
β”œβ”€β”€ πŸ€– automation/                 # Instagram automation workers
β”‚   β”œβ”€β”€ instagram/                # Core automation modules
β”‚   β”‚   β”œβ”€β”€ session.py            #   ↳ Playwright session mgmt
β”‚   β”‚   β”œβ”€β”€ cta_detector.py       #   ↳ CTA pattern matching
β”‚   β”‚   β”œβ”€β”€ comment_agent.py      #   ↳ Comment automation
β”‚   β”‚   β”œβ”€β”€ follow_agent.py       #   ↳ Follow automation
β”‚   β”‚   β”œβ”€β”€ dm_harvester.py       #   ↳ DM resource extraction
β”‚   β”‚   β”œβ”€β”€ dm_reader.py          #   ↳ DM content parsing
β”‚   β”‚   └── utils.py              #   ↳ Human-like delay utils
β”‚   β”œβ”€β”€ workers/                  # Background job workers
β”‚   β”‚   β”œβ”€β”€ dm_listener_worker.py #   ↳ Inbox polling (instagrapi)
β”‚   β”‚   β”œβ”€β”€ reel_worker.py        #   ↳ Full pipeline processor
β”‚   β”‚   β”œβ”€β”€ notion_sync_worker.py #   ↳ Supabase β†’ Notion sync
β”‚   β”‚   └── base_worker.py        #   ↳ Shared worker utilities
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ requirements.txt
β”‚   └── .env.example
β”‚
β”œβ”€β”€ 🎨 frontend/                   # Next.js 14 dashboard
β”‚   β”œβ”€β”€ src/app/
β”‚   β”‚   β”œβ”€β”€ page.tsx              # Main dashboard page
β”‚   β”‚   β”œβ”€β”€ layout.tsx            # Root layout
β”‚   β”‚   └── globals.css           # Global styles
β”‚   β”œβ”€β”€ package.json
β”‚   └── tailwind.config.ts
β”‚
β”œβ”€β”€ πŸ“œ scripts/                    # Setup & utility scripts
β”‚   └── create_session.py        # Instagram session creator
β”‚
β”œβ”€β”€ 🐳 docker-compose.yml         # Full-stack orchestration
β”œβ”€β”€ πŸ“‹ PRD.md                      # Product Requirements Document
β”œβ”€β”€ πŸ› οΈ TECH_STACK.md              # Technology decisions & rationale
β”œβ”€β”€ πŸ“ APP_FLOW.md                 # Detailed pipeline flow docs
β”œβ”€β”€ πŸ—οΈ BACKEND_STRUCTURE.md       # Backend architecture docs
β”œβ”€β”€ 🎨 FRONTEND_GUIDELINES.md     # Frontend conventions
└── πŸ“„ .gitignore

βš™οΈ Tech Stack

Layer Technology Purpose
Frontend Next.js TypeScript Tailwind Pipeline dashboard & analytics
Backend API FastAPI Python REST API, business logic, queue management
Automation Playwright Instagrapi Browser automation & Instagram API
Database Supabase PostgreSQL Primary data store + file storage
ORM SQLAlchemy Async database operations
Queue Redis RQ Job queue with RQ workers
Knowledge Base Notion Resource browsing & organization
Containers Docker Local dev & production orchestration
Deployment Vercel Railway GCP Frontend, API, and worker hosting

πŸš€ Getting Started

Prerequisites

Requirement Version Check
Python 3.12+ python --version
Node.js 20+ node --version
Docker & Docker Compose 26+ docker --version
Git Latest git --version

External Services Required:

  • 🟒 Supabase account (free tier)
  • πŸ”΄ Redis (self-hosted via Docker or Upstash)
  • ⬛ Notion integration token
  • πŸ“Έ Dedicated Instagram collector account

Installation

# 1. Clone the repository
git clone https://github.com/santosh5603/instantIQ.git
cd instantIQ

# 2. Copy environment files
cp backend/.env.example backend/.env
cp automation/.env.example automation/.env

Environment Setup

Backend (backend/.env)

# Application
APP_ENV=development
APP_SECRET_KEY=<random-64-char-string>
API_PORT=8000

# Database (Supabase PostgreSQL)
DATABASE_URL=postgresql+asyncpg://postgres:<password>@db.<project>.supabase.co:5432/postgres
DATABASE_POOL_SIZE=5

# Redis
REDIS_URL=redis://localhost:6379/0

# Supabase
SUPABASE_URL=https://<project>.supabase.co
SUPABASE_ANON_KEY=<your-anon-key>
SUPABASE_SERVICE_KEY=<your-service-key>
SUPABASE_STORAGE_BUCKET=instantiq-resources

# Instagram Collector Account
INSTAGRAM_USERNAME=<collector_username>
INSTAGRAM_PASSWORD=<collector_password>
INSTAGRAM_SESSION_PATH=session/instagram_session.json

# Notion
NOTION_API_KEY=secret_<your-token>
NOTION_RESOURCES_DB_ID=<database-id>

# Worker Constraints
MAX_DAILY_FOLLOWS=10
FOLLOW_COOLDOWN_SECONDS=300
COMMENT_DELAY_MIN=10
COMMENT_DELAY_MAX=30
DM_POLL_INTERVAL_MIN=45
DM_POLL_INTERVAL_MAX=90
DM_MAX_WAIT_MINUTES=30

Automation (automation/.env)

REDIS_URL=redis://localhost:6379/0
SUPABASE_URL=https://<project>.supabase.co
SUPABASE_ANON_KEY=<your-anon-key>
SUPABASE_SERVICE_KEY=<your-service-key>
INSTAGRAM_USERNAME=<collector_username>
INSTAGRAM_PASSWORD=<collector_password>
INSTAGRAM_SESSION_PATH=session/instagram_session.json

Running with Docker

Recommended β€” This is the simplest way to get all services running.

# Build and start all services
docker compose up --build -d

# Verify services are running
docker compose ps

# View logs
docker compose logs -f

# Stop services
docker compose down
🐳 Services started by Docker Compose
Service Container Port Description
api instantiq-api 8000 FastAPI backend
dm-listener instantiq-dm-listener β€” DM inbox poller
worker-rq instantiq-rq-worker β€” Reel pipeline processor
worker-notion-sync instantiq-notion-sync β€” Notion sync worker
rq-dashboard instantiq-rq-dashboard 9181 Queue monitoring UI
redis instantiq-redis 6379 Message queue

Manual Setup

Click to expand manual setup instructions

Backend

cd backend

# Create virtual environment
python -m venv .venv
source .venv/bin/activate   # Linux/Mac
.venv\Scripts\activate      # Windows

# Install dependencies
pip install -r requirements.txt

# Run the FastAPI server
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload

Automation Workers

cd automation

# Create virtual environment
python -m venv .venv
source .venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Install Playwright browsers
playwright install chromium

# Create Instagram session (one-time)
python manual_login.py

# Start workers (in separate terminals)
python -m workers.dm_listener_worker
python -m workers.reel_worker
python -m workers.notion_sync_worker

Frontend

cd frontend

# Install dependencies
npm install

# Start development server
npm run dev

Redis

# Using Docker
docker run -d --name instantiq-redis -p 6379:6379 redis:7-alpine

Instagram Session Setup

The collector account needs a one-time manual login:

# Navigate to automation directory
cd automation

# Run the session creator
python manual_login.py
  1. A browser window opens β†’ manually log in to your collector account
  2. Complete 2FA if prompted
  3. Session is saved to session/instagram_session.json
  4. All future worker runs reuse this session automatically

⚠️ Important: Keep the session file secure. It contains your collector account's authentication cookies.


πŸ”§ Configuration

Worker Behavior Tuning

Variable Default Description
MAX_DAILY_FOLLOWS 10 Max follow actions per day
FOLLOW_COOLDOWN_SECONDS 300 Min seconds between follows
COMMENT_DELAY_MIN 10 Min seconds before commenting
COMMENT_DELAY_MAX 30 Max seconds before commenting
DM_POLL_INTERVAL_MIN 45 Min seconds between DM checks
DM_POLL_INTERVAL_MAX 90 Max seconds between DM checks
DM_MAX_WAIT_MINUTES 30 Max wait time for creator DM

Notion Database Schema

Create a Notion database with these properties:

Property Type Values
Name Title Auto-generated
Category Select AI, Career, Programming, Fitness, Communication, Other
Resource Type Select Link, PDF, Text, Media
URL URL Resource link
Creator Text Instagram username
Caption Text First 200 chars
Status Select Unread, Reading, Done, Archived
Received At Date Auto-set
Source Reel URL Original reel link

πŸ“‘ API Reference

The backend exposes a RESTful API with auto-generated Swagger documentation.

πŸ“– Interactive Docs:  http://localhost:8000/docs
πŸ“‹ ReDoc:             http://localhost:8000/redoc

Core Endpoints

Method Endpoint Description
GET /health System health (API, DB, Redis)
GET /health/worker Worker heartbeat status
GET /health/queue Redis queue depths
GET /api/reels List all processed reels
GET /api/reels/{id} Get reel details + timeline
POST /api/reels/reprocess/{id} Retry a failed reel
GET /api/resources List extracted resources
GET /api/resources/{id} Get resource details
GET /api/creators List creator relationships
GET /api/creators/{name} Get creator profile
GET /api/search?q=<query> Full-text search
GET /api/analytics Dashboard metrics
GET /api/logs Process audit trail

πŸ”„ Pipeline Flow

Every reel goes through a deterministic, checkpointed pipeline:

stateDiagram-v2
    [*] --> PENDING: Reel detected
    PENDING --> EXTRACTING_CAPTION: Worker picks up

    EXTRACTING_CAPTION --> CTA_DETECTED: CTA found
    EXTRACTING_CAPTION --> NO_CTA: No CTA in caption

    CTA_DETECTED --> AWAITING_FOLLOW: Follow required
    CTA_DETECTED --> AWAITING_COMMENT: Comment only

    AWAITING_FOLLOW --> FOLLOWING: Execute follow
    FOLLOWING --> AWAITING_COMMENT: Follow success

    AWAITING_COMMENT --> COMMENTING: Execute comment
    COMMENTING --> COMMENTED: Comment posted

    COMMENTED --> WAITING_DM: Monitor inbox
    WAITING_DM --> DM_RECEIVED: Creator responded
    WAITING_DM --> DM_TIMEOUT: 30 min exceeded

    DM_RECEIVED --> EXTRACTING_RESOURCE: Process content
    EXTRACTING_RESOURCE --> COMPLETED: Resource saved βœ…

    NO_CTA --> COMPLETED: Stored (no action needed)
    DM_TIMEOUT --> COMPLETED: Logged

    COMMENTING --> RETRYING: Error (retryable)
    FOLLOWING --> RETRYING: Error (retryable)
    RETRYING --> AWAITING_COMMENT: Retry attempt
    RETRYING --> FAILED: Max attempts ❌
Loading

Pipeline Stages

Stage Code Description
PENDING P Reel detected and queued
EXTRACTING_CAPTION EC Playwright opening reel URL
CTA_DETECTED CD Call-to-action found in caption
NO_CTA NC No CTA, reel stored as-is
AWAITING_FOLLOW AF Follow action queued
COMMENTING CM Comment being posted
WAITING_DM WD Monitoring for creator response
COMPLETED βœ… Resource stored & Notion synced
FAILED ❌ Unrecoverable error after retries

πŸ§ͺ Testing

# Backend API health check
curl http://localhost:8000/health

# Queue status
curl http://localhost:8000/health/queue

# RQ Dashboard (queue monitoring)
open http://localhost:9181

πŸ—ΊοΈ Roadmap

timeline
    title Instant!Q Development Roadmap
    section V1 β€” MVP βœ…
        Core Pipeline : DM detection, CTA matching, auto-comment
        Storage Layer : Supabase PostgreSQL + file storage
        Knowledge Base : Notion sync with categories
        Dashboard : Next.js pipeline monitor
    section V2 β€” Intelligence
        AI Summarization : GPT-4o-mini caption summaries
        Semantic Search : pgvector embeddings
        Smart Categories : AI-powered auto-categorization
        Quality Scoring : Resource relevance scoring
    section V3 β€” Platforms
        TikTok : TikTok reel support
        YouTube Shorts : Shorts pipeline
        LinkedIn : Carousel content extraction
    section V4 β€” Interface
        Custom Dashboard : Replace Notion with Next.js UI
        Browser Extension : One-click reel submission
        Mobile App : React Native companion
Loading

🀝 Contributing

Contributions are welcome! Please read the contribution guidelines before getting started.

How to Contribute

# 1. Fork the repository
# 2. Create a feature branch
git checkout -b feature/amazing-feature

# 3. Make your changes and commit
git commit -m "feat: add amazing feature"

# 4. Push to your fork
git push origin feature/amazing-feature

# 5. Open a Pull Request

Commit Convention

This project follows Conventional Commits:

Prefix Use Case
feat: New feature
fix: Bug fix
docs: Documentation only
refactor: Code change (no feature/fix)
test: Adding tests
chore: Build process or tooling

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


⚠️ Disclaimer

This project is a personal automation tool built for educational purposes.

  • Automated interactions with Instagram violate Instagram's Terms of Service
  • This tool is designed for single-user, personal use only β€” not spam or commercial automation
  • The developer assumes no responsibility for account restrictions or bans resulting from use
  • Use at your own risk with full awareness of platform ToS implications
  • No data from other users is collected, stored, or processed


Built with ❀️ by Santosh


Stars Forks Watchers


If this project saved you time, consider giving it a ⭐

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors