How victor-hugos/leadflow-automation works
Leadflow Automation is a FastAPI lead-processing application. A lead enters through the API, is business-validated and checked for duplicates, scored and prioritized, saved to SQLite, then sent to an optional webhook; the API returns the processing result. The app also serves a demo frontend, exposes health and lead-listing endpoints, and logs operational events. Edges follow the shown route orchestration and documented capabilities; the frontend and health implementations were not sampled, so their details are limited to README statements.
Main entry points: leads.py Lead endpoints · main.py FastAPI app · connection.py SQLite connection · lead.py Lead schemas
Components 17
API and UI
- FastAPI app
app/main.py - Demo frontend
frontend/index.html - Health endpoint
app/routes/health.py - Lead endpoints
app/routes/leads.py
Lead workflow
- Lead schemas
app/models/lead.py - Business validation
app/services/lead_validation_service.py - Duplicate lookup
app/services/lead_dedup_service.py - Lead scoring
app/services/lead_scoring_service.py - Priority classification
app/services/lead_priority_service.py
Persistence
- Lead repository
app/services/lead_repository_service.py - Schema initialization
app/database/init_db.py - SQLite connection
app/database/connection.py - SQLite database
data
Integrations and operations
- Webhook dispatch
app/services/webhook_service.py - Structured logging
app/utils/logger.py
Other components
- Form / API user
- Webhook receiver
Connections 24
- Form / API user → FastAPI app: uses app
README.md - FastAPI app → Lead endpoints: registers routes
app/main.py - FastAPI app → Health endpoint: registers routes
app/main.py - FastAPI app → Demo frontend: serves frontend
app/main.py - FastAPI app → Schema initialization: initializes schema
app/main.py - FastAPI app → Structured logging: sets up logging
app/main.py - Lead endpoints → Lead schemas: uses schemas
app/routes/leads.py - Lead endpoints → Business validation: validates lead
app/routes/leads.py - Lead endpoints → Duplicate lookup: checks duplicates
app/routes/leads.py - Lead endpoints → Lead scoring: calculates score
app/routes/leads.py - Lead endpoints → Priority classification: classifies priority
app/routes/leads.py - Lead endpoints → Lead repository: saves lead
app/routes/leads.py - Lead endpoints → SQLite connection: queries listings
app/routes/leads.py - Lead endpoints → Webhook dispatch: dispatches lead
app/routes/leads.py - Lead endpoints → Structured logging: records events
app/routes/leads.py - Business validation → Lead schemas: validates fields
app/services/lead_validation_service.py - Lead scoring → Lead schemas: scores fields
app/services/lead_scoring_service.py - Lead repository → Lead schemas: persists data
app/services/lead_repository_service.py - Lead repository → SQLite connection: opens connection
app/services/lead_repository_service.py - Duplicate lookup → SQLite connection: opens connection
app/services/lead_dedup_service.py - Schema initialization → SQLite connection: opens connection
app/database/init_db.py - SQLite connection → SQLite database: connects to
app/database/connection.py - Webhook dispatch → Webhook receiver: posts payload
app/services/webhook_service.py - Webhook dispatch → Structured logging: logs outcome
app/services/webhook_service.py