How roshan10k/lead_tool works
Lead Discovery MVP turns exact searches, natural-language goals, or uploaded company lists into enriched, verified leads, then supports fit qualification and outreach tracking. The web client starts and polls jobs through the API; background pipeline stages discover or accept candidates, scrape sites, extract contact details, verify email domains, and persist results. The README documents the major workflows and integrations; source excerpts and the SOURCE INDEX support the shown internal calls, while unsampled details are not inferred.
Main entry points: pipeline.ts Background pipeline · app.ts HTTP API · scrape.ts Website scraping · extract.ts Contact extraction
Components 22
Lead workspace
- Search and lead UI
apps/web/app/page.tsx - Search form
apps/web/components/SearchForm.tsx - Lead views
apps/web/components/LeadGroupDetail.tsx - API client
apps/web/lib/apiSlice.ts
API and jobs
- HTTP API
apps/api/src/app.ts - CSV import parser
apps/api/src/lib/csvImport.ts
Lead processing
- Background pipeline
apps/api/src/services/pipeline.ts - Goal search agent
apps/api/src/services/searchAgent.ts - Business discovery
apps/api/src/services/discovery.ts - Website scraping
apps/api/src/services/scrape.ts - Contact extraction
apps/api/src/services/extract.ts - Structured contact finder
apps/api/src/services/contactFinder.ts - Email verification
apps/api/src/services/verifyEmail.ts - Email plausibility rules
apps/api/src/lib/email.ts
Persistence and qualification
- Lead qualification
apps/api/src/services/qualifyLeads.ts - Database access
apps/api/src/db/client.ts - Lead and job records
apps/api/src/db/schema.ts
Other components
- User
- Serper / DuckDuckGo
- Groq LLM
- Business websites
- DNS
Connections 29
- User → Search and lead UI: uses
- Search and lead UI → Search form: presents
- Search and lead UI → Lead views: presents
- Search form → API client: starts searches
- Lead views → API client: loads lead data
- API client → HTTP API: HTTP requests
apps/web/lib/apiSlice.ts - HTTP API → Background pipeline: starts search jobs
apps/api/src/app.ts - HTTP API → CSV import parser: parses uploaded CSV
apps/api/src/app.ts - HTTP API → Lead qualification: starts qualification
apps/api/src/app.ts - Background pipeline → Goal search agent: plans goal search
apps/api/src/services/pipeline.ts - Goal search agent → Business discovery: tests queries
apps/api/src/services/searchAgent.ts - Background pipeline → Business discovery: finds candidates
apps/api/src/services/pipeline.ts - Business discovery → Serper / DuckDuckGo: queries sources
- Background pipeline → Website scraping: scrapes candidate
apps/api/src/services/pipeline.ts - Website scraping → Business websites: fetches pages
- Background pipeline → Contact extraction: extracts lead
apps/api/src/services/pipeline.ts - Contact extraction → Groq LLM: requests extraction
- Background pipeline → Structured contact finder: finds contact details
apps/api/src/services/pipeline.ts - Structured contact finder → Website scraping: uses scraping
apps/api/src/services/contactFinder.ts - Structured contact finder → Contact extraction: uses extraction
apps/api/src/services/contactFinder.ts - Website scraping → Email plausibility rules: checks page emails
apps/api/src/services/scrape.ts - Contact extraction → Email plausibility rules: filters extracted email
apps/api/src/services/extract.ts - Background pipeline → Email verification: checks email domain
apps/api/src/services/pipeline.ts - Email verification → DNS: looks up mail records
- Background pipeline → Database access: stores lead results
apps/api/src/services/pipeline.ts - Database access → Lead and job records: uses tables
apps/api/src/db/client.ts - Lead qualification → Database access: reads and writes jobs
apps/api/src/services/qualifyLeads.ts - Lead qualification → Groq LLM: judges lead fit
- HTTP API → Database access: serves API records
apps/api/src/app.ts