Skip to content

the-shadow-0/AdOptimizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

48 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ AdOptimizer

AI-Powered Ad Campaign Orchestration Platform

Autonomously generate, test, and optimize advertising creatives powered by local AI (Ollama) and a multi-agent orchestration loop.


πŸ“Š Executive Dashboard

Executive Dashboard

🎯 Campaign Goals

Campaign Goals

πŸ€– AI Campaign Wizard

AI Campaign Wizard

πŸ§ͺ Active Experiments

Active Experiments

πŸ‘₯ Audience Intelligence

Audience Intelligence

🎨 Creative Studio

Creative Studio

βš™οΈ Platform Settings

Platform Settings


✨ Features

Feature Description
πŸ€– Ollama AI Integration Local LLM generation via Ollama (llama3, mistral, etc.) β€” no API keys needed
🎯 Campaign Orchestrator Multi-step AI wizard that generates ad creatives, audiences, and campaign goals
πŸ§ͺ A/B Experiment Engine Granular split-test management across Meta, Google, and TikTok ad accounts
πŸ‘₯ Audience Intelligence AI-driven audience clustering and lookalike discovery
🎨 Creative Studio AI-generated ad creatives with persistent database storage
πŸ“Š Executive Dashboard Real-time ROAS velocity charts and live agent decision feed
βš™οΈ Persistent Settings Workspace name, timezone, currency, and user profile β€” all saved to the database
πŸ”’ Secure by Design Helmet.js, CORS middleware, and environment-based config

πŸ—οΈ Project Structure

AdOptimizer/
β”œβ”€β”€ web/                    # ⚑ Next.js 16 Frontend (Turbopack)
β”‚   β”œβ”€β”€ src/app/            # App Router pages
β”‚   └── next.config.ts      # API proxy rewrites β†’ localhost:8080
β”œβ”€β”€ api/                    # πŸš€ Node.js + Express Backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ controllers/    # API route handlers
β”‚   β”‚   β”œβ”€β”€ services/       # OllamaAgent, CreativeAgent
β”‚   β”‚   └── index.ts        # Express server entry
β”‚   └── prisma/             # SQLite schema & migrations
β”œβ”€β”€ docs/                   # πŸ“š Documentation & assets
β”‚   └── assets/             # App screenshots
└── README.md

πŸš€ Getting Started

Prerequisites

  • Node.js v18+
  • pnpm (recommended) or npm
  • Ollama running locally with at least one model pulled
# Install Ollama and pull a model
ollama pull llama3

Installation

# 1. Clone the repository
git clone https://github.com/the-shadow-0/AdOptimizer.git
cd AdOptimizer

# 2. Install API dependencies
cd api && pnpm install

# 3. Set up the database
pnpm exec prisma db push
npx ts-node prisma/seed.ts

# 4. Install Web dependencies
cd ../web && pnpm install

Running the Application

Open two terminals:

# Terminal 1 β€” Start the API backend (port 8080)
cd api && pnpm run dev

# Terminal 2 β€” Start the Next.js frontend (port 3000)
cd web && pnpm run dev

Open http://localhost:3000 πŸŽ‰


πŸ€– AI Campaign Generation

  1. Navigate to Campaigns β†’ New Campaign Goal
  2. Fill in your landing page URL, target ROAS, daily budget, and business context
  3. Click "Proceed to Generative AI" then "Start Generation"
  4. The Ollama agent will generate:
    • 🎨 3 unique ad creative variants with headlines and copy
    • πŸ‘₯ 3 audience segments for targeting
    • πŸ“‹ 1 campaign goal record saved to the database
  5. Generated creatives appear in Creative Studio immediately

πŸ’‘ Note: Make sure Ollama is running (ollama serve) and a model is available before starting generation. The system will use the best available model automatically.


πŸ”§ Tech Stack

Frontend

  • Next.js 16 with Turbopack
  • TypeScript β€” full type safety
  • Tailwind CSS β€” utility-first styling
  • Framer Motion β€” smooth page animations
  • Recharts β€” data visualizations
  • React Hot Toast β€” elegant notifications

Backend

  • Express.js β€” REST API server
  • Prisma ORM β€” type-safe database access
  • SQLite (via @prisma/adapter-better-sqlite3) β€” lightweight, zero-config database
  • Ollama HTTP API β€” local AI model inference

AI Layer

  • OllamaAgent β€” Auto-detects best available local model (llama3, mistral, phi3, gemma2, etc.)
  • Graceful fallback β€” App stays functional even when Ollama is offline

πŸ—ΊοΈ API Endpoints

Method Endpoint Description
GET /api/v1/workspace Get workspace info
PUT /api/v1/workspace/settings Update workspace name, timezone, currency
GET /api/v1/user Get current user profile
PUT /api/v1/user Update name, email, avatar initials
GET /api/v1/campaigns List campaign goals
POST /api/v1/campaigns/orchestrate Launch AI orchestration job
GET /api/v1/campaigns/orchestrate/:jobId Poll job status
GET /api/v1/experiments List A/B experiments
GET /api/v1/audiences List audience segments
GET /api/v1/creatives List generated creatives

πŸ“„ License

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


Built with ❀️ by the-shadow-0

⭐ Star this repo if you find it useful!

Releases

No releases published

Sponsor this project

 

Packages

 
 
 

Contributors

Languages