
Rebate & Rule: A Picture Framer Website with a Live Frame Builder
Rebate & Rule is a website template I built for a picture framer. The shop is made up, but the problem it solves is a real one: most people don't know what a frame will look like, or what it will cost, until they're stood in the workshop holding corner samples against their picture.
The template lets them do most of that from home. They upload a photo of their picture, type in its size, and pick a moulding, a mount and the glass. The site shows it framed and hung on a photo of a real room, at its real size, and the price changes with every choice. Then they say how the picture gets to the workshop and back, and pay online.
There is also a page listing every moulding, mount and glass, and a form to book half-hour workshop visits.
The stack
- Framework: Next.js 15 (App Router), React 19 and TypeScript
- Styling: plain CSS, no framework
- Payments: Stripe Checkout, called through its REST API with no Stripe package
- Images: CC0 room photos and public domain paintings, all credited
Your picture stays on your device
The upload step doesn't upload anything. The builder turns the chosen file into a local object URL in the browser and uses that for the preview. It checks the file is an image and under 30 MB, reads its width and height, and uses the shape to fill in the height when you type the width (you can untick "Keep the picture's shape" to set both).
That's a privacy win, and it means there's no file storage to run. The framer gets the real picture when it's brought in, collected or posted.
Frames are drawn, not photographed
I didn't want a photo of every moulding in every size. Instead, Framed.tsx draws the frame from four CSS shapes, one per side, each clipped at 45 degrees so the corners mitre like a real frame. Each moulding has a colour "profile" across its width, from the outer edge to the inner lip:
{ id: "walnut", no: "07", name: "Walnut box", finish: "Solid walnut, oiled",
widthMm: 50, perMetre: 44,
profile: "#2e1c0f 0%, #6b4426 20%, #8a5a33 42%, ..." }
That gradient is painted across each side, with a light or dark wash to suggest where the light falls. Inside sits the mount with a bevelled window, then the picture, then a faint sheen for the glass. Every measurement is a percentage of the frame, so it draws correctly at any size.
Hung at its real size
Each room photo in the builder knows how many pixels make a centimetre on its wall, measured from the sofa or chair in the shot. The frame's outside size in centimetres is turned into pixels on that photo and hung a set gap above the furniture. If a frame is taller than the wall, it's hung as high as it goes and the page says so. There are three rooms to try, plus a close-up view.
One price list, used twice
All the mouldings, mounts, glass and prices live in one file, lib/frames.ts. Moulding is priced by the metre around the outside, mount and glass by the square metre, plus a fitting charge and a £45 minimum. The builder shows that breakdown line by line under "How the price adds up".
The order route uses the same file and works the price out again on the server from the customer's choices. It never trusts a total sent from the browser, so nobody can edit the page to pay less.
The second step adds the practical bits: bring it in, have it collected, or get a padded box to post it in; pick it up or have it delivered; and an express option. Pictures over 70 cm can't be posted, and the form won't let you choose that.
Paying with Stripe
When the customer pays, the server creates a Stripe Checkout session with each part of the order as its own line, so the receipt reads like the breakdown. A webhook listens for checkout.session.completed, checks Stripe's signature, and forwards the paid order with everything needed to make the frame.
With no Stripe key set, the site runs in demo mode: nothing is charged and the order is sent on as an enquiry instead. That's how the live demo works.
Why it suits a framer
Framing is a considered purchase, and people worry about two things: will it look right, and what will it cost. Seeing your own picture on a wall at the right size answers the first; a price that moves as you change the glass answers the second. The visit booking is still there, because some people will always want to hold the corner sample, and if an order or payment fails to go through, the message gives the phone number so nobody gets stuck.
See it for yourself
You can try the frame builder on the live demo, or read more on the Rebate & Rule design page. It starts at £149, and I'll make it yours with your mouldings, prices and photos. If you run a framing shop, or any business where customers need to see it before they buy, get in touch.