This repository contains a legal, human-in-the-loop lead generation and outreach assistant for B2B services. It is designed as a legitimate sales productivity tool for consulting, telecom and vendor sourcing, AI automation, affiliate partnerships, and commercial negotiation services.
- Dashboard for total leads, hot leads, drafted emails, follow-ups due, and conversion pipeline.
- Lead database with company, contact, source, score, status, and next-action tracking.
- Transparent lead scoring based on company size, geography, industry fit, website quality, and service relevance.
- Personalised outreach draft generation in professional British English.
- Approval-first workflow: drafts are saved only and must be reviewed manually before any send.
- Follow-up tracking and recommended next actions.
- CSV and simple report exports.
- Deal Mode for creating paid outbound deal packs with structured placeholder leads and commercial recommendations.
- Premium deliverable features including branded PDF export, editable templates, client branding fields, and manual enrichment CSV import.
- Inbound-first revenue engine with public offer pages, consent-aware inbound capture, lead magnet delivery, nurture sequencing, and pipeline attribution metrics.
- Frontend: Next.js 14 with React and TypeScript
- Backend: FastAPI with SQLAlchemy
- Database: SQLite for the MVP
backend/
app/
tests/
frontend/
app/
components/
lib/
.env.example
README.md
Recommended local toolchain:
- Node.js
20 LTSor newer - npm
10or newer - Python
3.9+
cd /Users/arachchige.p/Documents/Codex/2026-04-24-you-are-my-senior-full-stack/backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtCreate a project-level .env from .env.example, then run:
cd /Users/arachchige.p/Documents/Codex/2026-04-24-you-are-my-senior-full-stack
source backend/.venv/bin/activate
uvicorn app.main:app --app-dir backend --reloadBackend API docs will be available at http://localhost:8000/docs.
Install Node dependencies in frontend/, then start the app:
cd /Users/arachchige.p/Documents/Codex/2026-04-24-you-are-my-senior-full-stack/frontend
npm install
cp .env.local.example .env.local
npm run devThe UI will be available at http://localhost:3000.
- Open http://localhost:3000/deal-mode.
- Choose a template or use
Custom. - Enter the deal pack name, target country, target industry, service offer, lead count, ICP notes, and optional client branding fields.
- Click
Create Deal Pack. - Open the saved pack and click
Generate. - Review the executive summary, scoring logic, outreach angle, follow-up sequence, lead table, branding, and pricing.
- Export the deliverable as CSV, report, or PDF.
- If you have manually enriched leads, import them via CSV into the selected pack.
Use Deal Mode as a commercial packaging flow:
- Select the template closest to the client brief.
- Add client name, logo URL,
Prepared for, andPrepared by. - Generate the deal pack to create the first structured draft.
- Import manually enriched leads if you have them.
- Export the final deliverable as a branded PDF for the client.
From the repository root:
npm install
npm run install:frontend
npm run devThis expects the backend virtual environment to already exist at backend/.venv.
Project-level .env:
BACKEND_HOST=0.0.0.0
BACKEND_PORT=8000
DATABASE_URL=sqlite:///./backend/data/leads.db
FRONTEND_API_URL=http://localhost:8000Frontend .env.local:
NEXT_PUBLIC_API_URL=http://localhost:8000You can create it with:
cd /Users/arachchige.p/Documents/Codex/2026-04-24-you-are-my-senior-full-stack/frontend
cp .env.local.example .env.localMain table: leads
company_namewebsitecountryindustrycompany_sizecontact_namecontact_emaillinkedin_urllead_sourcelead_scorescore_summarywebsite_qualityrelevance_notesservices_of_intereststatuslast_contacted_atfollow_up_due_daterecommended_next_actiondraft_subjectdraft_bodyfollow_up_subjectfollow_up_bodynotescreated_atupdated_at
An explicit SQL version is available at docs/database-schema.sql.
Additional Deal Mode tables:
deal_packsdeal_pack_leads
The backend bootstraps seed data automatically on startup using backend/app/seed_data.py.
This includes:
- sample operational leads
- a sample generated deal pack:
UK Telecom Sourcing Pilot - a premium demo deal pack:
UAE AI Automation Consulting Pilot
Run backend tests:
cd /Users/arachchige.p/Documents/Codex/2026-04-24-you-are-my-senior-full-stack
source backend/.venv/bin/activate
pytest backend/tests -qOptional frontend validation after npm install:
cd /Users/arachchige.p/Documents/Codex/2026-04-24-you-are-my-senior-full-stack/frontend
npm run buildBasic frontend build checklist:
npm installnpm run devnpm run build- Expected output:
- local dev app available at
http://localhost:3000 - Deal Mode page loads successfully
npm run buildcompletes without compile errors on a normal local Node/npm setup
- local dev app available at
- Leads are scored and explained immediately when created or updated.
- Draft generation never sends email.
- Follow-up suggestions are visible in the dashboard.
- Exports are user-triggered only.
- Deal Mode uses structured placeholder leads only and is ready for future enrichment APIs.
- PDF exports are branded as
Little KK Growth Engineand prepared in British English. - Public inbound capture only sends nurture emails when consent is present and live send is enabled.
- If SMTP is not configured, consented leads are captured safely and queued with a blocked reason.
Public endpoints:
GET /api/public/offersGET /api/public/landing-page/{slug}POST /api/public/inbound-capture
Public frontend pages:
http://localhost:3000/offershttp://localhost:3000/offers/ai-automationhttp://localhost:3000/offers/lead-generationhttp://localhost:3000/offers/sales-crm-automationhttp://localhost:3000/offers/recruitment-agency-automationhttp://localhost:3000/offers/clinic-automationhttp://localhost:3000/offers/real-estate-automationhttp://localhost:3000/offers/telecom-tech-automation
Consent rules:
- if
consent_checkbox=trueand SMTP plus live send are enabled, the system sends:- lead magnet delivery
- nurture email 1
- booking invite
- if consent is missing, the lead is captured but marked as
Reviewed Send Required - if live send is disabled or SMTP is unavailable, the lead is captured and queued safely
Required env vars for production launch:
CORS_ALLOW_ORIGINS=https://your-frontend.example,https://www.your-frontend.example
PUBLIC_BASE_URL=https://your-frontend.example
BOOKING_URL=https://cal.com/your-team/strategy-session
OUTREACH_LIVE_SEND_ENABLED=true
OUTREACH_EMERGENCY_PAUSE=false
SMTP_HOST=smtp.your-provider.example
SMTP_PORT=587
SMTP_USERNAME=your-user
SMTP_PASSWORD=your-password
SMTP_FROM_EMAIL=hello@your-domain.example
SMTP_USE_TLS=truecd /path/to/2026-04-24-you-are-my-senior-full-stack
python3 -m venv backend/.venv
source backend/.venv/bin/activate
backend/.venv/bin/pip install -r backend/requirements.txt
cp .env.example .env
uvicorn app.main:app --app-dir backend --host 0.0.0.0 --port 8000Recommended reverse proxy:
- point
api.your-domain.exampleto the VPS - terminate TLS with Nginx or Caddy
- proxy requests to
127.0.0.1:8000
Set the frontend project root to frontend/ and configure:
NEXT_PUBLIC_API_URL=https://api.your-domain.exampleDeploy the Next.js frontend and connect:
www.your-domain.exampleoffers.your-domain.exampleif you want a dedicated public funnel host
Backend .env:
PUBLIC_BASE_URL=https://www.your-domain.example
CORS_ALLOW_ORIGINS=https://www.your-domain.example,https://your-domain.exampleOUTREACH_LIVE_SEND_ENABLED=false
OUTREACH_EMERGENCY_PAUSE=false
SMTP_HOST=smtp.your-provider.example
SMTP_PORT=587
SMTP_USERNAME=your-user
SMTP_PASSWORD=your-password
SMTP_FROM_EMAIL=hello@your-domain.example
SMTP_USE_TLS=trueRollout order:
- keep
OUTREACH_LIVE_SEND_ENABLED=false - submit one consented test lead
- verify queued fallback works
- enable live send only after the sender is confirmed
BOOKING_URL=https://cal.com/your-team/strategy-sessionThis link appears in:
- public offer pages
- lead magnet delivery
- nurture email
- booking invite
- inbound engine proposal flow
Health check:
curl https://api.your-domain.example/api/healthPublic offers:
curl https://api.your-domain.example/api/public/offersSubmit a test inbound lead:
curl -X POST https://api.your-domain.example/api/public/inbound-capture \
-H "Content-Type: application/json" \
-d '{
"name":"Test User",
"company":"Launch Test Ltd",
"email":"test@launch-test.example",
"phone":"+441234567890",
"website":"https://launch-test.example",
"country":"United Kingdom",
"industry":"AI automation consulting",
"interest":"Free AI Deal Pack",
"consent_checkbox":true,
"consent_timestamp":"2026-04-25T09:00:00Z",
"source":"launch-smoke-test",
"landing_page_slug":"ai-automation"
}'Examples included:
- deploy/nginx.conf.example
- deploy/Caddyfile.example
- deploy/systemd/little-kk-backend.service
- deploy/systemd/little-kk-worker.service
Security hardening included:
.envand local env files are ignored in.gitignore- SMTP password is used only for SMTP login and is never logged
- public inbound endpoints use Pydantic validation with field length checks and required consent flags
- production startup rejects wildcard CORS via
CORS_ALLOW_ORIGINS=*
Future daily bot-run notes are in:
Target endpoint:
POST /api/auto-sell/run
CSV columns for Deal Mode import:
company_namewebsitecountryindustrycontact_namecontact_emaillinkedin_urlnotes
- Add authenticated user accounts and role-based approval permissions.
- Add inbox integrations for Gmail and Outlook with reply syncing, but keep send approval explicit.
- Introduce activity history, notes timeline, and task ownership.
- Add lead import from approved CSV uploads and CRM sync.
- Add richer scoring with editable scoring weights and ICP templates.
- Add approval queues and audit logs for compliant outreach workflows.
- Add analytics for reply rates, meetings booked, and source quality.
- Multi-user workspaces and team permissions
- Gmail and Outlook draft sync
- CRM integrations with HubSpot, Salesforce, and Pipedrive
- AI-assisted account research summaries from approved data sources
- Custom lead-scoring templates by service line
- Sequenced follow-up playbooks with approval checkpoints
- Pipeline forecasting and revenue attribution
- White-label reporting for agencies and consultants
£500pilot: deliver one branded deal pack with targeting, scoring logic, placeholder or enriched leads, outreach angle, and PDF export.£1,500monthly pipeline: refresh deal packs monthly, maintain lead quality, import enriched leads, and hand over ready-to-approve outbound packs.£3,000-£5,000done-for-you setup: configure the full outbound operating system, templates, branded deliverables, and client-specific workflow.
- No scraping-heavy collection is included in this MVP.
- No automated bulk sending is included.
- No deceptive or bypass-based behaviour is included.
- A human must review outreach before any send.