// Case study · Legal document tool
Contract Mașină: the official car sale contract, filled in and printed in the browser
Contract Mașină (contractmasina.ro) is our own micro-site for the official Romanian vehicle sale contract, model 2026 ITL 054. Seller and buyer details go into a four-step form, and the user gets a free preview with a watermark. A clean PDF costs 19 lei, paid through Stripe. There is no AI in it.
The form, the validation and the PDF all run in the browser, so the personal ID number (CNP) and identity details never reach our server. The server sees only a hash of the VIN, a payment session and an unlock token. The contract text reproduces the official facsimile word for word, and a test blocks any change to it.
At a glance
- Type
- Web tool (micro-site)
- Owner
- Netcraft Digital SRL (our own product)
- Users
- People buying or selling a car in Romania
- Price
- 19 lei per clean PDF
- Official model
- 2026 ITL 054, Official Gazette no. 680 of 17.08.2026
- Live site
- contractmasina.ro
// Features
What users can do
A four-step form with live preview
The user fills in the contract in four steps, with a preview of the completed official form.
Validation in the browser
The VIN is checked against ISO 3779 (a wrong check digit is a warning, not an error), and the CNP by date, county and check digit. Company tax IDs, the vehicle registration certificate, the ID document and the plate number are checked too.
Free preview, paid clean PDF
The preview is free, with a watermark. After payment, the clean PDF is built in the browser and fitted on one A4 page. The price is also written out in words automatically.
Unlock tied to the vehicle
After payment, the server issues a signed token tied to a fingerprint of the VIN, which unlocks the clean PDF for that contract.
Weekly check of the official model
A scheduled workflow checks every week on legislatie.just.ro that the model on the site is still the one in force.
Guides with official sources only
The guides cite only official sources, and each claim has a reference.
// Decisions
What we chose, and what we rejected
Each decision with its reason and the option we left out.
Build the PDF in the browser
- We chose
- The form, the validation and the PDF run entirely in the browser.
- Why
- A sale contract contains both parties' CNP and ID details. If they never reach the server, there is nothing to store, log or leak.
- Rejected
- Generating the PDF on the server.
Only the official text, locked by a test
- We chose
- The template reproduces the facsimile from the Official Gazette word for word, with no added, removed or reworded clauses and no advice on clauses.
- Why
- A SHA-256 fingerprint in a test blocks any accidental change. When a new model is published, it is updated through a documented process.
- Rejected
- An editable or “improved” contract template.
The API refuses personal data
- We chose
- Only one browser module calls the API, sending only a VIN hash, a session ID and a token. Every route reads its body through a strict schema that rejects personal-data keys.
- Why
- Privacy is enforced by code and proven by a test, not left to a promise. Request bodies and Stripe events are never logged.
- Rejected
- Trusting the client not to send personal data.
// Stack
How it is built
- Framework
- Next.js 16, Tailwind 4, strict TypeScript
- pdf-lib and fontkit in the browser, loaded on demand
- Payments
- Stripe Checkout; HMAC unlock token
- CMS and database
- Payload CMS 3 on Postgres (orders only, without personal data)
- Background jobs
- Vercel Workflow with a weekly cron
- Tests
- SHA-256 fingerprint of the official text; a test that proves no personal data reaches the API


