Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

LocalBiz LeadFlow Assistant

I built this project to explore a simple lead-management workflow for small businesses. It accepts an inquiry, classifies the message using keyword rules, assigns a score, and stores the lead so its follow-up status can be tracked.

The API uses FastAPI and SQLite. The current intent classification and scoring are rule-based; there is no trained machine-learning model in this version.

Features in the code

  • Receive a lead through POST /webhook/lead.
  • Classify the message as pricing, booking, support, or general.
  • Calculate a simple lead score from the detected intent and the presence of the word "urgent".
  • Store lead details, intent, score, source, and status in SQLite.
  • List leads with GET /leads.
  • Update a lead's follow-up status with PATCH /leads/{lead_id}.
  • View lead counts and intent totals with GET /summary.
  • Serve the browser interface at /ui.

Technology

  • Python
  • FastAPI and Pydantic
  • SQLite
  • HTML, CSS, and JavaScript interface

Run locally

On Windows PowerShell:

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
uvicorn app.main:app --reload --port 8101

Open:

Example webhook request

POST /webhook/lead

{
  "name": "Aarav",
  "phone": "+910000000000",
  "message": "Need a booking this weekend",
  "source": "whatsapp"
}

The response includes the new lead ID, detected intent, score, and initial status.

Current limitations

  • Intent detection uses keyword matching.
  • Lead scores are fixed rule-based values, not calibrated probabilities.
  • The API accepts a WhatsApp-style source label but does not connect to the WhatsApp Business API.
  • Follow-up status values are currently accepted as strings without a strict allowed-value list.
  • Tests and deployment have not been verified.

Possible next steps

  • Add input validation and explicit lead-status transitions.
  • Add tests for intent classification and score calculation.
  • Integrate a real messaging provider through its official API.
  • Add authentication and role-based access before multi-user use.

Author

Afzal Hussain · @Afzu01

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages