# Prospect Intelligence Platform A safety-first MVP vertical slice for evidence-led prospect discovery and qualification. It stores normalized businesses, scores transparent opportunity signals, preserves reviewable fields, and blocks suppressed records. **Automated outreach is disabled.** ## Included - Dependency-free Python/SQLite API under `apps/api`. - Normalization, conservative website classification, exact deduplication, versioned scoring, suppression checks. - JSON API under `/api/v1` for health, dashboard summary, businesses, suppression, and CSV-style import preview. - Responsive static dashboard under `apps/web` with explorer filters, evidence/freshness labels, detail review, manual intake, and browser-only CSV preview. - Docker Compose runtime with non-root containers, read-only filesystems, health checks, and a named SQLite data volume. - Browser authentication with server-side sessions and an optional first-run admin bootstrap. - Security and operations guidance in `docs/`. ## Run locally ```bash cd apps/api python3 -m unittest discover -v python3 app/main.py --host 127.0.0.1 --port 8000 --db /tmp/prospects.db ``` Serve the UI separately: ```bash cd apps/web python3 -m http.server 8080 ``` Open `http://127.0.0.1:8080`. The UI uses demo data by default; set `window.API_BASE` in the browser console to `http://127.0.0.1:8000` when testing the API locally. ## API smoke calls ```bash curl http://127.0.0.1:8000/api/v1/health/live curl http://127.0.0.1:8000/api/v1/businesses curl -X POST http://127.0.0.1:8000/api/v1/businesses \ -H 'content-type: application/json' \ -d '{"name":"Example Plumbing","website":"https://example.invalid","email":"info@example.invalid","phone":"+27 21 555 0100"}' ``` ## Compose ```bash cp .env.example .env docker compose config --quiet docker compose up --build -d curl -fsS http://localhost:8000/api/v1/health/live curl -fsS http://localhost:8080/healthz docker compose down ``` Compose passes the optional `BOOTSTRAP_ADMIN_EMAIL` and `BOOTSTRAP_ADMIN_PASSWORD` values to the API. Set both in an untracked `.env` only when provisioning a fresh instance, then remove them and rotate the password after the bootstrap admin is created. No credentials belong in this repository. Authenticated browser requests use a server-side session cookie; login creates a session and logout invalidates it. The liveness endpoints (`GET /api/v1/health/live` and `GET /healthz`) intentionally remain unauthenticated so Docker, ingress, and monitoring health checks can use them. Authentication is not a substitute for tenant/authorization checks: protected routes must enforce the session and organization boundary server-side. The initial pilot still omits Postgres, Redis, Celery, external discovery adapters, DNS/HTTP scanning, and outbound messaging. Before production use, complete the production security gates described in `docs/SECURITY.md`, including Argon2id password hashing, MFA for administrator accounts, TLS, CSRF protection, rate limiting, audit logging, migrations, SSRF-safe scanners, approved source registry, queue idempotency, and tested backups/restores. ## Verification ```bash python3 -m unittest discover -v -s apps/api/tests -t apps/api php -l /dev/null 2>/dev/null || true # no PHP application is used here git diff --check docker compose config --quiet ``` See `apps/api/README.md`, `apps/web/README.md`, `docs/SECURITY.md`, and `docs/OPERATIONS.md` for details.