Biz Alırız
Vehicle valuation platform with a rules-based pricing engine and on-device plate redaction
Biz Alırız is a live Turkish site where someone enters their car's details and gets a cash offer, calculated from comparable market listings rather than a human appraiser's guess. It was built and deployed by one person, from the pricing engine to a computer-vision step that covers license plates in uploaded photos before they're stored.
the problem
Turning real-world listings into one defensible number is a statistics problem before it's a product problem: naive averaging gets wrecked by a handful of scam-cheap or heavily-optioned outliers, and a "never overpay" guarantee has to hold even after that cleanup runs. Separately, uploaded vehicle photos routinely contain a visible license plate, which is personal data — routing every photo through a third-party vision API to redact it would defeat the purpose of protecting it.
how it is built
- Astro and React front end, FastAPI services, PostgreSQL (via SQLAlchemy 2 async, with Alembic migrations), delivered through Cloudflare.
- A valuation engine shipped as an importable Python package rather than a separate microservice: comparable-matching, statistical cleanup, condition-based deductions and liquidity-tiered margin all read from one YAML config that a test cross-checks against the written business rules.
- Adaptive reference price: the 25th percentile of clean comparables when there are at least 8 of them, otherwise the single cheapest clean comparable — both strategies are computed and logged on every run so the switchover point can be recalibrated from real outcomes later.
- A hard ceiling the offer can never cross (never price above the cheapest genuinely clean comparable), enforced on the raw comparable set independently of the statistical cleanup step.
- On-device license-plate detection: a YOLOv9 model (via the open-image-models ONNX runtime) runs on CPU inside the service, so uploaded photos never reach a third-party vision API.
- The plate is covered with a fitted, rotated brand panel instead of a blur: an HSV color mask (low saturation, high value) finds the plate's white against the vehicle body, with an axis-aligned box as the fallback when the fitted shape can't be trusted.
- Detection confidence threshold is set to 0.20, below the underlying library's own 0.25 default, on purpose — a wrongly-placed panel costs nothing, a missed plate is a data-protection failure.
- Cloudflare Turnstile gates the public lead form, and a background outbox worker retries failed webhook delivery with backoff instead of silently losing a lead.
- Python 3.12 workspace (uv), with ruff and pytest run as part of the workflow, not after the fact.
the hard parts
- Cleaning bad comparables (removing scam-cheap and heavily-damaged listings) has to run before a reference price is computed, but the safety ceiling — never price above the cheapest clean comparable — has to run against the raw, uncleaned cheapest comparable, or the two guardrails could contradict each other. The engine keeps a normalized set and a raw set side by side specifically so that can't happen.
- The detector's output is a loose axis-aligned box, but a plate photographed at an angle isn't axis-aligned. The service re-derives the plate's actual rotated quadrilateral from an HSV mask inside that box, discards the measurement if the recovered angle looks implausible (a reflection usually reads as a steep, wrong angle), and falls back to the safe axis-aligned box — coverage always wins over a tidy-looking panel.
- Matching comparable vehicles correctly turned out to hinge on which field on a listing "engine identity" gets read from: an earlier version pulled it from the wrong place and silently mismatched a meaningful share of listings against the wrong engine variant — a bug that would have quietly mispriced cars rather than crashing, caught only by cross-checking that field against the vehicle's own category path.
Need something like this built?
Backend systems, payment and API integrations, AI pipelines, and the interfaces in front of them. Freelance or contract, remote.