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.

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

Other Projects

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 Video Generation Agent screenshot
AI Agents
AI Video Generation Agent

Type a prompt, get a full 4-minute motion graphics video with narration — completely AI-generated.

TypeScriptReactRemotionClaude CodeGemini TTS
View DetailsGitHub
Flow screenshot
Full Stack
Flow

A todo app that evolved through 8 architectural phases — from console script to Kubernetes-deployed microservice with AI chatbot.

Next.jsFastAPISQLModelDockerKubernetes
View DetailsGitHub