● Reference · How it fits together
Architecture
what talks to what.
Leadlantern is one Node.js program with one SQLite file. It asks place-data services for businesses, reads their public websites, and sends e-mail through your Resend account only when a person presses Send.
01Diagram
02A search, step by step
- You pick a type of business and an area on Find businesses.
- Place data. With OpenStreetMap, Nominatim turns the area into a boundary and Overpass returns the named businesses inside it. With Google Places, a text search returns up to 60 places for your key.
- Leads. New businesses are saved; ones you already have are refreshed without touching your notes, stage or owner.
- Website check, when you ask for it: robots.txt first, then up to five public pages over https, with size and time limits and no private addresses (Website check).
- Score and draft. The lead is scored for the service you sell; a draft is written from what the check found (Scoring, Messages).
- Send. Only a person's click sends, and only after every rule on Send rules passes.
03Where things are in the source
| Folder or file | What it does |
|---|---|
src/places/, src/search.ts | OpenStreetMap and Google Places, the search and its history |
src/audit.ts, src/score.ts, src/reportpage.ts | Website check, scoring rules per service, the public report page |
src/drafts.ts, src/ai.ts, src/outreach.ts | Drafts, the AI client, the send guard, unsubscribe and do-not-contact |
src/leads.ts, src/db.ts | Leads, notes, tasks, history and the SQLite schema |
src/web/, public/ | Console pages and their JSON API, styles and the small console script |
src/admin/, packages/admin-kit/ | The operator console: settings, encrypted keys, team, roles, audit log, status checks |
src/addons.ts | The interface the separately sold add-ons plug into |
test/ | Automated tests (pnpm test), no network and no real keys |