build prospect intelligence platform MVP

This commit is contained in:
Marco0300
2026-09-02 17:38:50 +02:00
commit 44be4efc82
29 changed files with 973 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
# Prospect Platform API MVP
Dependency-light JSON API for a single demo tenant (`demo-tenant`). Core domain rules use only Python's standard library; persistence is SQLite. This MVP stores prospect evidence and scores, but never sends outreach.
## Run
From this directory:
```bash
python3 app/main.py
# listens on http://127.0.0.1:8000
python3 -m unittest discover
```
Set `PROSPECT_API_PORT` or pass `--port`; set `PROSPECT_API_DB` or pass `--db` to override the default `prospects.db`.
## Endpoints
- `GET /api/v1/health/live` — liveness.
- `GET /api/v1/dashboard/summary` — tenant-scoped counts and score average.
- `GET /api/v1/businesses` — list businesses; optional `?q=` filter.
- `POST /api/v1/businesses` — create a business from JSON (`name` required; website, email, phone, description optional). Normalization, scoring, deduplication, and suppression are enforced server-side.
- `GET /api/v1/businesses/{id}` — retrieve one tenant-scoped business.
- `POST /api/v1/suppressions` — add `{kind: email|domain|phone, value: ...}`. Future matching business creation is blocked.
- `POST /api/v1/imports/preview` — preview `{rows: [...]}` without writing; reports accepted, duplicates, suppressed, normalized rows.
All SQL uses parameters and all responses are JSON. Scores include `score_version` and `score_factors` for traceability. There is intentionally no send/outreach endpoint.