AI-Powered Ad Campaign Orchestration Platform
Autonomously generate, test, and optimize advertising creatives powered by local AI (Ollama) and a multi-agent orchestration loop.
| 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 |
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
- 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# 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 installOpen 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 devOpen http://localhost:3000 π
- Navigate to Campaigns β New Campaign Goal
- Fill in your landing page URL, target ROAS, daily budget, and business context
- Click "Proceed to Generative AI" then "Start Generation"
- 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
- 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.
- 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
- 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
- OllamaAgent β Auto-detects best available local model (
llama3,mistral,phi3,gemma2, etc.) - Graceful fallback β App stays functional even when Ollama is offline
| 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 |
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!






