{"id":30880035,"url":"https://github.com/nascript/leadgen","last_synced_at":"2026-05-08T19:33:21.087Z","repository":{"id":310861816,"uuid":"1041530003","full_name":"nascript/leadgen","owner":"nascript","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-20T16:26:54.000Z","size":1192,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-08T06:21:09.351Z","etag":null,"topics":["leadgen","leadgeneration","nextjs","scraping","tailwindcss","typescript"],"latest_commit_sha":null,"homepage":"https://leadgen-seven.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nascript.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-20T16:11:19.000Z","updated_at":"2025-08-20T16:26:57.000Z","dependencies_parsed_at":"2025-08-20T18:36:44.340Z","dependency_job_id":"5b79ea46-a8a4-4d98-82fa-32a48d4e9a5f","html_url":"https://github.com/nascript/leadgen","commit_stats":null,"previous_names":["nascript/leadgen"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nascript/leadgen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nascript%2Fleadgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nascript%2Fleadgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nascript%2Fleadgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nascript%2Fleadgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nascript","download_url":"https://codeload.github.com/nascript/leadgen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nascript%2Fleadgen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32794715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["leadgen","leadgeneration","nextjs","scraping","tailwindcss","typescript"],"created_at":"2025-09-08T06:11:16.568Z","updated_at":"2026-05-08T19:33:21.072Z","avatar_url":"https://github.com/nascript.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI-Readiness LeadGen Prototype — 5-Hour Report (Detailed)\n\n**Objective \u0026 Business Rationale**\nSales teams waste time on bad or duplicate contacts. Under a strict 5-hour cap, I prioritized **lead quality** (to cut bounce and save SDR time) and **throughput** (to process more lists fast). The product outputs a **clean, validated, de-duplicated, and scored** list that’s ready for CRM via one-click export.\n\n---\n\n#### Application Screenshots\n\n**Main Dashboard with Lead Generation Interface**\n![Lead Generation Dashboard](1.png)\n\n**Lead Results Table with Filtering and Export Options**\n![Lead Results Table](2.png)\n\n## What I Built (Dual Approach)\n\n### 1) Quality-First (depth on data quality)\n\n* **Validation:** Email **format check** (regex) + **DNS MX lookup** (deliverability signal).\n* **Deduplication:** By `email` (fallback: `domain+name`).\n* **Scoring (rule-based):** Boost **senior roles** (Founder/CEO/VP Sales/Head of Growth), **good TLDs** (`.com`, `.io`, `.ai`), and **non-generic** mailboxes; penalize flags.\n* **Smart Filters:** Senior roles only; Good TLDs; free-text search; sortable table.\n* **Analytics:** Total leads, Valid (format), No-MX count, Duplicates, **Average Score**.\n* **Export:** **Filtered CSV** (or All) for instant SDR handoff.\n\n### 2) Quantity-Driven (breadth via mini-utilities)\n\n* **URL List Checker:** Single **HEAD/GET** per URL (robots-friendly), parse title/meta, extract `mailto:`; then run the same quality pipeline.\n* **CSV Header Mapper \u0026 Normalizer:** Align arbitrary headers to the canonical schema; trim/lowercase; flag missing columns.\n* **Saved Filter Presets:** e.g., *Decision Makers + Good TLDs* for repeatable targeting.\n* **Quick Stats Generator:** Batch KPIs (valid %, no-MX %, dupes removed) for easy reporting.\n\n---\n\n## Lead Generation Methods (3 Inputs)\n\n### A) Keyword / Company Search\n\n* **Input:** Sector/company keywords (e.g., “SaaS startup, fintech, AI tools”).\n* **Behavior:** Seed candidate domains (demo/mock or user-provided), then **Normalize → Validate (format+MX) → Dedup → Score → Filter → Export**.\n* **Best for:** Early discovery when you don’t yet have a list.\n\n**API sketch**\n\n```http\nPOST /api/scrape\n{ \"keyword\": \"SaaS startup, fintech\" }\n→ { \"leads\": [ { \"name\": \"...\", \"company\": \"...\", \"domain\": \"...\", \"email\": \"...\" } ] }\n```\n\n\n### B) URL List\n\n* **Input:** Homepages/profile URLs.\n* **Behavior:** Single-page check (status/title/meta/`mailto:`) → then **Validate, Dedup, Score, Filter, Export**.\n* **Best for:** Fast triage of known companies without aggressive crawling.\n\n**API sketch**\n\n```http\nPOST /api/scrape\n{ \"urls\": [\"https://acme.io\", \"https://contoso.com\"] }\n→ { \"leads\": [ { \"company\": \"Acme\", \"domain\": \"acme.io\", \"email\": \"info@acme.io\" } ] }\n```\n\n### C) CSV Upload\n\n* **Input:** Existing list (emails/domains/names/roles).\n* **Behavior:** **Header Mapper → Normalize → Validate (format+MX) → Dedup → Score → Filter → Export (Filtered/All)**.\n* **Best for:** Quickly cleaning and prioritizing third-party lists.\n\n**Canonical schema**\n\n```\nname | role | company | domain | email | (optional: source, industry, country)\n```\n\n**Quality gates applied to all three:** Validation (regex + MX), Dedup, Scoring, Smart Filters, Export.\n\n---\n\n## Architecture \u0026 Flow\n\n`Input (Keyword/URLs/CSV) → Normalize/Map → Validate (format + MX) → Dedup → Score → Filter/Sort → Export CSV`\n\n* Single **Next.js + TypeScript** app (UI + API Routes) for rapid demo/deploy.\n* Composable helpers: `validate`, `dedup`, `score`, `export`.\n* MX used as a **deliverability signal**; SMTP ping intentionally omitted for speed and ethics.\n\n**Data model**\n\n```ts\n{ name?, role?, company?, domain?, email?, source?, industry?, score?, flags?: string[] }\n```\n\n`flags`: `invalid_format`, `no_mx`, `duplicate`.\n\n---\n\n## UX \u0026 Product Decisions\n\n* **Health cards**: Total, Valid (format), No-MX, Duplicates, Avg Score (with % bars).\n* **Inline badges** next to emails: `Valid`, `MX`.\n* **Smart Filters**: Senior roles, Good TLDs, free-text; column sorting.\n* **Export Filtered**: Keeps SDRs focused on the highest-intent subset.\n* **(Optional)** Saved presets for one-click repeatability.\n\n---\n\n## Functional Evaluation (demo dataset from screenshots)\n\n* **9 total leads**, **Valid (format): 9 = 100%**, **No-MX: 4 (44.4%)**, **Duplicates: 0**, **Avg Score: 74/100**.\n* **Time-to-CSV:** seconds for \\~100–300 rows.\n* **Outcome:** Cleaner lists, clearer prioritization, and faster handoff to outreach.\n\n---\n\n## Ethical Notes \u0026 Limits\n\n* No aggressive crawling; uses user-provided inputs and single-page checks (respect **ToS/robots**).\n* MX is strong but not definitive; SMTP validation is **out of scope** for this sprint.\n* No CAPTCHA/anti-bot handling (can be added later with rate-limits/rotations).\n\n---\n\n## Next Steps\n\n1. Optional SMTP verification (rate-limited) + bounce learning loop.\n2. Open-source enrichment (industry/location) for better scoring.\n3. Direct CRM exporters (HubSpot/Pipedrive) \u0026 webhooks.\n4. Scoring calibration using reply/bounce labels over time.\n\n---\n\n## Tech \u0026 Links\n\n* **Stack:** Next.js, TypeScript, DNS MX check, CSV util.\n* **GitHub:** *\u003cadd repository URL\u003e*\n* **Demo Video (1–2 min):** *\u003cadd link\u003e*\n\n\u003e Design choice: **Quality-First** increases conversion efficiency; **Quantity-Driven** adds lightweight utilities to maximize usable output—together delivering immediate sales impact within a 5-hour build.\n\n\n\n---\n---\n\n\n# Lead Generation Application\n\nA modern, AI-powered lead generation application built with Next.js, TypeScript, and Tailwind CSS. This application allows users to scrape, validate, deduplicate, filter, and export leads with an intuitive and beautiful user interface.\n\n## Features\n\n### Core Functionality\n- **Web Scraping**: Extract leads from websites using keywords or specific URLs\n- **CSV Upload**: Import existing lead data from CSV files\n- **Email Validation**: Comprehensive email validation including format checking and MX record verification\n- **Lead Scoring**: AI-powered scoring system to rank lead quality\n- **Deduplication**: Automatic removal of duplicate leads based on email addresses\n- **Advanced Filtering**: Filter leads by status, score, company, and more\n- **Export**: Export filtered leads to CSV format\n\n### User Interface\n- **Modern Design**: Clean, responsive interface with gradient backgrounds and smooth animations\n- **Real-time Stats**: Live statistics showing lead quality metrics\n- **Interactive Tables**: Sortable and filterable lead tables with bulk actions\n- **Smart Filters**: Expandable filter panel with search and quick filters\n- **Loading States**: Beautiful loading indicators and error handling\n\n## Tech Stack\n\n- **Framework**: Next.js 14 with App Router\n- **Language**: TypeScript\n- **Styling**: Tailwind CSS\n- **UI Components**: Custom components with Heroicons\n- **State Management**: React hooks (useState, useCallback)\n- **API**: Next.js API routes\n- **Email Validation**: Custom validation with DNS MX record checking\n\n## Installation\n\n1. **Clone the repository**\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd leadgen\n   ```\n\n2. **Install dependencies**\n   ```bash\n   npm install\n   ```\n\n3. **Run the development server**\n   ```bash\n   npm run dev\n   ```\n\n4. **Open your browser**\n   Navigate to [http://localhost:3000](http://localhost:3000)\n\n## Usage\n\n### 1. Generate Leads\n- **Keyword Search**: Enter keywords to scrape leads from various sources\n- **URL Scraping**: Provide specific URLs to extract contact information\n- **CSV Upload**: Upload existing lead data in CSV format with drag and drop support\n\n### 2. Lead Processing\nThe application automatically processes leads through the following pipeline:\n1. **Scraping/Import**: Collect lead data from various sources\n2. **Validation**: Verify email addresses and check MX records\n3. **Scoring**: Calculate lead quality scores based on multiple factors\n4. **Deduplication**: Remove duplicate entries based on email addresses\n\n### 3. Lead Management\n- **View Statistics**: Monitor lead quality metrics in real-time\n- **Apply Filters**: Use advanced filters to find specific leads\n- **Sort Data**: Sort leads by name, company, email, score, or date\n- **Bulk Actions**: Select multiple leads for bulk operations\n\n### 4. Export Data\n- **CSV Export**: Export filtered leads to CSV format\n- **Automatic Naming**: Files are automatically named with timestamps\n- **UTF-8 Encoding**: Proper encoding for international characters\n\n## Project Structure\n\n```\nsrc/\n├── app/\n│   ├── api/\n│   │   ├── scrape/route.ts      # Lead scraping API\n│   │   ├── validate/route.ts    # Email validation API\n│   │   ├── dedup/route.ts       # Deduplication API\n│   │   └── export/route.ts      # Export API\n│   ├── globals.css              # Global styles\n│   ├── layout.tsx               # Root layout\n│   └── page.tsx                 # Main application page\n├── components/\n│   ├── UploadArea.tsx           # Data input component\n│   ├── QuickStats.tsx           # Statistics display\n│   ├── FiltersBar.tsx           # Filtering interface\n│   └── LeadTable.tsx            # Lead data table\n├── lib/\n│   ├── email.ts                 # Email validation utilities\n│   ├── scoring.ts               # Lead scoring algorithms\n│   ├── csv.ts                   # CSV processing utilities\n│   └── utils.ts                 # General utilities\n└── types/\n    └── lead.ts                  # TypeScript type definitions\n```\n\n## API Endpoints\n\n### POST /api/scrape\nScrape leads from keywords or URLs\n```json\n{\n  \"keyword\": \"software company\",\n  \"urls\": [\"https://example.com\"]\n}\n```\n\n### POST /api/validate\nValidate email addresses and check MX records\n```json\n{\n  \"leads\": [/* array of lead objects */]\n}\n```\n\n### POST /api/dedup\nRemove duplicate leads\n```json\n{\n  \"leads\": [/* array of lead objects */],\n  \"key\": \"email\"\n}\n```\n\n### POST /api/export\nExport leads to CSV format\n```json\n{\n  \"leads\": [/* array of lead objects */],\n  \"format\": \"csv\"\n}\n```\n\n## Styling\n\nThe application uses Tailwind CSS for styling with:\n- **Gradient Backgrounds**: Beautiful gradient overlays\n- **Smooth Animations**: Hover effects and transitions\n- **Responsive Design**: Mobile-first responsive layout\n- **Modern Components**: Clean, professional interface elements\n- **Color Coding**: Visual indicators for lead quality and status\n\n## Testing\n\nThe application includes:\n- **Mock Data Generation**: Realistic test data for development\n- **Error Handling**: Comprehensive error states and messages\n- **Loading States**: Proper loading indicators throughout the app\n- **Edge Case Handling**: Validation for empty states and invalid inputs\n\n## Deployment\n\nThe application is ready for deployment on Vercel:\n\n1. **Connect to Vercel**\n   ```bash\n   vercel\n   ```\n\n2. **Configure Environment**\n   - No additional environment variables required for basic functionality\n   - Add any API keys for real web scraping services if needed\n\n3. **Deploy**\n   ```bash\n   vercel --prod\n   ```\n\n## Future Enhancements\n\n- **Real Web Scraping**: Integration with actual web scraping services\n- **XLSX Export**: Support for Excel file format\n- **Email Templates**: Lead outreach email templates\n- **CRM Integration**: Connect with popular CRM systems\n- **Advanced Analytics**: Detailed lead analytics and reporting\n- **Team Collaboration**: Multi-user support and sharing\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnascript%2Fleadgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnascript%2Fleadgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnascript%2Fleadgen/lists"}