File size: 3,519 Bytes
404e3d0
 
 
 
 
 
 
 
 
48a3682
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
---
title: LeadFlow - Lead Generation
emoji: πŸš€
colorFrom: indigo
colorTo: purple
sdk: docker
app_port: 7860
---

# πŸš€ LeadFlow β€” Lead Generation & Outreach System

A complete system to scrape business leads from Google Maps, manage them via a premium dashboard, and send WhatsApp outreach messages.

## Features

- πŸ” **Google Maps Scraper** β€” Search any business type in any city
- πŸ‘₯ **Lead Management** β€” Full CRUD with search, filter, and sort
- πŸ’¬ **WhatsApp Integration** β€” One-click messaging via `wa.me` links
- βœ‰οΈ **Message Templates** β€” Create and manage reusable templates
- πŸ“Š **Dashboard Stats** β€” Real-time lead status overview
- πŸ“„ **CSV Export** β€” Export all leads for external use
- πŸ“ **Notes & Follow-ups** β€” Track conversations and set reminders
- 🎨 **Premium UI** β€” Dark glassmorphism theme, fully responsive

## Tech Stack

| Layer     | Technology         |
| --------- | ------------------ |
| Backend   | Python + FastAPI   |
| Database  | SQLite             |
| Scraper   | Selenium + Chrome  |
| Frontend  | HTML / CSS / JS    |

## Prerequisites

- **Python 3.9+**
- **Google Chrome** (for the Selenium scraper)

## Setup & Run

### 1. Backend

```bash
# Navigate to backend directory
cd backend

# Create a virtual environment
python3 -m venv venv
source venv/bin/activate    # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Start the server
python main.py
```

The API server will start at **http://localhost:8000**  
Swagger docs available at **http://localhost:8000/docs**

### 2. Frontend

Simply open `frontend/index.html` in your browser:

```bash
open frontend/index.html    # macOS
# or
xdg-open frontend/index.html  # Linux
```

Or serve it with Python:

```bash
cd frontend
python3 -m http.server 3000
```

Then open **http://localhost:3000** in your browser.

## Usage

1. **Scrape Leads** β€” Enter a search query (e.g., "gym in Mumbai") and click "Start Scraping"
2. **Manage Leads** β€” View leads in the table, search/filter, update statuses
3. **Send WhatsApp** β€” Click the πŸ’¬ button on any lead with a phone number
4. **Edit Templates** β€” Click "Templates" in the header to create/edit message templates
5. **Export Data** β€” Click "Export CSV" to download all leads

## API Endpoints

| Method   | Path                | Description             |
| -------- | ------------------- | ----------------------- |
| `POST`   | `/api/scrape`       | Start scraping          |
| `GET`    | `/api/scrape/status`| Scraping job status     |
| `GET`    | `/api/leads`        | List leads (w/ filters) |
| `PUT`    | `/api/leads/{id}`   | Update a lead           |
| `DELETE` | `/api/leads/{id}`   | Delete a lead           |
| `GET`    | `/api/leads/export/csv` | Export to CSV       |
| `GET`    | `/api/stats`        | Dashboard statistics    |
| `GET`    | `/api/templates`    | List templates          |
| `POST`   | `/api/templates`    | Create template         |
| `PUT`    | `/api/templates/{id}` | Update template       |
| `DELETE` | `/api/templates/{id}` | Delete template       |

## ⚠️ Important Notes

- WhatsApp messages are **user-triggered only** (opens in new tab via `wa.me` links)
- No automated messaging or spam β€” fully compliant with WhatsApp's terms
- Google Maps scraping should be used responsibly with reasonable limits
- The scraper may need periodic updates if Google changes their page structure

## License

MIT β€” Free for personal and commercial use.