CODESTER EXCLUSIVE V1.0.0

MarketingGPT

The Ultimate AI SaaS for Marketing Intelligence & Analytics

1. Introduction

Welcome to MarketingGPT, a premium SaaS solution built for modern agencies and digital marketers. This platform combines the power of multiple AI engines (Gemini, OpenAI, Anthropic) with real-time marketing tool integrations via Integration Partner MCP.

Key Features:

  • Multi-LLM Support (Auto-failover and manual selection)
  • Live Marketing Tool execution (FB Ads, Google Analytics, etc.)
  • Full Subscription & Credit System (Razorpay Integrated)
  • Clean, Premium Admin Dashboard
  • Highly secure (SQLi protected, JWT Session management)

2. Server Requirements

RequirementMinimumRecommended
Node.jsv18.xv20.x+ (LTS)
DatabaseMySQL 8.0+PostgreSQL or MySQL
RAM1 GB2 GB+
OSLinux/UbuntuUbuntu 22.04+ (Recommended)
MySQL Configlower_case_table_names=0Case-sensitive (Linux Standard)

3. Installation Guide

Extract Package: Unzip the Source Code.zip file to your server root.
Database Setup:

Create a new MySQL database (e.g., marketing_gpt_db) and import the database.sql file provided in the root folder.

mysql -u your_username -p your_database_name < database.sql
Environment Setup:

Copy .env.example to .env in both backend and frontend folders.

cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env
Install Dependencies:
# In the root folder
npm install
cd backend && npm install
cd ../frontend && npm install
Build & Run:
# Start Backend
cd backend && npm run start

# Build Frontend
cd frontend && npm run build
npm run start

4. Configuration & Admin

Admin Credentials

Default Login: admin@example.com / Admin@123

After logging in, immediately change your credentials in the Settings panel.

Essential Environment Variables

To ensure the application works perfectly, you MUST update the backend/.env file with your specific service credentials. While many settings can be managed via the Admin Dashboard, the following core variables are required for initial setup:

CategoryRequired Variables
AI Engines GEMINI_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY
Google Auth GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, ENABLE_GOOGLE_AUTH=true
Email (SMTP) SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS (Required for Password Resets)
Security JWT_SECRET (Min 32 chars), FRONTEND_URL (e.g., http://localhost:3000)
Payments RAZORPAY_KEY_ID, RAZORPAY_KEY_SECRET, RAZORPAY_WEBHOOK_SECRET
Integrations VIASOCKET_ORG_ID, VIASOCKET_PROJECT_ID, VIASOCKET_ACCESS_KEY

Note on Social Login: For Google Login to function, you must configure the Google Cloud Console with your FRONTEND_URL and provide the Client ID in the .env file.

Admin Dashboard priority: Settings managed directly through the Admin Dashboard (Settings tab) will override the defaults provided in the .env file, allowing you to update keys without restarting the server.

Note on Integrations: Each user provides their own Tool Cluster MCP Cluster URL directly in the Integrations Hub. Users can access a comprehensive Connection Guide directly within the application to help her obtain their cluster URL.

5. MCP Tools Integration Guide

MarketingGPT uses the Model Context Protocol (MCP) via Integration Partner Tool Cluster to connect your AI directly to live marketing data. This allows the AI to perform actions like creating spreadsheets, analyzing Google Ads, or managing Shopify products.

How to Get Your Cluster URL:

Sign up at Integration Partner: Follow the link provided in the In-App Connection Guide and navigate to the Tool Cluster section.
Create a Cluster: Create a new MCP Cluster and add the apps you want to connect (e.g., Google Sheets, Facebook Ads).
Copy Cluster URL: Once your apps are authorized in Tool Cluster, copy the provided Cluster URL.
Connect in MarketingGPT: Go to the Integrations Hub in your dashboard, paste the URL, and click Connect.

Pro Tip: Once connected, use the Sync Hub button to automatically discover all available tools. Your AI will instantly be able to use these tools in the Chat Studio.

6. Premium Data Scrapers (Apify)

MarketingGPT features an integrated **Premium Data Scraper** engine powered by Apify. This allows users to extract real-time data from platforms like LinkedIn, Amazon, and Google Maps directly within the chat.

Admin Configuration:

  • Apify API Token: Obtain your API token from the Apify Console.
  • Setup: Go to the **Admin Dashboard > Settings** and save your token in the DATA_SCRAPER_API_KEY field.

How it Works:

Pro Subscription: Data scrapers are gated behind the **Pro Rental Plan**. The system checks the user's Subscription status before allowing tool execution.
AI Tool Calling: When a user asks for data (e.g., "Scrape LinkedIn jobs in London"), the AI identifies the request and triggers an **Apify Actor** via the scraperService.
Live Progress: The backend polls Apify for status updates and streams real-time progress (e.g., "Extracting records... 20s elapsed") back to the user's chat UI via Server-Sent Events (SSE).

7. Project Structure & Build

MarketingGPT is built with a modern decoupled architecture for maximum performance and scalability.

ComponentTechnology Stack
FrontendNext.js 16 (App Router), React, Lucide Icons, Framer Motion
BackendNode.js, Express, Sequelize ORM (MySQL), JWT Authentication
AI EngineGoogle Gemini (Primary), OpenAI, Anthropic, OpenRouter
DatabaseMySQL 8.0 (Case-Sensitive on Linux)
StylingCustom CSS Variables (Modern Dark Mode System)

Building from Source:

# Build Frontend Production Bundle
cd frontend
npm run build
npm run start

# Run Backend with PM2
cd backend
pm2 start src/server.js --name "backend-api"

8. Credits & Third-Party

This project uses the following open-source libraries and assets:

  • Next.js: The React Framework for the Web.
  • Express: Fast, unopinionated, minimalist web framework for Node.js.
  • Sequelize: Modern TypeScript and Node.js ORM.
  • Lucide Icons: Beautiful & consistent icons.
  • Framer Motion: Production-ready animation library for React.

6. Troubleshooting FAQ

Database connection failed?

Ensure your MySQL/PostgreSQL server is running and the credentials in backend/.env are correct.

AI responses are empty?

Check if your Gemini or OpenAI API keys are active and have sufficient quota.

Chat Studio shows 'Unknown column role'?

This happens if you are upgrading from an older version. The ChatHistories table schema has changed. You should backup and delete your existing ChatHistories table, and let the application recreate it automatically on the next restart.

Emoji support (🎉) failing?

Ensure your MySQL database and ChatHistories table are using the utf8mb4 character set. You can run: ALTER TABLE ChatHistories CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

'Table not found' errors on Linux?

Linux servers are case-sensitive. MarketingGPT uses PascalCase for tables (e.g., Users, Recipes). If you manually created tables in lowercase, please rename them to match the PascalCase models provided in the source code.