How henryrpa73-byte/ai-leads-hunter works
Ai Leads Hunter is a construction-lead intelligence platform with a web application and an optional Python CLI. Its main workflow discovers public permit and federal-award records, normalizes and deduplicates leads, enriches company contacts, scores and tracks outreach, and supports CRM sync and exports. The web backend manages discovery jobs and persists data in SQLite; local Ollama adds AI assistance, with documented deterministic fallbacks. Some frontend-to-API and Python runtime links are only lightly evidenced, so those relationships are omitted or marked unverified.
Main entry points: App.tsx Web dashboard · server.ts HTTP API · discovery_usaspending.py Python discovery agents · leadEngine.ts Normalize and dedupe
Components 28
Lead workspace
- Web dashboard
src/App.tsx - Lead details
src/components/LeadDetailPanel.tsx - Discovery jobs
src/components/DiscoveryJobsPanel.tsx - Duplicate review
src/components/DuplicatesReviewView.tsx - Daily reports
src/components/DailyReportView.tsx - Quota tracking
src/lib/dailyQuota.ts - CRM sync
src/lib/crmSync.ts
Lead qualification
- Scoring controls
src/components/AutomatedScoringEngine.tsx - Normalize and dedupe
src/lib/leadEngine.ts - Trade classification
src/lib/trades.ts - Lead data model
src/types/lead.ts
Discovery backend
- HTTP API
server.ts - Job manager
server/jobManager.ts - Permit discovery
server/connectors/permits.ts - Federal awards
server/connectors/usaspending.ts - Website contacts
server/connectors/websiteResearch.ts - Local AI service
server/ollama.ts
Persistence and security
- SQLite database
server/db.ts - Public-fetch safeguards
server/security.ts
Python CLI
- Optional Python CLI
lead_hunter/src/cli.py - Python discovery agents
lead_hunter/src/agents/discovery_usaspending.py - Python lead model
lead_hunter/src/models.py - Python normalizer
lead_hunter/src/normalizer.py - Python validator
lead_hunter/src/validator.py - Python SQLite store
lead_hunter/src/database.py
Other components
- Lead operator
- Public data portals
- Local Ollama
Connections 36
- Lead operator → Web dashboard: uses
- Web dashboard → Lead details: renders
src/App.tsx - Web dashboard → Discovery jobs: renders
src/App.tsx - Web dashboard → Duplicate review: renders
src/App.tsx - Web dashboard → Daily reports: renders
src/App.tsx - Web dashboard → Scoring controls: renders
src/App.tsx - Web dashboard → Normalize and dedupe: imports
src/App.tsx - Web dashboard → Quota tracking: uses
src/App.tsx - Lead details → Normalize and dedupe: uses
src/components/LeadDetailPanel.tsx - Scoring controls → Normalize and dedupe: uses
src/components/AutomatedScoringEngine.tsx - Normalize and dedupe → Trade classification: classifies with
src/lib/leadEngine.ts - CRM sync → Normalize and dedupe: normalizes with
src/lib/crmSync.ts - Web dashboard → CRM sync: syncs leads
- Web dashboard → HTTP API: requests
- HTTP API → Job manager: dispatches
server.ts - HTTP API → SQLite database: reads and writes
server.ts - HTTP API → Federal awards: calls
server.ts - HTTP API → Website contacts: calls
server.ts - HTTP API → Local AI service: calls
server.ts - Job manager → SQLite database: updates jobs
server/jobManager.ts - Job manager → Permit discovery: discovers permits
server/jobManager.ts - Job manager → Federal awards: discovers awards
server/jobManager.ts - Permit discovery → Public-fetch safeguards: fetches through
server/connectors/permits.ts - Federal awards → Public-fetch safeguards: uses
server/connectors/usaspending.ts - Website contacts → Public-fetch safeguards: uses
server/connectors/websiteResearch.ts - Permit discovery → Public data portals: queries
- Federal awards → Public data portals: queries
- Website contacts → Public data portals: researches websites
- Local AI service → Local Ollama: connects locally
- Lead operator → Optional Python CLI: runs optionally
- Optional Python CLI → Python discovery agents: invokes
lead_hunter/src/cli.py - Python discovery agents → Python normalizer: normalizes via
lead_hunter/src/agents/discovery_usaspending.py - Python discovery agents → Python validator: validates via
lead_hunter/src/agents/discovery_usaspending.py - Python discovery agents → Python SQLite store: persists via
lead_hunter/src/agents/discovery_usaspending.py - Python discovery agents → Python lead model: creates records
lead_hunter/src/agents/discovery_usaspending.py - Python SQLite store → Python lead model: stores records
lead_hunter/src/database.py