Skip to content
Johan Peña

Client work · Catalog with an admin panelDeployed

TuPatriSeguro

An advisory firm's site with a multi-category catalog the owner edits from a private panel, and a consent record that can show who accepted what, and when.

Visit siteOpen access
Private repository

Overview

TuPatriSeguro advises people who want to buy, sell or invest in property, vehicles and other assets. The site presents the service, publishes a catalog the business manages itself from a password-protected panel, and turns every enquiry into a WhatsApp conversation that carries a reference to a stored consent record.

Problem

The business needed to publish and edit listings without a developer, across categories that describe very different things — a house is not a car — and to collect personal data under Colombian data-protection rules with evidence it could produce later.

What it is

A Next.js site with a public side and a private one. The public side tells the service's story in order — services, process, catalog, guarantees, team, questions, location, contact — and gives each category its own page with search and sorting, and each listing a page with a gallery, an optional video and a WhatsApp button.

The private side is a panel where the owner creates, edits, features, hides and deletes listings, uploads photos, and reviews and exports the consent records.

One catalog for different kinds of assets

The four categories — property, vehicles, products and other — are fixed in one file that the routes, menus and admin all read. Listings live in a single Postgres table; the features specific to each kind (area and bedrooms for a house, mileage for a car) are stored as a JSON list of label and value, so a new kind of feature needs no migration.

Photos go to Vercel Blob from a Server Action and the listing keeps their URLs. After every write the affected pages are revalidated, and listing pages render on each request, so an edit or a deletion shows at once.

  • Search ignores accents and case and also looks inside attribute values; listings without a price sort last in either direction.
  • Each listing generates its own share preview with title, price and cover photo.
  • Favorites and recently viewed are kept in the visitor's browser as ids only; the data always comes fresh from the database.

The admin panel

Access uses a single password from an environment variable, compared in constant time. A successful login sets an HttpOnly cookie holding an expiry and its HMAC-SHA256 signature, valid for seven days, so the server needs no session table.

The proxy redirects any /admin request without a valid session to the login. That check is only the fast path: every Server Action that writes, and the CSV export, verifies the signature again before doing anything.

Architecture

From top to bottom: visitors browse the public pages and the owner uses the admin panel; a Next.js app on Vercel serves both, with a proxy guarding the admin routes and Server Actions handling writes; data lives in two Postgres tables on Neon, one for listings and one for consent records, while photos go to Vercel Blob; enquiries leave the site as WhatsApp messages and embeds load from Google Maps and YouTube only with consent.

Technical decisions

Flexible attributes instead of a table per category
A house, a car and a product share title, price, photos and location, and differ in everything else. Keeping the differences as label–value pairs lets the owner describe anything from the same form, at the cost of not being able to filter by a typed field like bedrooms.
A signed cookie instead of a session store
There is one administrator. An expiry signed with a server secret is enough to prove the session, needs no table, and is verified again by every action that writes.
An append-only consent log
A change of preference is a new row, not an update. The log shows what was accepted at each moment, with the document version, instead of only the latest state.
WhatsApp opens within the click
Browsers block a window opened after waiting for the server, so the consent is recorded in the background while WhatsApp opens. The reference code in the message ties the two together.
Neutralize formulas in the export
Visitors type their own name, and the records are opened in Excel. A cell starting with =, +, - or @ is prefixed so it is read as text.

Evidence

  • 4

    Catalog categories served by a single table

    Source: data/categories.ts · lib/db/schema.ts

  • 3

    Legal documents with their own version, stored with each consent

    Source: data/legal.ts

  • 3 of 3

    Admin writes that re-verify the session

    Source: app/admin/actions.ts

Limitations

  • There are no automated tests and no CI.
  • The admin has one shared password and the login has no attempt limit.
  • A signed session cannot be revoked before it expires, short of changing the secret.
  • Consent is recorded without waiting for the server; if that write fails, the WhatsApp message still opens and its reference has no row.
  • Catalog search runs in the browser over the listings already loaded, which suits a small catalog.

← All work