Skip to content

ZaidAlvi786/leadhawk

Repository files navigation

πŸ¦… LeadHawk

AI Sales Intelligence Platform

Lead generation, multi-channel outreach, CRM, and analytics β€” unified with AI.

Next.js TypeScript Tailwind CSS Zustand Supabase Gemini License

Features β€’ Architecture β€’ Quick Start β€’ Tech Stack β€’ Modules β€’ Deploy


🎯 What is LeadHawk?

LeadHawk is a production-grade SaaS platform that consolidates a B2B founder's outbound workflow into one AI-driven cockpit. Instead of juggling LinkedIn, Sales Navigator, email tools, a CRM, and an analytics dashboard, LeadHawk fuses all of it into seven tightly integrated modules powered by Google Gemini (with OpenRouter fallback).

Why it exists: Founders and solo sellers waste hours context-switching between tools. LeadHawk replaces that fragmentation with a single, AI-first surface for prospecting, outreach, social growth, and pipeline management.


✨ Features

🎯 Lead Intelligence

  • AI-generated Sales Navigator filters from plain-English ICP
  • 9-archetype lead briefs (founder, CEO, sales leader, etc.)
  • Personalized hooks + pain points per archetype
  • 4-tone outreach message generator

πŸ“± LinkedIn Growth

  • 6 post types (thought leadership, case study, tips, story, poll, engagement)
  • AI trending topics with 48-hour TTL cache + trend scores
  • 4 / 8 / 12-week growth strategy plans
  • One-click composer pre-fill

🐦 X / Twitter Growth

  • Single tweet + thread + reply generation
  • Full thread builder (hook β†’ setup β†’ insights β†’ CTA)
  • 280-char enforcement with live counter
  • Dedicated Twitter growth plans

πŸ’Ό Sales Pipeline (CRM)

  • 7-stage Kanban (new β†’ contacted β†’ replied β†’ meeting β†’ proposal β†’ won/lost)
  • Sequence deep linking β€” auto-trigger email sequences on "contacted"
  • Bulk CSV import with validation + error recovery
  • Daily Action Queue β€” smart follow-ups + meeting prep
  • AI next-action suggestions

πŸ“§ Email Sequences

  • Multi-step sequences (intro β†’ value-add β†’ follow-up β†’ breakup)
  • Auto-triggered when leads move to "contacted"
  • Per-step subject, body, and delay configuration

πŸ“Š Analytics & Templates

  • KPIs: Sent, Replies, Reply Rate, Meetings
  • Channel breakdown (LinkedIn / Email / Twitter)
  • Reusable template library with variables {name}, {company}, {role}
  • Response & open-rate tracking per template

πŸ—οΈ Architecture

LeadHawk is organized around 7 first-class modules, each with its own page, components, and store slice β€” all unified by a shared AI router and Zustand state.

graph TB
    User[πŸ‘€ User] --> Sidebar[🧭 Sidebar Navigation]

    Sidebar --> M1[🎯 Leads]
    Sidebar --> M2[πŸ“± LinkedIn Growth]
    Sidebar --> M3[🐦 X / Twitter Growth]
    Sidebar --> M4[πŸ“§ Email Sequences]
    Sidebar --> M5[πŸ’Ό Pipeline / CRM]
    Sidebar --> M6[πŸ“Š Analytics]
    Sidebar --> M7[πŸ“š Templates]

    M1 --> Store[(Zustand Store<br/>+ localStorage)]
    M2 --> Store
    M3 --> Store
    M4 --> Store
    M5 --> Store
    M6 --> Store
    M7 --> Store

    M1 --> AI[πŸ€– /api/ai]
    M2 --> AI
    M3 --> AI
    M4 --> AI
    M5 --> AI

    AI --> Gemini[Google Gemini 2.5]
    AI -.fallback.-> OpenRouter[OpenRouter Models]

    Store --> LS[(Browser localStorage)]
    User --> Auth[πŸ” Supabase Auth]
Loading

Data Flow

