Skip to content

InstaFlow is an AI-powered Instagram management platform that helps users automate their Instagram activities using an intelligent agent. The application enables scheduling posts, analyzing engagement metrics, and leveraging AI to make data-driven decisions for Instagram content strategy.

Notifications You must be signed in to change notification settings

NP5555/InstaFlow

Repository files navigation

InstaFlow

InstaFlow is an AI-powered Instagram management platform that helps users automate their Instagram activities using an intelligent agent. The application enables scheduling posts, analyzing engagement metrics, and leveraging AI to make data-driven decisions for Instagram content strategy.

Features

  • AI Agent Configuration: Set goals and personality for your AI agent to guide its decision-making
  • Content Scheduler: Plan and schedule Instagram posts, videos, and stories
  • Analytics Dashboard: Track follower growth, engagement metrics, and content performance
  • Action Logs: Monitor all activities performed by the AI agent
  • Secure Authentication: Login with email/password and securely store Instagram credentials

Tech Stack

  • Frontend: Next.js 14 with App Router, React, Tailwind CSS
  • Backend: Next.js API Routes
  • Database: Supabase (PostgreSQL)
  • Authentication: Supabase Auth
  • Instagram API: Instagram Private API
  • Charts: Chart.js
  • AI Decision Engine: Custom GAME framework implementation

Getting Started

Prerequisites

  • Node.js 18.x or higher
  • npm or yarn
  • Supabase account
  • Instagram account for testing

Environment Setup

  1. Clone the repository
git clone https://github.com/yourusername/instaflow.git
cd instaflow
  1. Install dependencies
npm install
  1. Create a .env.local file in the project root with the following variables:
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_KEY=your-supabase-anon-key
SUPABASE_SERVICE_ROLE_KEY=your-supabase-service-role-key

# Instagram API (for development)
INSTAGRAM_USERNAME=your-test-username
INSTAGRAM_PASSWORD=your-test-password

# Server Configuration
PORT=3000

Database Setup

  1. Create the following tables in your Supabase project:

Users Table

CREATE TABLE users (
  user_id UUID PRIMARY KEY REFERENCES auth.users(id),
  email TEXT NOT NULL,
  instagram_credentials JSONB,
  created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);

Agent Configurations Table

CREATE TABLE agent_configurations (
  config_id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
  user_id UUID REFERENCES users(user_id) NOT NULL,
  goals JSONB,
  personality JSONB
);

Content Schedule Table

CREATE TABLE content_schedule (
  schedule_id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
  user_id UUID REFERENCES users(user_id) NOT NULL,
  content_type TEXT NOT NULL,
  media_url TEXT,
  caption TEXT,
  scheduled_time TIMESTAMP WITH TIME ZONE NOT NULL
);

Action Logs Table

CREATE TABLE action_logs (
  log_id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
  user_id UUID REFERENCES users(user_id) NOT NULL,
  action_type TEXT NOT NULL,
  action_data JSONB,
  timestamp TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
  outcome JSONB
);

Running the Application

  1. Start the development server
npm run dev
  1. Open your browser and navigate to http://localhost:3000

Project Structure

InstaFlow/
├── app/
│   ├── auth/
│   │   ├── page.jsx         # Login/Signup page
│   ├── dashboard/
│   │   ├── config/
│   │   │   ├── page.jsx     # Agent configuration
│   │   ├── schedule/
│   │   │   ├── page.jsx     # Content scheduler
│   │   ├── analytics/
│   │   │   ├── page.jsx     # Analytics dashboard
│   │   ├── logs/
│   │   │   ├── page.jsx     # Action log viewer
│   │   ├── layout.jsx       # Dashboard layout with navigation
│   │   ├── page.jsx         # Dashboard home page
│   ├── page.jsx             # Home page (redirects to auth or dashboard)
│   ├── api/
│   │   ├── auth/[...]/route.js  # Supabase auth routes
│   │   ├── config/route.js      # Agent config CRUD
│   │   ├── schedule/route.js    # Content schedule CRUD
│   │   ├── actions/route.js     # Execute AI actions
│   │   ├── analytics/route.js   # Fetch analytics data
│   ├── layout.jsx           # Root layout with Tailwind CSS
├── components/              # Reusable React components
├── lib/
│   ├── supabase.js          # Supabase client initialization
│   ├── instagram.js         # Instagram API client
│   ├── game.js              # Mock GAME framework
├── public/                  # Static assets
├── middleware.js            # Next.js middleware for auth protection
├── package.json             # Dependencies
├── tailwind.config.js       # Tailwind CSS configuration
├── next.config.js           # Next.js configuration
├── README.md                # Project documentation

Deployment

The application is designed to be deployed on Vercel:

vercel

License

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

Acknowledgments

  • Instagram Private API for Instagram integration
  • Supabase for authentication and database
  • Next.js team for the amazing framework
  • Tailwind CSS for styling

About

InstaFlow is an AI-powered Instagram management platform that helps users automate their Instagram activities using an intelligent agent. The application enables scheduling posts, analyzing engagement metrics, and leveraging AI to make data-driven decisions for Instagram content strategy.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published