โ† Back to all work
Case study ยท Showcase build

Telegram Lead Bot + Admin Panel

A Telegram bot that collects leads through a guided step-by-step dialog and a FastAPI admin panel that shows live statistics and lead management โ€” one Docker container, deployed and ready.

Stack: Python ยท aiogram 3 ยท FastAPI ยท SQLAlchemy ยท SQLite ยท Docker Delivery: 1โ€“2 weeks Status: Live & deployed

Try it yourself

Open the admin panel (read-only demo, seeded with sample data) and watch a bot collect a lead in Telegram.

Open admin demo โ†’ login: demo View source โ†—

01Context

Small service businesses โ€” salons, clinics, tutors, agencies โ€” lose customers every time a message goes unanswered. The owner is busy, replies hours later, and the lead has already gone to a competitor. The job here was a reusable template: a bot that captures and qualifies incoming leads instantly, and a web admin where the owner sees everything in one place instead of scrolling Telegram.

02Problem

The buyer's pain, in their words: "I keep losing leads because I can't reply fast enough, and when I finally do, I have no idea who I've already spoken to." Manual chat means slow first responses, no records, no overview, and no way to track which leads closed.

03Solution

A single deployable service with two parts that share one database and one event loop:

  • Bot (aiogram 3, FSM): /start โ†’ a guided dialog collects name โ†’ contact โ†’ task description with validation at each step, then stores the lead and confirms with a ticket number. Built on finite-state machines so the conversation never gets lost mid-way.
  • Admin (FastAPI + Jinja2): password-protected dashboard with live stats (total / today / new / closed), a filterable lead table, and one-click status workflow (new โ†’ contacted โ†’ closed).
  • Persistence: SQLAlchemy 2 (async) + aiosqlite, auto-created on startup and seeded with sample data so the demo is never empty.
  • Deploy: one Dockerfile, one process, /health endpoint for uptime checks โ€” ready for Railway or an always-on VPS.

04Outcome

A bot like this turns a multi-hour first response into an instant one and gives the owner a real overview of their pipeline. The lead never waits, never gets lost, and the owner stops digging through chat history. Concretely, the template delivers:

First response from ~4 hours (manual) โ†’ ~30 seconds (automated), with every lead logged and trackable in a dashboard.

Industry benchmarks for bots like this (third-party, cited)

  • Lead-capture bots convert 2โ€“4ร— better than web forms. botract.com
  • Booking bots cut no-shows by 27% and scheduling time by 40% in a real salon case. botlabs.agency
  • A clinic chatbot confirmed 60% of appointments without a human calling. chat2desk.com

05Tradeoffs & what I'd improve

  • SQLite over Postgres โ€” perfect for a single-instance demo and small businesses; for high write volume I'd switch to PostgreSQL (one config line in DATABASE_URL).
  • Polling over webhooks โ€” simplest to deploy anywhere; for very high traffic I'd move to webhooks behind a reverse proxy.
  • Add CRM sync โ€” next iteration would push leads to Google Sheets / HubSpot / Airtable automatically, so the owner never leaves their existing workflow.

Have a similar problem?

If you're losing leads or bookings to slow replies, I can ship a version of this for your business in 1โ€“2 weeks โ€” fixed price, you own the code.

Send me your idea โ†’