Skip to content

A comprehensive SaaS platform that provides AI-powered marketing agents to help businesses create, optimize, and manage their marketing content.

Notifications You must be signed in to change notification settings

Yupsecous/AI-Agent-Lovable

Repository files navigation

AI Agent Platform

A comprehensive SaaS platform that provides AI-powered marketing agents to help businesses create, optimize, and manage their marketing content. The platform features multiple specialized AI agents for various marketing tasks, integrated with WhatsApp API, and includes a credit-based subscription system.

🚀 Features

AI Marketing Agents

  • Marketing Strategy Agent 🎯 - Get personalized marketing strategies with step-by-step guidance from an AI marketing consultant
  • Marketing Calendar Agent 📅 - Create organized content calendars with strategic timing and themes
  • Post Ideas Agent 💡 - Generate creative and engaging social media post concepts
  • Post Text & Scripts Agent ✍️ - Write compelling copy scripts for your content
  • Image Generation Agent 🎨 - Create stunning visuals and graphics for marketing campaigns
  • SEO Optimization Agent 🔍 - Optimize content and profiles for better search engine visibility

Platform Features

  • User Dashboard - Manage agents, projects, credits, and usage analytics
  • Admin Dashboard - User management, subscription management, credit logs, and reports
  • Credit System - Flexible credit-based usage with multiple purchase options
  • Subscription Plans - Monthly and annual subscription options
  • Project Management - Organize and track your marketing projects
  • WhatsApp Integration - Connect with WhatsApp API for messaging
  • Multi-language Support - Internationalization (i18n) support
  • Dark Mode - Theme switching with light/dark mode support
  • Responsive Design - Modern, mobile-friendly UI built with Tailwind CSS

🛠️ Tech Stack

Frontend

  • Next.js 14 - React framework with App Router
  • TypeScript - Type-safe development
  • Tailwind CSS - Utility-first CSS framework
  • Radix UI - Accessible component primitives
  • Framer Motion - Animation library
  • React Hook Form - Form management
  • Zod - Schema validation

Backend

  • Next.js API Routes - Serverless API endpoints
  • Prisma - Type-safe ORM
  • PostgreSQL - Relational database
  • Supabase - Authentication and backend services

Payments & Integrations

  • Stripe - Payment processing and subscription management
  • OpenAI - AI-powered content generation
  • WhatsApp API - Messaging integration

Additional Libraries

  • i18next - Internationalization
  • React Markdown - Markdown rendering
  • Recharts - Data visualization
  • Date-fns - Date manipulation

📋 Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v18 or higher)
  • npm or yarn or pnpm
  • PostgreSQL database
  • Stripe account (for payments)
  • Supabase account (for authentication)
  • OpenAI API key (for AI features)

🔧 Installation

  1. Clone the repository

    git clone https://github.com/Yupsecous/AI-Agent-Lovable.git
    cd AI-Agent-Lovable
  2. Install dependencies

    npm install
    # or
    yarn install
    # or
    pnpm install
  3. Set up environment variables

    Create a .env.local file in the root directory with the following variables:

    # Database
    DATABASE_URL="postgresql://user:password@localhost:5432/dbname"
    DIRECT_URL="postgresql://user:password@localhost:5432/dbname"
    
    # Supabase
    NEXT_PUBLIC_SUPABASE_URL="your-supabase-url"
    NEXT_PUBLIC_SUPABASE_ANON_KEY="your-supabase-anon-key"
    SUPABASE_SERVICE_ROLE_KEY="your-supabase-service-role-key"
    
    # Stripe
    STRIPE_SECRET_KEY="your-stripe-secret-key"
    NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="your-stripe-publishable-key"
    STRIPE_WEBHOOK_SECRET="your-stripe-webhook-secret"
    
    # OpenAI
    OPENAI_API_KEY="your-openai-api-key"
    
    # Next.js
    NEXTAUTH_URL="http://localhost:3000"
    NEXTAUTH_SECRET="your-nextauth-secret"
  4. Set up the database

    # Generate Prisma Client
    npm run postinstall
    
    # Push schema to database
    npm run db:push
  5. Run the development server

    npm run dev

    The application will be available at http://localhost:3000