Page  β†’  Component  β†’  Zustand action  β†’  localStorage
                  β†˜
                    /api/ai  β†’  Gemini  β†’  (fallback) OpenRouter

🧩 The 7 Modules

# Module Route Purpose
1 Leads /leads Filter builder + archetype-based lead briefs + outreach generation
2 LinkedIn Growth /linkedin-growth Trending topics + post generation + growth plans
3 X / Twitter Growth /twitter-growth Tweets, threads, and Twitter growth plans
4 Email Sequences /sequences Multi-step cold email sequences with auto-trigger
5 Pipeline /pipeline Kanban CRM, bulk import, daily action queue, sequence linking
6 Analytics /analytics Reply rates, meetings, channel performance
7 Templates /templates Reusable, variable-aware message library

πŸ”§ Tech Stack

Frontend

  • Next.js 14 (Pages Router)
  • React 18 + TypeScript 5.4
  • Tailwind CSS 3.4
  • Radix UI primitives
  • Framer Motion
  • Lucide icons
  • react-hot-toast

State & Data

  • Zustand 4.5 (+ persist)
  • Browser localStorage
  • Supabase (auth)
  • TypeScript-first data models

AI & Tooling

  • Google Gemini 2.5 Flash (primary)
  • OpenRouter (fallback, model cycling)
  • Vitest 4 (unit testing)
  • ESLint + Next lint
  • Custom JSON extractor

πŸš€ Quick Start

1. Install

git clone <repo-url>
cd leadhawk
npm install

2. Configure environment

Create .env.local:

# Recommended (free tier, generous limits)
GOOGLE_API_KEY=your_gemini_key_here

# Optional fallback (free model cycling)
OPENROUTER_API_KEY=your_openrouter_key_here
OPENROUTER_MODELS=openai/gpt-4o-mini,meta-llama/llama-3-70b-instruct

# Optional Supabase auth
NEXT_PUBLIC_SUPABASE_URL=...
NEXT_PUBLIC_SUPABASE_ANON_KEY=...

πŸ”‘ Get keys: Gemini Β· OpenRouter

3. Run

npm run dev        # β†’ http://localhost:3000
npm run build      # production build
npm start          # serve production build
npm run lint       # eslint
npm test           # vitest

πŸ“‚ Project Structure

leadhawk/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ api/ai.ts              # AI router: Gemini β†’ OpenRouter fallback
β”‚   β”‚   β”œβ”€β”€ index.tsx              # App shell + page routing
β”‚   β”‚   β”œβ”€β”€ leads.tsx              # Module 1
β”‚   β”‚   β”œβ”€β”€ linkedin-growth.tsx    # Module 2
β”‚   β”‚   β”œβ”€β”€ twitter-growth.tsx     # Module 3
β”‚   β”‚   β”œβ”€β”€ sequences.tsx          # Module 4
β”‚   β”‚   β”œβ”€β”€ pipeline.tsx           # Module 5
β”‚   β”‚   β”œβ”€β”€ analytics.tsx          # Module 6
β”‚   β”‚   └── templates.tsx          # Module 7
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ layout/                # Sidebar, Header
β”‚   β”‚   β”œβ”€β”€ leads/                 # FilterBuilder, BriefGenerator, MessageGen
β”‚   β”‚   β”œβ”€β”€ linkedin/              # PostGenerator, GrowthPlan
β”‚   β”‚   β”œβ”€β”€ twitter/               # TweetGen, ThreadBuilder, GrowthPlan
β”‚   β”‚   β”œβ”€β”€ pipeline/              # SequenceDialog, ProgressDisplay, BulkImport, DailyQueue
β”‚   β”‚   └── shared/                # ProfileSetup
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ types.ts               # Single source of truth for data shapes
β”‚   β”‚   β”œβ”€β”€ store.ts               # Zustand global state + persistence
β”‚   β”‚   β”œβ”€β”€ ai.ts                  # AI generation functions + JSON extractor
β”‚   β”‚   β”œβ”€β”€ archetypes.ts          # 9 lead archetype profiles
β”‚   β”‚   β”œβ”€β”€ topicEngine.ts         # Trending topics + 48h TTL
β”‚   β”‚   β”œβ”€β”€ auth.tsx               # Supabase auth context
β”‚   β”‚   └── supabase.ts            # Supabase client
β”‚   └── styles/globals.css         # Design tokens + utility classes
β”œβ”€β”€ supabase/                      # Supabase config + migrations
β”œβ”€β”€ CLAUDE.md                      # AI development guide
β”œβ”€β”€ PROJECT_OVERVIEW.md            # Full project documentation
└── USER_GUIDE.md                  # End-user manual

