Under the hood.
This site is a Next.js and React application. These notes describe its implementation, rather than guessing what runs behind somebody else’s website.
Visits in. Private records out.
The tracker sends a page path, an event ID and the referring site. The API validates that request and records the event. IP information is accepted only from the configured trusted proxy. Query strings and enquiry text do not go into the visitor log.
The admin session is signed on the server and expires after twelve hours. Reading the log requires that session. The database table has row-level security enabled and no public read policy; the service key stays in server environment variables.
A useful failure case: duplicate requests
A failed connection can cause the tracker to retry a visit. Each retry uses the same event ID, and storage ignores a duplicate ID. That makes a retry safer than creating a new visit every time a request is sent.
// One event ID, reused on retries
const event = { id: crypto.randomUUID(), path: pathname };
// The database uses id as its primary key.
// Duplicate inserts are ignored rather than counted again.
Prefer: resolution=ignore-duplicatesDeployment choices
Supabase provides durable storage for deployment. A local file adapter is available for development. Production does not silently fall back to a temporary file if the database is missing. Rate limits run per application instance; a multi-instance deployment can add a shared rate-limit store or host firewall.
One renderer for the preview and the PNG.
The playroom keeps the page content, section order, colours and typography in React state. A canvas renderer lays out the visible sections at either desktop or phone width. Text is measured and wrapped before drawing, including words too long for a line.
Export calls the same renderer and creates a PNG from the result. Individual-section export passes a section ID to that renderer. The image does not depend on taking a screenshot of the page, and the artwork is served from the same site.
drawWebsite(canvas, design, width, artwork);
// A single section uses the same layout code.
drawWebsite(exportCanvas, design, width, artwork, sectionId);
exportCanvas.toBlob(download, 'image/png');Try editing a page and exporting it ↗An enquiry should not disappear.
The form validates required fields in the browser and again on the server. The API limits request size, checks the origin, rejects a filled spam-trap field and rate-limits repeated requests. Email delivery uses a fixed recipient and a verified sender from the server configuration.
The form only reports acceptance after the email provider accepts the request. That is not a guarantee of inbox delivery. If configuration is missing or the provider fails, visitors retain their draft and can open the same message in WhatsApp or an email app.
What stays private
Provider keys, session secrets and visitor records never appear in the client bundle. Contact-action analytics record the action and page, not the visitor’s typed name, email or message. Source repositories are not required to review these examples.
How I’d work with your team.
I’d start with the user flow and the data it needs, agree on the API boundaries, then build and check the happy path and the failures around it. A payment, booking or dashboard should tell someone what happened and what they can do next.
For client systems I can discuss my contribution and walk through the application without publishing private code or customer information.
Arrange a technical conversation ↗