A safe interview demo for a local hospitality lead engine. It runs with Flask, SQLite, vanilla JavaScript, Tailwind CDN, and seed JSON data. Optional live mode can use external APIs when keys are available.
No API keys are needed for seed mode. This app does not use email sending, auth, Docker, or React.
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
python app.pyOpen http://127.0.0.1:5000.
seed_demo: usesdata/seed_leads.json; works with zero API keys.live_if_available: tries SerpAPI for local business sourcing, Tavily for research, and Gemini/OpenAI/Anthropic for scoring/email drafting. Any failure falls back safely.cached_demo: loads the cached seed demo result.Load cached live demo: loadsdata/cached_live_results.jsoninstantly after a successful live run.
Live mode is capped at 5 leads by default to control speed and cost.
Create a local .env file from .env.example and add keys there. Do not commit .env.
Copy-Item .env.example .envVariables:
SERPAPI_API_KEY: sources real local businesses using SerpAPI Google Maps results.TAVILY_API_KEY: researches each business and returns source URLs.GEMINI_API_KEY: primary LLM scoring and email drafting using Gemini 2.5 Flash.OPENAI_API_KEY: optional fallback LLM scoring and email drafting.ANTHROPIC_API_KEY: optional second fallback LLM scoring and email drafting.
If a key is missing or an API call fails, the app logs a warning and falls back instead of crashing.
- Shows a lead-generation form at
/. - Accepts brand, location, offer, ICP, category, and number of leads.
- Starts a background job on submit.
- Redirects to
/results/<job_id>. - Polls
/api/status/<job_id>. - Shows progress.
- Returns ranked leads from seed, cached, or live mode.
- Displays personalised demo outreach with a copy email button.
- Saves generated leads into an approval workflow.
- Lets users approve, reject, suppress, edit, and export approved leads.
Open /approvals after generating leads.
Lead statuses:
generatedreviewedapprovedrejecteddo_not_contactexported
On each lead you can edit the email, approve it, reject it, or mark it do-not-contact. Approved leads can be exported from:
/export/approved
The same export is also available at /export/approved.csv.
The CSV export marks exported leads as exported. The app does not send emails directly. Actual sending should be handled later through a controlled outbound or CRM tool such as Instantly, Smartlead, HubSpot, or a similar approved workflow.
Lead data is stored in:
data/seed_leads.jsondata/cached_demo_results.jsondata/cached_live_results.json
Sources are demo-labelled where they are not live source URLs.