DEV Community

Chaitanya Sharma
Chaitanya Sharma

Posted on

I built an AI CRM where leads score themselves — 5 services on Zerops in 48h

For the #ZeropsChallenge I built LeadPilot — an AI lead-automation CRM where every lead is scored, qualified, and given a drafted reply the instant it arrives.

The idea

Inbound leads pile up unqualified. LeadPilot fixes the triage: a lead hits the form → it's queued → a worker scores it 0–100 with Claude Haiku (intent, temperature, summary, personalized reply) → it lands in a live Kanban pipeline. Capture is instant; scoring is async.

Architecture — 5 services

Service Type Role
app static React + Vite + Tailwind SPA
api python@3.12 FastAPI — capture, JWT auth, pipeline
worker python@3.12 drains the queue, calls Claude
db postgresql@16 leads + activity
cache valkey@7.2 job queue + cache

The API enqueues to Valkey and returns immediately; the worker (a separate service) does the slow AI work. Queue-decoupled by design.

Deploy was infra-as-code

Services talk over a private network via env references — no secrets in code:

run:
  envVariables:
    DB_HOST: ${db_hostname}
    DB_PASS: ${db_password}
    REDIS_HOST: ${cache_hostname}
    REDIS_PASSWORD: ${cache_password}
  start: python -m uvicorn app.main:app --host 0.0.0.0 --port 8080

Enter fullscreen mode Exit fullscreen mode

Then zcli push api / worker / app. Migrations run once per version with zsc execOnce; /api/health gives zero-downtime rollouts.

AI usage (disclosed)
Scoring uses Claude Haiku with a deterministic fallback so it never breaks. I built it with Claude Code assistance — I designed the architecture and reviewed/tested everything.

Thanks @WeMakeDevs and @zeropsio! Try it: https://app-2d82.prg1.zerops.app

Top comments (0)