Inspiration
Freelance work often runs on chat messages and trust. Scope grows in chat and nobody prices it. Freelancers send the full file and hope to get paid. Clients pay and hope the file matches the brief. We wanted one chain that both people can check: what was agreed, what was delivered, and what was paid.
What it does
VerPe is a web app for freelancers and clients in any profession: video, design, development, writing.
- Agree. The client pastes a brief. AI proposes acceptance criteria. Every criterion carries the exact quote from the brief it came from. If the quote is not in the brief, the item is dropped. Both people approve a versioned agreement.
- Fund. The client authorizes the amount with PayPal (sandbox). Nothing is captured yet.
- Change scope. A scope change is a change order. AI flags what is new work, but it never sets the price. Both people approve it. That creates agreement v2, and the extra amount gets its own PayPal authorization.
- Verify. The freelancer uploads the file. The server hashes it, measures it with ffprobe, and makes a watermarked preview. AI looks only at preview frames, never at the original. Checks that did not run are shown as "Not checked", never as passed.
- Pay and unlock. The client accepts and slides to pay. The server captures each authorization, reads the capture back from PayPal, and checks status, amount and currency. Only then does it issue a short-lived signed link to the original file.
- Evidence Passport. An append-only record links the agreement versions, file hash, human decisions and PayPal IDs. Each fact is labelled Measured, AI inference, Human decision or PayPal confirmed.
VerPe is not escrow. It does not hold money. PayPal holds the authorization until the client accepts.
How we built it
- Next.js 15 (App Router), React 19, TypeScript strict, Tailwind CSS, Motion and GSAP for the interface.
- PayPal Orders v2 and Payments v2 REST APIs from the server, plus the PayPal JavaScript SDK buttons in the browser.
- Google Gemini for brief extraction, scope-change flags and preview-frame checks. Every model call uses a zod schema; invalid output is retried once, then marked uncertain.
- FFmpeg and ffprobe for measured facts and the watermarked preview.
- Prisma with SQLite, Vitest unit tests, a Playwright end-to-end test, Docker, and Render for hosting.
- Four roles worked in parallel: payments and platform, AI and media, frontend, and ops. Shared types in one contracts folder kept the parts in sync.
Challenges we ran into
- Honest evidence. Early builds showed probe numbers and hashes that the server had not measured. We rebuilt the pipeline so the UI shows only what the server computed, and we added tests that fail if unmeasured data is labelled Measured.
- No double capture. Every PayPal POST sends a PayPal-Request-Id that is saved before the call and reused on retry. An unknown result is reconciled by reading PayPal before any retry.
- Unlock only after verified capture. A webhook body or a UI flag is never enough. The download route checks that every payment of the milestone is captured and PayPal-confirmed.
- Sandbox setup. A merchant sandbox account that could not receive USD caused UNSUPPORTED_PAYEE_CURRENCY in checkout. We fixed it with a US business sandbox account.
- Build-time settings. Browser settings in Next.js are fixed at build time, so the Docker build needed explicit build arguments.
Accomplishments that we're proud of
- A full chain from brief to verified payment to unlocked file, enforced on the server and not only in the UI.
- Change orders that turn scope creep into a separately approved, separately authorized amount.
- Over 400 automated tests, including tests for each payment and unlock rule.
- An interface that shows where each fact comes from.
What we learned
- Authorize and capture is a strong fit for "pay on acceptance" without holding money.
- AI is most useful when it proposes and quotes its source, and people decide.
- Idempotency and read-back verification matter more than the happy path.
What's next for VerPe
- Multiple milestones per project and partial delivery.
- More automated checks for images, documents and code deliverables.
- Dispute notes attached to the Evidence Passport.
- Live PayPal after a full security review.
