Independent portfolio case study · PropNex listing snapshot · HDB resale transactions · Not affiliated with or endorsed by PropNex Limited
Engineering case study · v1.0

One home search.An entire systemin motion.

Follow a request from a renter's first filter to indexed SQL, guarded AI, correlated logs and a production release. This is the architecture behind HomeScope SG—made visible.

BrowserNext.js
EdgeNginx
APISlim
DataMySQL
CacheRedis
request_idhs_7f2a9c
p95 < 300ms
guarded
300+synthetic homes
6runtimes & stores
15 daysmetric history
1 IDend-to-end traceability
01 · System overview

Purposefully small surface.
Production-shaped underneath.

The product is split by responsibility, not fashion. The browser gets fast rendering and resilient cache; PHP owns domain rules; MySQL owns truth; Redis absorbs temporary work; telemetry stays private.

Hybrid production topology
VercelNext.js UI + BFF
Tailscale FunnelEncrypted origin
NginxRouting + request ID
Slim APIBusiness rules
MySQLSource of truth
RedisCache + quotas
Shared origin secret Cache invalidation after sync Correlated JSON logs
Experience

Next.js 16, React 19, TypeScript, Tailwind CSS, GSAP, TanStack Query

API

PHP 8.3, Slim 4, PDO, Monolog, OpenAPI, PHPUnit

Data

MySQL 8.4, spatial indexes, Redis 7, raw parameterised SQL

AI

TanStack AI, 9Router, OpenAI-compatible SSE, Zod tool contracts

Quality

Vitest, Testing Library, Playwright, PHPStan, Lighthouse

Platform

Docker Compose, Nginx, Vercel, Tailscale, GitHub Actions

02 · One request, end to end

The path is layered.
The experience is one.

Scroll through the five boundaries a search request crosses. Each layer adds one kind of certainty.

browser
edge
API
data
result
Active boundary01 / 05
01

The browser owns intent

Next.js App Router server-renders the entry point. Search filters live in the URL, so every result is bookmarkable, shareable and restorable after opening a listing.

React 19 · App Router · TanStack Query · Zod
02

The edge establishes trust

Nginx keeps the public surface small, preserves or creates a request ID and routes API and AI streams without exposing internal metrics or service ports.

Nginx · same-origin BFF · origin secret · SSE
03

The API applies policy

Slim middleware validates input, authenticates short-lived JWTs and enforces Redis-backed rate limits before controllers can reach business services.

PHP 8.3 · Slim 4 · DI · JWT · Argon2id
04

The data layer does less work

Repositories execute explicit prepared SQL. Spatial and composite indexes narrow candidates first; cursor pagination avoids the increasing cost of deep OFFSET scans.

MySQL 8.4 · PDO · POINT SRID 4326 · Redis 7
05

Every result is measurable

The response carries the same request ID back to the browser while bounded metrics and redacted JSON logs describe the path without collecting personal content.

Prometheus · Loki · Alloy · Grafana
04 · AI property advisor

Helpful by design.
Bounded by default.

The assistant cannot browse, execute code or invent inventory. Authentication happens before inference; classification happens before advice; read-only tools are the only path to listing data.

Authenticated users only Fail-closed classifier Validated read-only tools No chat content in logs
Advisor gateway
STREAMING
Find me a 2-bedroom condo near an MRT below S$1.8m.
01 · passAuthorize

JWT + quota

02 · allowClassify

property_search

03 · read-onlyTool call

search_listings

04 · streamRespond

grounded cards

Prompt injectionBlocked before advisor or tool execution
DENY
Input2,000character limit
Context20message maximum
Tools2both read-only
Output≤ 5grounded listings
Quota10/minper authenticated user
05 · Observability

When something fails,
follow one identifier.

A request ID connects a browser error to the exact edge and application events. Metrics answer “how often”; logs answer “why”—without storing identity or conversation content.

Live request tracerequest_id = hs_7f2a9c200 OK
Nginxrequest.accepted0 ms
Next.jsbff.forwarded8 ms
PHPlisting.search23 ms
Rediscache.hit27 ms
Nginxresponse.completed31 ms
15 days

Metrics

Rates, latency histograms, cache outcomes, quotas and dependency health.

7 days

Logs

Redacted JSON events joined across Nginx, Next.js and PHP by request_id.

Telegram

Alerts

SLO-aware rules for errors, p95 latency, providers, resources and restarts.

Availability objective99.9%
API latency alertp95 > 500ms
Error-rate alert5xx > 5%
Private accessSSH tunnel
06 · Delivery loop

From commit to signal,
then back to a better commit.

01

Commit

Feature-sized history keeps design and infrastructure decisions reviewable.

02

Verify

Typecheck, unit, integration, browser and configuration checks gate the build.

03

Package

Pinned Docker images make PHP, Nginx, databases and telemetry reproducible.

04

Release

Vercel serves the frontend; the private origin is exposed only through Tailscale Funnel.

05

Observe

Readiness smoke tests and live signals close the deployment feedback loop.

Decisions, not defaults

Deliberate trade-offs

A portfolio system should show judgment—not pretend every choice is universally correct.

Raw SQL over an ORM More control and explainable plansTrade-off · More repository code to maintain
Hybrid hosting Fast global UI and private self-hosted dataTrade-off · Two deployment surfaces
Short search cache Fast repeats without stale inventoryTrade-off · Lower maximum hit ratio
Session-only AI history Privacy and zero chat persistenceTrade-off · No cross-device continuity
That is the system.

Now experience the product it supports.