📁 Project Structure

AI-Agent-Lovable/
├── prisma/
│   └── schema.prisma          # Database schema
├── public/                     # Static assets
│   └── assets/
│       └── images/
├── src/
│   ├── app/                    # Next.js App Router
│   │   ├── (auth)/            # Authentication routes
│   │   ├── (dashboard)/       # Dashboard routes
│   │   │   ├── admin/         # Admin dashboard
│   │   │   └── user/          # User dashboard
│   │   ├── (home)/            # Home page
│   │   └── api/               # API routes
│   ├── components/            # React components
│   │   ├── agents/           # AI agent components
│   │   ├── auth/             # Authentication components
│   │   ├── layout/           # Layout components
│   │   └── ui/               # UI components
│   ├── core/                 # Core business logic
│   │   ├── admin/           # Admin functions
│   │   ├── agent/           # Agent logic
│   │   ├── auth/            # Authentication
│   │   ├── subscription/    # Subscription management
│   │   └── transaction/     # Transaction handling
│   ├── features/            # Feature modules
│   ├── hooks/               # Custom React hooks
│   ├── lib/                 # Utilities and helpers
│   │   ├── i18n/           # Internationalization
│   │   ├── supabase/       # Supabase client setup
│   │   └── utils/          # Utility functions
│   └── contexts/           # React contexts
└── package.json

🗄️ Database Schema

The application uses PostgreSQL with Prisma ORM. Key models include:

  • profile - User profiles with roles, credits, and subscriptions
  • projects - User marketing projects
  • subscriptions - Subscription records
  • credit_purchases - Credit purchase history
  • tasks_log - Agent task execution logs
  • whatsapp_messages - WhatsApp message history
  • admin_activity_logs - Admin activity tracking

🚀 Available Scripts

  • npm run dev - Start development server on port 3000
  • npm run build - Build the application for production
  • npm run start - Start production server
  • npm run lint - Run TypeScript type checking and ESLint
  • npm run postinstall - Generate Prisma Client
  • npm run db:push - Push Prisma schema to database
  • npm run db:pull - Pull database schema to Prisma

🔐 Authentication

The application uses Supabase for authentication. Users can:

  • Sign up with email and password
  • Sign in to their accounts
  • Manage their profiles and settings

💳 Payments & Subscriptions

Stripe integration handles:

  • Credit purchases (100, 200, 400 credit packs)
  • Subscription plans (Monthly Essential, Annual Professional)
  • Webhook handling for payment events

🤖 AI Agents

Each agent is designed for specific marketing tasks:

  1. Marketing Strategy - Comprehensive marketing strategy development
  2. Marketing Calendar - Content calendar creation and scheduling
  3. Post Ideas - Creative post concept generation
  4. Post Text - Copywriting and script generation
  5. Image Generation - AI-powered image creation
  6. SEO Optimization - Content and profile optimization

🌐 Internationalization

The platform supports multiple languages through i18next. Supported languages include:

  • English (US/GB)
  • Spanish
  • French
  • German
  • Portuguese

🎨 UI Components

Built with Radix UI and Tailwind CSS, the platform includes:

  • Accessible form components
  • Modal dialogs
  • Data tables
  • Charts and visualizations
  • Toast notifications
  • Theme switching

📝 License

This project is private and proprietary.

🤝 Contributing

This is a private project. For questions or support, please contact the repository owner.

📞 Support

For issues, questions, or feature requests, please open an issue in the repository.


Built with ❤️ using Next.js, TypeScript, and modern web technologies.

About

A comprehensive SaaS platform that provides AI-powered marketing agents to help businesses create, optimize, and manage their marketing content.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published