Skip to main content
@kneeraazon
Client WorkE-Commerce & SitesCase Study

Built for Smart Home Retail · Next.js 16 · Supabase · PostgreSQL · Zod

Everest Smart Traders

Marketing site and content system for a Nepali supplier and installer of gate automation, smart door locks, hotel lock systems, shutter and curtain motors and video door phones. Visitors browse a product showcase, projects, guides and services, search the catalogue and send a quote request. Staff edit everything in an admin built on Supabase (PostgreSQL, Auth, Storage) with row-level security. Built with Next.js 16, TypeScript and Tailwind CSS 4.

OUTCOME.01468Automated tests passing
OUTCOME.02144 / 144Seeded bugs caught by the tests
OUTCOME.0321 to 0npm audit vulnerabilities
2D SYSTEM TOPOLOGY // END-TO-END REQUEST PIPELINE4-STAGE DATA FLOW

Public Pages → Supabase Data → RLS Policies → Admin CMS

FIG.01 // INTERFACE & SYSTEM CAPTURE1 / 10
The Everest Smart Traders home page: a dark-blue hero headed 'Automate. Secure. Elevate.' beside a photo of a smart thermostat and door lock, a call-us card, and a row of four trust figures.
The Everest Smart Traders home page: a dark-blue hero headed 'Automate. Secure. Elevate.' beside a photo of a smart thermostat and door lock, a call-us card, and a row of four trust figures.

Role

Full-Stack Developer

Duration

Since April 2026

Tech Stack

Next.js 16React 19TypeScript 6Tailwind CSS 4Supabase (PostgreSQL, Auth, Storage)Row-level securityZod 4sanitize-htmlVitest and PGliteVercel
SECTION 01 // PROBLEM STATEMENT

The Problem

A business that sells and installs gate automation, smart locks and hotel lock systems in Nepal needs a site that shows what it sells and what it has installed, answers common questions, and turns visits into quote requests. Its staff also need to change products, projects, guides and homepage content without a developer.

The repository started as a Next.js and Supabase site with no tests and 21 known vulnerabilities, and its database rules let any signed-in user make themselves an admin.

SECTION 02 // SYSTEM ARCHITECTURE & EXECUTION

My Approach

  1. Public site. Next.js 16 App Router pages for a showcase of products, projects and gallery, product categories and product pages, projects, blog and tutorials, services, industries, an FAQ, about and contact pages, a quote form and a search, with a WhatsApp button, structured data and a sitemap.
  2. Content system. An admin area for products, categories, services, industries, projects, tutorials, blog posts, testimonials, FAQs, inquiries, a media library, users, settings, and a content manager for homepage sections, announcements and SEO overrides.
  3. Data. Supabase PostgreSQL with row-level security, Supabase Auth for staff and Supabase Storage for images. Roles are admin, editor and viewer, and every server action checks the session and role itself, because a server action is a public endpoint.
  4. Forms. The contact and quote forms and the inquiry API are rate limited per caller and for the whole site, with the counters kept in Postgres. Caller addresses are trusted from proxy headers only on Vercel or when explicitly enabled.
  5. Content safety. CMS HTML is cleaned with an allow-list sanitiser, structured data cannot be closed early by an editor, search text is quoted before it reaches the database filter, and uploads are checked by their bytes and never accepted as SVG or HTML.
  6. Hardening review. It found that a database policy let a signed-in user set their own role to admin, and that anyone with the public key could insert inquiry rows. Both are closed by migrations 004 and 005, with 21 dependency vulnerabilities also removed.
SECTION 03 // VERIFIED OUTCOMES

Results & Impact

Re-run on 2026-11-14 in a scratch copy: type-check, lint with zero warnings, and 468 tests in 22 files all pass.

The site was also run locally on that date against a real PostgreSQL 18 loaded with the repository's schema and seed, behind a small PostgREST-compatible server written for the purpose, because no Supabase project was available. Every public page rendered, and search for 'gate' returned 7 results. A search input built to inject an extra filter matched nothing. The quote form saved an inquiry to the database and showed the confirmation. A demo admin passed the proxy's role check, and the admin's product, edit and content pages loaded with data under row-level security.

Recorded in the repository's work-done.md (2026-11-09): 395 tests then; a mutation check that put 144 deliberate bugs back one at a time, and the tests failed for all 144; npm audit down from 21 vulnerabilities (1 critical, 9 high) to 0; the SQL migrations executed for real in Postgres through PGlite.

Not verified: a real Supabase project (sign-in, storage uploads, Supabase's own PostgREST and its sign-up setting); the deployed site, whose domain did not answer on 2026-11-14; and whether migration 004 has been applied to the production database.