flowchart TB
subgraph Frontend["π Next.js 16 Frontend"]
direction TB
LP["π Landing Page<br/>Pricing Β· FAQ Β· Testimonials"]
AUTH["π Auth Pages<br/>Login Β· Register Β· Verify"]
DASH["π Dashboard<br/>Metrics Β· Charts Β· KPIs"]
CM["π’ Campaigns<br/>CRUD Β· Detail Β· Import"]
AN["π Analytics<br/>Charts Β· Filters Β· Export"]
CS["π¨ Creative Studio<br/>AI Copy Β· History"]
CP["π¬ AI Copilot<br/>Chat Β· Models"]
AT["β‘ Automation<br/>Rules Β· Triggers"]
RP["π Reports<br/>Generate Β· PDF"]
INT["π Integrations<br/>Platforms Β· Status"]
ADM["π‘οΈ Admin Panel<br/>Users Β· Billing Β· Settings"]
end
subgraph API["βοΈ API Layer"]
direction TB
API_AUTH["π Auth API<br/>JWT Β· bcrypt Β· Cookies"]
API_CRM["π Campaign API<br/>CRUD Β· Search Β· Import"]
API_AI["π€ AI API<br/>OpenRouter Β· Ollama Β· LM Studio"]
API_AN["π Analytics API"]
API_RP["π Reports API<br/>jsPDF Generation"]
API_AT["β‘ Automation API"]
API_BL["π³ Billing API<br/>Plans Β· Transactions"]
API_ADM["π‘οΈ Admin API<br/>Stats Β· Users Β· Updates"]
end
subgraph DB["ποΈ Data Layer"]
direction TB
DB_PRISMA["Prisma 7 ORM"]
DB_SQLITE["SQLite Database"]
DB_MOCK["π¦ Mock Data Layer<br/>8 Campaigns Β· Users Β· Charts"]
end
Frontend --> API
API --> DB
DB --> DB_PRISMA --> DB_SQLITE
DB_PRISMA -.-> DB_MOCK
API_AI --> AI_PROVIDERS
subgraph AI_PROVIDERS["π§ AI Providers"]
OR["OpenRouter<br/>GPT-4o-mini"]
OL["Ollama<br/>Local"]
LMS["LM Studio<br/>Local"]
end
style Frontend fill:#1a1a2e,stroke:#7C3AED,stroke-width:2px
style API fill:#16213e,stroke:#00F5FF,stroke-width:2px
style DB fill:#0f3460,stroke:#FF00E5,stroke-width:2px
style AI_PROVIDERS fill:#1a1a2e,stroke:#7C3AED,stroke-width:1px
flowchart LR
subgraph AUTH["π Auth Flow"]
REG["Register"] --> VERIFY["Verify Email"]
LOGIN["Login"] --> JWT["JWT Token<br/>httpOnly Cookie"]
JWT --> API_ACCESS["API Access"]
end
subgraph DATA["π Data Flow"]
UI["User Input"] --> MOCK["Mock Service"]
MOCK --> RESP["Response"]
MOCK -.-> DB_FUTURE["Prisma DB<br/>(Coming Soon)"]
end
subgraph PAYMENT["π³ Billing Flow"]
PLAN["Select Plan"] --> TIER["Pricing Tier"]
TIER --> CHECKOUT["Checkout"]
CHECKOUT --> PAYMENT_GW["Payment Gateway<br/>(Stub)"]
PAYMENT_GW --> SUCCESS["Success"]
end
style AUTH fill:#1a1a2e,stroke:#00F5FF
style DATA fill:#1a1a2e,stroke:#7C3AED
style PAYMENT fill:#1a1a2e,stroke:#FF00E5
| Module | Details |
|---|---|
| JWT Auth | bcrypt password hashing, httpOnly cookie sessions |
| Email Verification | Nodemailer-based verification flow |
| Role Management | User / Admin roles with route guards |
| Session Management | Auth context provider, protected API middleware |
| Module | Details |
|---|---|
| π Main Dashboard | 8 KPI cards (Spend, Revenue, ROAS, CPA, CTR, Conversions, Active Campaigns, Budget), area chart (7-day trends), bar chart (campaign comparison), top campaigns table |
| π Campaign List | Search, platform/status badges, CRUD with plan limit enforcement |
| π Campaign Detail | Per-campaign metrics, area chart, info table |
| π Analytics Page | Metric cards, area chart, pie chart (platform breakdown), bar chart (daily performance) |
| Module | Details |
|---|---|
| π€ AI Copilot | Chat interface with conversation history, model selector (GPT-4, GPT-3.5, Claude 3), suggested prompts, markdown rendering |
| π¨ Creative Studio | AI ad copy generator for Google / Meta / TikTok / Taboola β 6 creative types (headline, text, description, CTA, email, landing page) with history |
| π CSV Analysis | Upload CSV β column mapping β AI generates executive summary, wasted spend analysis, opportunities, budget recommendations |
| π Provider System | Pluggable: OpenRouter (default), Ollama (local), LM Studio (local), Custom |
| Module | Details |
|---|---|
| βοΈ Automation Rules | 5 trigger types (ROAS threshold, budget exceeded, CPA spike, CTR drop, schedule) Γ 5 action types (notify, pause campaign, adjust budget, generate report, send email) |
| π Report Generator | 4 templates (Weekly, Monthly, Campaign Summary, Performance Breakdown), PDF download via jsPDF, status tracking |
| π Smart Notifications | Filterable (Success, Warning, Error, Recommendations), mark-as-read |
| Module | Details |
|---|---|
| πͺ Landing Page | Hero, feature highlights, testimonial carousel, FAQ accordion, footer |
| π³ Pricing | 5 tiers: Free, Starter ($9), Professional ($29), Business ($79), Enterprise ($199) |
| π Checkout | Multi-step: country β currency β payment method β processing β success |
| π‘οΈ Admin Panel | Dashboard (user count, revenue, subs), User management, Settings, Changelog, Billing (MRR, ARR, Churn, ARPU, LTV, transactions, subscriptions, coupons) |
| βοΈ Settings | Profile, Workspace, Password, Notifications, Danger Zone tabs |
| Platform | Status |
|---|---|
| Google Ads | π Connection UI + card |
| Meta Ads | π Connection UI + card |
| TikTok Ads | π Connection UI + card |
| Taboola | π Connection UI + card |
| HubSpot | π Connection UI + card |
| Salesforce | π Connection UI + card |
| Shopify | π Connection UI + card |
| Slack | π Connection UI + card |
| Feature | Description |
|---|---|
| π Global Search | Cmd+K modal searching campaigns, reports, messages |
| π― Onboarding Tour | Multi-step interactive tour covering all dashboard features |
| π± Responsive Sidebar | Collapsible navigation with admin link |
| ποΈ Database Schema | 19 Prisma models: User, Workspace, Campaign, Creative, Insight, Recommendation, Conversation, Message, Automation, Report, Integration, Notification, Settings, AuditLog, SiteSettings, UpdateLog, BillingPlan, Subscription, Transaction, Invoice, Refund, Coupon |
| π¦ Mock Data | 8 campaigns across Google / Meta / TikTok / Taboola, mock automations, analytics, conversations, recommendations |
| MODULE | STATUS | UPTIME | LOAD |
|---|---|---|---|
| π’ AI Core | ONLINE |
99.99% | 12% |
| π£ Analytics Engine | ACTIVE |
99.97% | 34% |
| π΅ Campaign Controller | RUNNING |
99.95% | 28% |
| π’ Automation Nexus | ENABLED |
99.99% | 8% |
| π· Database Cluster | CONNECTED |
99.99% | 22% |
| β‘ Intelligence Feed | REAL-TIME |
99.98% | 16% |
hover over icons for a closer look β¦ premium stack for premium results
| Category | Technologies |
|---|---|
| Framework | Next.js 16, React 19, TypeScript 5 |
| Styling | Tailwind CSS 4, Framer Motion, CVA, Lucide Icons |
| Database | Prisma 7, SQLite, Better-SQLite3 |
| Auth | JWT (bcryptjs + httpOnly cookies), Nodemailer |
| Charts | Recharts, date-fns |
| State | Zustand (persisted), TanStack React Query 5 |
| AI | OpenRouter (GPT-4o-mini), Ollama, LM Studio |
| jsPDF | |
| Validation | Zod 4 |
| Deployment | Vercel |
- Node.js 18+
- npm 9+
# Clone the repository
git clone https://github.com/ayushnandi718-dev/adpilot-ai.git
cd adpilot-ai
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Fill in your JWT secret and email credentials
# Initialize the database
npx prisma generate
npx prisma db push
# Seed admin user (optional)
npm run create-admin
# Start the development server
npm run devOpen http://localhost:3000 β your command center awaits.
| Variable | Description | Required |
|---|---|---|
DATABASE_URL |
Database connection string | β |
JWT_SECRET |
JWT signing secret | β |
SMTP_HOST |
Email server host | β»οΈ |
SMTP_PORT |
Email server port | β»οΈ |
SMTP_USER |
Email server user | β»οΈ |
SMTP_PASS |
Email server password | β»οΈ |
OPENROUTER_API_KEY |
OpenRouter API key | β»οΈ |
DEFAULT_AI_PROVIDER |
Default AI provider | β»οΈ |
ADMIN_EMAIL |
Predefined admin login email | β»οΈ |
ADMIN_PASSWORD |
Predefined admin login password | β»οΈ |
|
npm run build
npm start |
src/
βββ app/ # Next.js App Router pages & API routes
β βββ api/ # 30+ REST API endpoints
β βββ auth/ # Login, Register, Verify pages
β βββ dashboard/ # Dashboard, Campaigns, Analytics, etc.
β βββ layout.tsx # Root layout with providers
βββ components/ # Reusable UI components
β βββ ui/ # Base primitives (button, card, modal, etc.)
β βββ layout/ # Sidebar, Header, Shell
β βββ shared/ # Cross-feature shared components
βββ features/ # Feature-specific components & logic
βββ hooks/ # Custom React hooks
βββ services/ # Business logic (campaign, AI, etc.)
βββ repositories/ # Data access layer (Prisma + mock fallback)
βββ store/ # Zustand stores (campaign-store)
βββ providers/ # React context providers (Auth, Query)
βββ lib/ # Utilities, constants, types
βββ mock/ # Development mock data
βββ generated/ # Prisma client output
| Category | Endpoints |
|---|---|
| π Auth | POST login, POST register, POST logout, GET me, GET verify-email, POST send-verification |
| π’ Campaigns | GET all, GET/:id, DELETE/:id, GET search, POST import, POST analyze |
| π€ AI | POST /api/ai (completions), POST /api/copilot (chat) |
| π Analytics | GET /api/analytics |
| π Dashboard | GET /api/dashboard |
| β‘ Automations | GET, POST /api/automations |
| π Reports | GET, POST /api/reports |
| π‘ Recommendations | GET /api/recommendations |
| π Notifications | GET /api/notifications |
| βοΈ Settings | GET, PUT /api/settings |
| π Search | GET /api/search |
| π³ Billing | POST /api/billing/create-payment |
| π‘οΈ Admin | GET stats, Users CRUD, Settings CRUD, Updates CRUD, Billing management |
We're actively looking for contributors! Here's how you can help:
| Area | Ideas |
|---|---|
| π§ AI Features | More ad copy generators, A/B test predictions, sentiment analysis |
| π Integrations | Real Google/Meta/TikTok API connectors (instead of stubs) |
| π³ Payments | Wire up Stripe, PayPal, Razorpay webhooks |
| π Analytics | Export to CSV/PDF, custom date ranges, real-time dashboards |
| β‘ Automation | Background job runner, Slack/email notifications |
| π¨ UI/UX | Dark mode variants, mobile polish, animations |
| π Bug Fixes | Check the Issues tab |
| π Docs | Improve API docs, add usage examples |
# Fork & clone
git clone https://github.com/your-username/adpilot-ai.git
cd adpilot-ai
# Install
npm install
# Create branch
git checkout -b feature/your-feature-name
# Make changes & commit
git commit -m "feat: add your feature description"
# Push & open a PR
git push origin feature/your-feature-name- Keep PRs focused β one feature/fix per PR
- Follow existing code style (TypeScript, Tailwind, no comments)
- Test your changes with
npm run lintandnpx tsc --noEmit - Update the README if your change affects usage
- Be kind and constructive in code reviews
All skill levels welcome. If you're new to open source, we're here to help you through your first PR! π
ai-marketing nextjs react typescript prisma sqlite tailwind-css jwt-auth saas marketing-intelligence ad-copy-generator campaign-management analytics-dashboard openrouter framer-motion zustand react-query recharts
Click the π·οΈ Topics button at the top of the repo to add these tags on GitHub.
ββββββββββββββββββββββββββββββββββββββββββββββ
β‘ SYSTEM ONLINE β’ π§ AI CORE ACTIVE β’ π NEURAL LINK ESTABLISHED β‘
ββββββββββββββββββββββββββββββββββββββββββββββ
crafted with π©· β where data meets design
made by AYUSH NANDI β ayushnandi718@gmail.com