fallah iqbal kurnianto
Terminal

Vetly

Paste a raw client email or message. Evaluate your true take-home hourly rate, a 0 to 100 client risk score, and generate a counter-offer in 15 seconds.

Freelancers and independent engineers routinely accept underpriced contracts because headline project budgets obscure platform commissions, communication overhead, and uncapped revision loops. Vetly extracts unstructured client messages via LLM, computes true effective hourly yield and a monotonic 0 to 100 risk score in pure TypeScript, and generates a ready-to-send counter-offer in seconds.

DEAL ANALYZERSTRUCTURED LLM EXTRACTION
DETERMINISTIC ENGINERISK MODELING
Project typeIndependent Production Build
My roleFull-Stack Engineer & Product Designer
Duration1-week build · Live in production
Tools & Stack

Overview

When a prospective client sends an email or direct message about a software project, independent engineers have to make a fast pricing decision. Most headline budgets look fair on the surface until platform fees, discovery calls, and multiple revision rounds quietly cut the real hourly yield in half.

Evaluating a freelance offer manually with spreadsheets and contract cross-checks typically takes 45 minutes of friction. Vetly was built as a zero-friction web application that lets engineers paste a raw client message, extract structured contract terms via AI, and immediately see their true post-fee hourly rate, a monotonic 0 to 100 client risk score, and a ready-to-send counter-offer in 15 seconds.

The Challenge

Why pure LLM wrappers fail at financial valuation.

Delegating contract arithmetic or risk evaluation directly to a large language model introduces non-deterministic drift. Asking an LLM twice whether an $8,000 fixed-scope build with net-30 payment terms is safe can yield two contradictory risk ratings.

On the other hand, traditional spreadsheet calculators require tedious manual data entry while a client is waiting for a reply. The core engineering challenge was combining effortless natural-language intake with 100% reproducible financial and risk logic.

Right-Sized AI Architecture

Strict boundary isolation between probabilistic LLM tasks and the deterministic TypeScript core.

In Vetly, AI is integrated where language models excel, while all financial formulas and risk thresholds are locked inside a pure TypeScript calculation engine (src/lib/engine/) with zero network or database imports:

Smart Paste with LLM extraction parses raw client emails or chat messages into a strictly validated Zod schema: budget, hours, deposit percentage, payment terms, revision rounds, and scope red flags. If the LLM API is unreachable, the UI degrades gracefully to manual inputs.

The deterministic engine computes the real effective hourly rate by factoring in platform commissions, communication overhead, and revision scope risks, then evaluates the monotonic 0 to 100 client risk score and maps the offer into a 9-cell Accept / Negotiate / Reject matrix.

The counter-offer formatter takes the exact budget, hour cap, and protective contract clauses computed by the engine and formats them into a polite, ready-to-send client response.

The Ghost Owner Bug

Solving client-side hydration leaks with server-evaluated HTTP cookie ownership.

Requiring user account registration adds unnecessary friction to a fast contract analysis utility, so the initial prototype tracked deal ownership purely inside browser localStorage.

During automated headless browser testing, this architecture exposed a critical Ghost Owner Bug: when an engineer shared a read-only link (/share/[id]), client-side hydration delays caused owner mutation controls (Edit, Duplicate, Save) to briefly flash to non-owners before local browser state resolved.

The architectural fix: ownership authority moved entirely to a server-evaluated HTTP cookie (my_offers, storing up to 50 offer IDs for 30 days). Before Next.js streams the initial HTML for /result/[id] or /share/[id], the server evaluates ownership headers and completely strips mutation controls from the DOM payload for non-owners.

Outcomes & Verification

Strict automated testing uncovered subtle production traps that manual testing missed.

The verification suite includes Unicode non-breaking space (\u00A0) formatting differences in Intl.NumberFormat across 7 ISO currencies and headless clipboard permission fallbacks, ending at 163 automated assertions passing at 100%.

Manual spreadsheet math
0ms deterministic engine

Real-time effective hourly rate, 0 to 100 risk score, and 9-cell verdict recalculated on every keystroke with zero network latency.

LocalStorage auth leaks
Server HTTP cookie guard

Eliminated the Ghost Owner hydration bug by enforcing read-only vs. owner permissions on the server before HTML renders.

Unverified AI wrapper
163/163 automated checks

110 Vitest unit boundary assertions across 7 ISO currencies plus 53 autonomous end-to-end browser and API scenarios passing at 100%.


Have a product idea or manual workflow to ship?
Start with a 30-minute scoping call.

  1. 01Book 30-min call or send brief
  2. 02Scoping & stack review
  3. 03Fixed-scope plan in 48h