Lab-test quotes that patients build themselves and download as a PDF
A website and quote builder I pitched to a clinical laboratory as a spec proposal. Patients build a cart from the test catalog and download the quote as a PDF, with volume discounts applied on their own. I wrote all of it in February 2026.
The problem
The idea I pitched was simple: let patients price their own lab tests online instead of calling a branch. This was a spec proposal, not a paid job. I built the whole site to show the laboratory what that would look like. A quote is a list of tests someone plans to take, so I kept it on the patient's device. The site has no database and no accounts.
What I built
- A landing page made of separate sections: a hero with crossfading background video, a video showcase, services, a promotions carousel and a preview of the quote builder.
- A quote builder where patients filter tests by category, price range or keyword, sort the list, and see how many filters are active.
- A cart that applies volume discounts by itself: 5% off from 3 items in the cart, 10% off from 5.
- PDF quotes generated in the browser with jsPDF and autotable. Each one has a unique quote number, a 30-day validity date and amounts in Mexican pesos. Before the PDF is built, the patient fills in a short form validated with React Hook Form and Zod.
- A branch map built with Leaflet, with a directions button that opens Google Maps.
- A written design system in 12 sections: a palette taken from the lab's logo, a type scale, an 8 px spacing grid, component specs and WCAG AA contrast rules. A CSS tokens file goes with it.
How it works
Next.js 14 with the App Router and TypeScript. The landing page is a stack of independent section components. The quote builder lives in its own feature module, split into components, context, hooks, utilities, types and data.
The logic without state lives in pure functions. One computes subtotals and discounts. Another lays out the PDF. A single Context provider shares one instance of the cart hook, and I documented that flow with diagrams in an architecture file.
The cart persists to localStorage with a version number. If the stored format no longer matches, the app clears it instead of breaking. A full storage quota has its own error path.
Because the cart and the PDF stay in the browser, the site stores no patient data and needs no back end for orders. Tests, categories, branches and promotions are static data files. The live demo runs on a sample catalog of 9 tests and packages.
The Leaflet map loads on the client only, outside server rendering. I kept the media small: each of the 4 video clips is under 1 MB, and the posters ship as WebP with a JPG fallback.
Results
- 0
- databases: the cart and the PDF quote stay on the patient's device
- < 1 MB
- per background video clip, with WebP posters
- 12
- sections in the written design system
- 100%
- of the code written by me (10 of 10 commits)
Who else worked on it
I wrote all of the code. The logo and brand belong to the laboratory, which did not commission or pay for the work.
Full stack
Next.js 14 (App Router), React 18, TypeScript 5, Tailwind CSS 3.4, Framer Motion, React Hook Form, Zod, jsPDF + jspdf-autotable, Leaflet + React-Leaflet, Embla Carousel, Lucide React