Skip to main content
Safdar.
HomeAboutProjectsBlogContact
Resume
Safdar.

AI Engineer & Full Stack Developer building intelligent systems.

Quick Links

  • Home
  • About
  • Projects
  • Blog
  • Contact
  • Privacy Policy

Connect

safdarayub@gmail.com

Kohat District, KP, Pakistan

© 2026 Safdar Ayub. All rights reserved.RSS Feed
  1. Home
  2. Projects
  3. Campaign Manager
Back to Projects
Full Stack

Campaign Manager — Full-Stack CRM Dashboard

A CRM prototype with contacts CRUD, audience segmentation rule builder, multi-step campaign wizard, and analytics dashboard — powered by Prisma and Turso.

Last updated April 2026

View on GitHubLive Site

Overview

A full-stack CRM dashboard prototype demonstrating contacts management, audience segmentation, and campaign workflows. The dashboard features real-time KPI cards, lifecycle stage analytics, and campaign performance charts — all rendered server-side for zero client-side data waterfalls.

Built with Next.js 16 App Router, Prisma v7 with a dual adapter pattern (SQLite for local dev, Turso LibSQL for production), and ShadCN UI components. Every API route is Zod-validated with input bounds and column whitelisting.

Key Features

  • Dashboard with KPI cards and Recharts analytics (server component, no waterfalls)
  • Contacts data table with server-side search, filtering, sorting, and pagination
  • Visual segment rule builder with AND logic and live preview (debounced 300ms)
  • 3-step campaign wizard: Select Audience → Compose Message → Review & Send
  • Full CRUD operations via modal dialogs
  • Send simulation with realistic open/click statistics

Architecture Highlights

  • Prisma v7 dual adapter — better-sqlite3 locally, libsql for Turso in production
  • Shared buildWhereClause function keeps segment filtering DRY across APIs
  • Route group (app) pattern for shared sidebar layout without URL pollution
  • Recharts loaded via next/dynamic with ssr: false to avoid hydration mismatches
  • Zod validation on all API routes with whitelisted sort columns and capped page size
  • Seed data: 55 contacts, 4 segments, 5 campaigns
Tech Stack
Next.js 16TypeScriptTailwind CSSShadCN UIPrismaTursoZodRecharts

Interested in similar work?

I build AI agents, full-stack applications, and cloud-native systems. Let's discuss your next project.

Get in Touch

Other Projects

CareerCoach Pakistan screenshot
Platinum TierSaaS Products
CareerCoach Pakistan

Full-stack SaaS — paste a job description, answer 10 AI-generated questions in English or Urdu, and get instant scored feedback. Subscription billing, Google auth, transactional email, and analytics included.

Next.js 16SupabaseStripeGroq AIResend
View DetailsGitHub
Personal AI Employee screenshot
Platinum TierAI Agents
Personal AI Employee

A 24/7 autonomous AI agent that monitors Gmail, WhatsApp, and filesystem — drafts responses on a cloud VM while you're offline, then executes with your approval when you reconnect.

PythonFastMCPClaude CodeGmail OAuth2Playwright
View DetailsGitHub
AI/ML Job Market Intelligence Pipeline screenshot
ML Pipelines
AI/ML Job Market Intelligence Pipeline

End-to-end ML pipeline that scrapes RemoteOK, clusters jobs with K-Means + TF-IDF, classifies seniority across 3 models, generates LLM market insights via Groq LLaMA 3.3 70B, and pushes automated reports to Google Sheets — all from one API call.

Pythonscikit-learnFastAPIPostgreSQLGroq API
View DetailsGitHub