backend
Technical notes on web development, DevOps, and AI integration.
157 articles
- 16:55backend
A Format-Aware Intake Converter for XLSX, DOCX, and PDF
A practical design for converting spreadsheets, Word documents, and PDFs into structured and readable intake digests.
TL;DR: This converter processes XLSX, DOCX, and PDF batches with format-specific readers under one shared workflow, leaving originals untouched. Spreadsheets get formula recalculation via headless LibreOffice, typed JSON, and Markdown output; Word and PDF convert to Markdown with layout limits and no OCR. Failures are logged per file while the batch continues, but a failing exit status flags results for review.
#python#data-import#automation - 07:25backend
A GET-Only Door for External Data
A read-only API gateway for external data: env-JSON allowlist, Redis cache, static error bodies, and 20 offline tests behind one GET-only door.
TL;DR: Rather than expose upstream API credentials in the browser, the author built a small FastAPI read-only gateway for KotaPortal's feeds. It allows GET only via per-source allowlists, caches JSON in Redis with clamped TTLs, and hides upstream errors. All 20 tests run offline; the one gap is a missing Allow header on 405 responses.
#fastapi#redis#httpx - 19:39backend
The PDF Travels With Its Page, the Link Does Not Wander
A ../../../ link out of a generated docs folder is valid while the tree is whole, and dead the moment the folder is handed over. The PDF now moves with it.
TL;DR: A relative link that navigates up the directory tree breaks the moment the docs folder gets handed off as a standalone package. The fix copies PDFs next to their referencing pages so each folder becomes a self-contained unit with working internal links. Failing loudly on missing files prevents shipping broken artifacts, and a simple folder-relocation test catches any remaining dependency issues.
#nodejs#javascript#documentation - 18:06backend
Official Docs Drift, the Generator Fails Loud
When a documentation generator ingests reports it does not own, tolerant parsing ships truncated pages. Explicit markers plus a throw keep drift visible.
TL;DR: When a report team's HTML restructure broke the generator's extraction markers, the author chose fail-fast over tolerant parsing, because catching and skipping just turns failure into silence. Now missing markers or media halt the build with clear errors. Official documents also get top sidebar placement, backed by eyetracking data on above-the-fold attention.
#nodejs#documentation#generator - 01:38backend
Where's the CRUD? Two Contracts Behind the Word "Delete"
A product owner asked where the CRUD was. The API had add and edit only, and the delete was hiding in a status flag all along.
TL;DR: A product owner's "where's the CRUD?" question made the author assume delete was missing, but the code revealed the module uses logical deletion via a Nonaktif status, keeping data recoverable. Adding physical delete would've introduced an unwanted contract and data-loss risk. The real fix was documentation: explicitly stating capabilities, the delete contract, and why permanent purging isn't provided.
#api-design#crud#dokumentasi - 01:21testing
KotaPortal's Silent E2E Cleanup Leak and the 401 Nobody Read
A cleanup sweep that ran in full still leaked: every request came back 401, fetch never rejected, and six demo entities stayed behind.
TL;DR: KotaPortal's E2E cleanup sweep silently failed because every DELETE got a 401, yet the hook passed since fetch resolves normally on non-2xx statuses. Playwright's storageState only saves cookies and LocalStorage, not Authorization headers, so requests went out unauthenticated. The fix: extract the token from state, attach it as a Bearer header, and fail hard when any response isn't okay.
#playwright#e2e#http - 20:10backend
A Past Schedule Publishes Now: Three CMS Scheduling Contracts
Two parity assertions showed a past scheduled_at publishing instantly and a future event_date only setting sort order.
TL;DR: A parity test showed a past scheduled_at gets published instantly in the POST response, so there's no cron worker; treat published as derived from the current time. A future event_date still publishes immediately, proving it only controls sort order, not visibility. Keep both fields separate and trust the admin response for effective status.
#cms#scheduling#wordpress - 20:00backend
The Settings Row Was Right and the API Was Wrong
A direct SQL insert updated the row but the settings API kept serving the old value from its boot-time snapshot. The three-layer debug order.
TL;DR: A direct SQL write updated the row, but the settings API kept serving the old value because it answers from an in-memory snapshot built at boot. The footer and JSON-LD disagreeing in one render signaled a freshness problem, not a storage one. Restart the API after direct writes, and verify layer by layer before trusting any single reader.
#caching#cache-invalidation#debugging - 00:28backend
Why "Popular Articles" Stay Stale — and How to Fix It with a 7-Day Rolling Score
Query sort=popular used total view_count so old articles always won. Fix: 7-day rolling score from entity_view_daily + deterministic tiebreak + random filler limit 9.
TL;DR: The "Popular Articles" section showed outdated items. A 7-day rolling score was implemented to fix this. Old articles no longer always rank highest.
#database#performance#mysql