Rukon
Blog · Page 2 of 5

Notes from building real systems.

Notes on production and operations systems, full-stack development, AI applications and web development, written from real project work in Cyberjaya rather than from tutorials.

  1. Building Real Systems

    A Stock Request Portal With a State Machine and an Event Log

    The lifecycle behind the RPOMS Ecommerce portal: a transition table, terminal states, a void that reverses, version-checked edits and an event per step.

    5 min read

  2. Full-Stack Development

    Out-of-Order Responses on Filter Changes: Only the Newest Request May Write

    Filters that apply on change put several fetches in flight, and the slow broad one often lands last. A ticket per request in a React ref keeps the screen answering the current question.

    3 min read

  3. Building Real Systems

    Splitting RM 10 Three Ways: Integer Sen and the Largest-Remainder Method

    Floating-point money drifts and naive splits lose a sen. Integer sen at one boundary and the largest-remainder method, so shares always add up.

    4 min read

  4. Full-Stack Development

    Sorting Apple Vision Text Into Lines Without Crashing Swift's Sort

    VNRecognizeTextRequest returns boxes, not lines. Sorting them top to bottom and left to right with a comparator Swift's sort can trust.

    3 min read

  5. Full-Stack Development

    Sharing One Supabase Project Between Two Apps Safely

    A second app inside an existing Supabase project: prefixed tables, RLS on with no policies, revoked grants, server-only access and an admin check for a shared user list.

    4 min read

  6. AI & Automation

    Shadow-Testing a Replacement Model With Next.js after(), Without the User Waiting

    How RPOMS AI is built to run a candidate model on real requests after the response is sent, record whether it agreed, and never show it. The lifecycle around it, and its limits.

    4 min read

  7. Building Real Systems

    Detecting a Device Model From Its Serial Number With Prefix Rules

    How RPOMS and its print engine tell a router's model from its serial: prefix and length rules stored as data, longest prefix first, unknowns flagged.

    5 min read

  8. Malaysia & Cyberjaya

    Telling the Sender Bank From the Recipient on a Malaysian Transfer Receipt

    A CIMB to Maybank transfer receipt names both banks. Reading the receipt's structure to attribute the payment to the bank that actually sent it.

    5 min read

  9. Full-Stack Development

    Self-Hosting a Node and PostgreSQL Service With nginx and systemd on Ubuntu

    The deployment behind print.rukon.dev: one origin for a PWA and API, a hardened systemd unit, atomic releases, nginx header gotchas and a backup design.

    7 min read

  10. Full-Stack Development

    Baseline Security Headers in Next.js, and Why the CSP Waited

    Adding five response headers to a Next.js site that served none, why the Content-Security-Policy was deliberately deferred, and a nonce-free CSP on another app.

    4 min read

  11. Full-Stack Development

    Security Headers for a Web Bluetooth PWA, Pinned by a Test

    The CSP, Permissions-Policy and COOP for a PWA that drives a Bluetooth printer, why each source is there, a separate policy for the API, and a test that keeps nginx and the app in step.

    5 min read

  12. Full-Stack Development

    When the Code Ships Before the Migration: Degrading One Schema Level at a Time

    Selecting a column that a pending migration adds made PostgREST fail every library read. The fix degrades one migration tier at a time, so deploy order stops mattering.

    4 min read

  13. Building Real Systems

    Schema Setup on Cold Start: One Statement, One Winner, and a Building Sentinel

    Serverless instances that create tables on first use race each other and hold exclusive locks. How RPOMS claims the schema build with one SQL statement, and the bug in the first version.

    4 min read

  14. AI & Automation

    Running Qwen2.5-VL 7B on an Intel Iris Xe With Ollama and Vulkan: 119 s to 41 s

    Setting up a 7B vision model on a Windows laptop with no discrete GPU: enabling the Iris Xe under Ollama, where the time actually goes, and what the GPU profile showed.

    5 min read

  15. UI/UX & Product

    Adding Arabic (RTL) to a Next.js Dashboard Without Translating the Whole App

    Publishing the RPOMS dashboard in Arabic: a typed dictionary that fails the build, dir on one wrapper not <html>, an LTR chart, and Latin digits.

    4 min read

  16. UI/UX & Product

    Defaults Are Claims: Removing Placeholder Numbers That Looked Like Measurements

    A 75% tank, a 10 km/L economy, a hardcoded user id: defaults in DriveKeep that rendered as real data, what replaced them, and the same rule in SpenDrop.

    5 min read

  17. Developer Journey

    Working Through a 44-Finding Code Audit, Six of Them P0, Without Losing Data

    How I worked through a forensic audit of a live operations system: the four root causes behind 44 findings, a second pass that caught my own regressions, and what I chose not to change.

    5 min read

  18. Full-Stack Development

    Rate Limiting a Public Endpoint on Serverless, Keyed by an HMAC of the Address

    Two layers for an anonymous upload endpoint on Vercel: an honest in-memory burst limiter, and a durable hourly count in Postgres keyed by an HMAC so the address is never stored.

    4 min read

  19. AI & Automation

    A Qualification Gate: Computing What a Model Is Allowed to Decide From Its Own Results

    Instead of trusting a model or not, RPOMS AI computes per verdict and per criterion what the model has earned the right to say, from a reference run. The policy, the code and the trade-off.

    4 min read

  20. Full-Stack Development

    Promise.race Timeouts Don't Cancel Queries, and That Emptied My Connection Pool

    A read deadline built on Promise.race walks away from a query that keeps running and keeps its pooled connection. How that fed on itself on Vercel, and the bounds that fixed it.

    4 min read

  21. Full-Stack Development

    A Production Write Lock That Fails Safe: Only Named Modules May Write

    How RPOMS keeps finished modules from writing in production until sign-off: a middleware lock that is on by default in production and an allowlist matched by path segment.

    4 min read

  22. Full-Stack Development

    postgres.js Dropped the Microseconds From My timestamptz Parameter

    A revision check refused every save because a bound timestamptz went through a JavaScript Date and lost its microseconds. One extra ::text cast fixed it.

    3 min read

  23. Full-Stack Development

    postgres.js Stored My JSON Arrays as Strings in a jsonb Column

    Writing JSON.stringify(x)::jsonb through postgres.js encodes the value twice, so a jsonb column holds a string, not an array. The symptom, the sql.json() fix, and handling rows already stored.

    3 min read

  24. Full-Stack Development

    Bulk Inserts Past PostgreSQL's 65,535 Bind-Parameter Limit: unnest and Chunks

    A multi-row VALUES insert with six parameters per row failed outright above 10,922 rows. Replacing it with unnest over array parameters, chunked, and why the import is not one transaction.

    3 min read

  25. Full-Stack Development

    Porting a Static Page to Next.js Without Visual Drift

    Rebuilding a finished page in Next.js 16 and Tailwind 4 so it looks identical: the font fallback, image optimiser and class-conflict traps, and how drift was checked.

    5 min read

  26. Developer Journey

    Planning a University Project Like a Real One: Milestones, Risks and a Decision Log

    The first commit of ResearchForge had no code: a plan with milestones, a risk register, a definition of done and numbered decisions. What that structure caught, and where the plan was wrong.

    5 min read

  27. Building Real Systems

    Apple Pay Is Not a Bank: Payment Channels, Funding Accounts and Reconciling Double Records

    One purchase can arrive as an Apple Pay tap and again as a bank record. Separating how you paid from where money came from, and merging the duplicate.

    6 min read

  28. AI & Automation

    One Pydantic Schema, Two LLM Vendors: Native Parsing vs JSON Mode

    The same Pydantic models drive structured output from Anthropic's native parsing and Groq's JSON mode. Forbidding extra fields, catching truncation, and validating instead of repairing.

    3 min read

  29. Building Real Systems

    Preview and Commit From the Same Plan: Stock Transfers You Can Reverse Exactly

    In RPOMS one pure function plans a stock transfer: the preview shows it, the commit re-runs it, and a void inverts the frozen executed plan exactly.

    5 min read

  30. Full-Stack Development

    One SQL Function for a Whole Analytics Dashboard

    Every figure on a small analytics dashboard, totals, a gap-free time series and ranked breakdowns, returned as one JSON document by one PostgreSQL function, in the owner's time zone.

    4 min read

  31. Building Real Systems

    Deletes That Don't Come Back: Tombstones and Last-Write-Wins in Offline Sync

    In offline sync, a deleted record comes back when another copy is pushed. DriveKeep's soft deletes, tombstone list and timestamp merge, and its clock problem.

    4 min read

  32. AI & Automation

    Reading an Odometer Photo: Preprocessing Variants, Tesseract.js and a Plausibility Check

    DriveKeep's web app reads four sharp-preprocessed variants of an odometer photo with Tesseract.js and ranks every candidate against the previous reading.

    4 min read

  33. Full-Stack Development

    Two Windows Bugs in a Node Launcher: "C:\Program" and a PATH That Hadn't Updated

    A one-command launcher for Ollama, a gateway and cloudflared broke on Windows twice: shell: true split the node path at its space, and a fresh install was not on the open terminal's PATH.

    3 min read

  34. Full-Stack Development

    Next.js Open Graph Metadata Replaces, It Doesn't Merge

    A child route that sets its own openGraph object silently drops the layout's og:image and og:locale. Why Next.js does that, and the helper this site uses to stop it.

    3 min read

  35. Full-Stack Development

    An Error Boundary That Retried Into the Outage: Backoff With Jitter

    A Next.js error.tsx that retries on its own is right for a wall display, and wrong if every open screen retries in lockstep. Longer waits, jitter and a slow interval that never stops.

    3 min read

  36. Full-Stack Development

    Refreshing a Supabase Session in Next.js 16's proxy.ts, and Not Authorising There

    Next.js 16 renamed Middleware to Proxy. Using proxy.ts only to refresh a Supabase session cookie for admin routes, while every page and API route checks authorisation itself.

    3 min read

  37. Building Real Systems

    Why My App No Longer Creates Indexes When It Deploys

    A plain CREATE INDEX in a cold-start schema build locks a busy table as a side effect of shipping code. Moving indexes to CONCURRENTLY migrations, and what the app still does.

    4 min read

  38. Building Real Systems

    Spending, Cash Flow and Who Owes Whom: Modelling Shared Bills in a Personal Finance App

    When a bill is shared, 'how much did I spend?' has three honest answers. SpenDrop's rules for spending, cash flow, refunds and balances.

    5 min read

  39. Building Real Systems

    Modelling a Multi-Stage Refurbishment Pipeline in Excel

    Following one laptop through an Excel stock tracker: a completeness gate at receiving, an automatic hand-off list, status derived from department ticks, e-commerce counts, and EDATE warranties.

    5 min read

  40. Building Real Systems

    Measured or Estimated: Calculating Fuel Economy Only From Full Tanks

    Dividing a top-up into the distance driven gives a meaningless economy figure. How DriveKeep measures km/L only from full tanks and labels estimates.

    5 min read

Also available as an RSS feed.