🧠 AI Provider Architecture

LeadHawk uses an automatic fallback AI router at src/pages/api/ai.ts:

  1. Google Gemini (primary) β€” gemini-2.5-flash, JSON mode supported
  2. OpenRouter (fallback) β€” cycles through configured models on failure
  3. Returns detailed, actionable errors when both fail

All client code calls a single callAI(system, user, opts) interface from src/lib/ai.ts, and a robust extractJSON() helper handles markdown fences, leading prose, and partial wrapping returned by models.


🎨 Design System

  • Theme: Dark-first SaaS aesthetic (#0b1020 base, #1e293b cards)
  • Brand colors: hawk-* (indigo), accent-* (cyan, emerald, amber, rose)
  • Fonts: Syne (display), DM Sans (body), JetBrains Mono (code)
  • Animations: fade-in, slide-up, pulse-slow, shimmer
  • Shadows: glow-indigo, glow-cyan, card-hover

πŸ”‘ Environment Variables

Variable Required Purpose
GOOGLE_API_KEY βœ…* Google Gemini API key
OPENROUTER_API_KEY βœ…* OpenRouter fallback API key
GOOGLE_MODEL β€” Gemini model ID (default: gemini-2.5-flash)
OPENROUTER_MODELS β€” Comma-separated OpenRouter model list
OPENROUTER_MAX_TOKENS β€” Token cap for OpenRouter (default: 800)
NEXT_PUBLIC_SUPABASE_URL β€” Supabase project URL (auth)
NEXT_PUBLIC_SUPABASE_ANON_KEY β€” Supabase anon key (auth)
NEXT_PUBLIC_APP_URL β€” App URL for OpenRouter referer header
NEXT_PUBLIC_APP_NAME β€” App name for OpenRouter referer header

* At least one AI provider key is required.


πŸ—ΊοΈ Roadmap (Build Phases)

Phase Feature Status
1 Lead Intelligence Engine (9 archetypes) βœ…
2 Trending Topics Engine (48h TTL) βœ…
3 X / Twitter Module (tweets + threads + plans) βœ…
4 Analytics Dashboard βœ…
5 Pipeline Sequence Deep Linking βœ…
6 Money Features (Bulk Import + Daily Queue + Templates) βœ…
7 Polish, QA & Type-safety pass βœ…
8 Supabase migrations & sync scaffolding βœ…

πŸš€ Deployment

Recommended: Vercel (zero-config for Next.js).

npm install -g vercel
vercel

Then add your environment variables in Vercel β†’ Project β†’ Settings β†’ Environment Variables.

Any host that supports Next.js 14 (Netlify, Render, self-hosted Node) will also work.


⚠️ Known Considerations

  • localStorage limits β€” large datasets may approach browser quotas; production should sync to Supabase DB
  • AI cost β€” Gemini free tier can rate-limit; OpenRouter free models also have caps
  • Sales Navigator β€” requires an active LinkedIn Sales Navigator subscription
  • Trending topics β€” auto-expire after 48 hours; refresh manually before expiry
  • Sequence trigger β€” auto-dialog fires on transition to "contacted" only; manual linking always available

See CLAUDE.md for the full list and architectural notes.


πŸ“š Further Reading


Built with Next.js Β· TypeScript Β· Tailwind Β· Gemini

If LeadHawk helped you ship more outbound, drop a ⭐ on the repo.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors