Knowledge
Technical guides with sample code we ran, its real output, and references.
Websites and web apps27 min readBackground jobs and queues: moving heavy work off the web app screenA background job queue on node:sqlite: leases that expire when a worker dies, idempotency keys, exponential backoff with jitter and a dead-letter table, with runnable TypeScript and real output (Thai text).
Websites and web apps2 min readPolling, SSE and WebSocket: choosing how to update data on screenHow each method delivers updates, the load and complexity each brings, and how often the screen really needs to change.
Websites and web apps2 min readWhat a cache is: a faster website without stale data or someone else's dataWhere caches sit, how long data may be reused, and why private pages must never be cached for everyone.
Websites and web apps24 min readA web app for many companies: separating each organisation's data in a multi-tenant systemIsolating many organisations in one database: tenant_id, composite keys the database enforces, a repository that takes the tenant from the session, and cross-tenant tests, with runnable TypeScript, real output and PostgreSQL row-level security SQL (Thai text).
Websites and web apps29 min readOnline booking for service businesses: designing time slots, capacity and cancellationsDefining slots and capacity, holding a slot while the customer confirms, and clear cancellation and rescheduling rules.
Websites and web apps27 min readA preliminary price estimator on the website: calculating so customers understand the conditionsA price estimator whose business rules live in one versioned file: integer satang, explicit rounding, VAT shown separately, a reason for every line and reproducible old quotes, with runnable TypeScript and real output (Thai text).
Websites and web apps28 min readConnecting payments to a web app: handling paid, duplicate payments and refundsA payment webhook that verifies an HMAC signature on the raw body, deduplicates by event id and never moves an order status backwards, with runnable TypeScript, real output and PostgreSQL SQL (Thai text).
Websites and web apps24 min readImporting Excel and CSV into a web app: checking data before saving and reporting errorsA CSV importer that runs a per-row dry run, reports errors by line and column, copes with BOM, Buddhist-era dates, leading zeros and duplicates, then imports all-or-nothing in one transaction, with runnable TypeScript and real output (Thai text).
Websites and web apps2 min readWebhooks that never arrive or arrive twice: designing retries and reconciliation between systemsAcknowledging quickly, ignoring duplicates by event ID, retrying failed deliveries, and a periodic check that both systems agree.
Websites and web apps27 min readAudit trail vs change history: knowing who changed what in a web appA trustworthy audit trail for a business web app: who changed what, written in the same transaction as the change, masked sensitive values, point-in-time reconstruction and hash-chain tamper detection, with runnable Node 24 code and real output (Thai text).
Websites and web apps24 min readXSS, SQL injection and CSRF: understanding web risks well enough to talk with developersThree web flaws side by side in a localhost-only demo: vulnerable and fixed handlers, runnable Node 24 code, real output and tests (Thai text).
Websites and web apps2 min readSessions and signing out: designing expiry, revocation and account recoveryHow long a session should last, ending sessions after password changes or on request, and a recovery flow that does not reveal accounts.

