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.
- 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
- 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
- Node.js 18.x or higher
- npm or yarn
- Supabase account
- Instagram account for testing
- Clone the repository
git clone https://github.com/yourusername/instaflow.git
cd instaflow
- Install dependencies
npm install
- 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
- 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
);
- Start the development server
npm run dev
- Open your browser and navigate to
http://localhost:3000
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
The application is designed to be deployed on Vercel:
vercel
This project is licensed under the MIT License - see the LICENSE file for details.
- Instagram Private API for Instagram integration
- Supabase for authentication and database
- Next.js team for the amazing framework
- Tailwind CSS for styling