API error shape that frontend can rely on

Inconsistent error responses cause death-by-a-thousand-cuts on the frontend. If one endpoint returns a string, another returns nested objects, and a third throws HTML, you end up with messy UI conditionals everywhere. I use a small set of stable error

Cursor pagination: opaque tokens with stable ordering

Offset pagination (LIMIT/OFFSET) is fine until it isn’t: it gets slow on large tables and it produces weird duplicates when rows are inserted between pages. For APIs I prefer cursor pagination with an opaque token. The token encodes the last seen (cre

Broadcast job progress updates to a Turbo Frame

Long-running jobs are where Hotwire can feel magical: start an export, then watch progress update live. I give each job a “progress” model, render it in a turbo_frame_tag, and broadcast replacements as the job advances. The job updates percent and sta

Docker containerization for Spring Boot

Docker packages Spring Boot applications with dependencies into portable containers. Multi-stage builds optimize image size—build stage compiles code, runtime stage contains only necessities. I use official OpenJDK base images. Layered JARs improve ca

JavaScript classes and prototype-based inheritance

JavaScript classes provide syntactic sugar over prototype-based inheritance using class keyword. I define constructors with constructor() method for initialization. Using extends creates subclasses that inherit from parent classes. The super keyword c

ActionCable channel that streams Turbo updates safely

Even with model broadcasts, it’s useful to know how streams map to ActionCable channels. Turbo::StreamsChannel is essentially a channel that streams from a signed stream name. When I need custom behavior, I still follow the same scoping rules: identif

Laravel queues for background job processing

Queues offload time-consuming tasks to background workers, keeping web requests fast. I create job classes that implement the ShouldQueue interface and define a handle() method. Jobs are dispatched with dispatch() or Job::dispatch() and run asynchrono

JSON encoding and decoding with Codable

Codable protocol combines Encodable and Decodable for seamless JSON conversion. Swift structs and classes conforming to Codable automatically synthesize encoding/decoding logic when all properties are Codable. JSONEncoder converts Swift types to JSON

BullMQ job idempotency via dedupe id

Retries are great, but duplicates are inevitable—workers crash, Redis reconnects, deploys happen. I prefer building idempotency into the job key itself. BullMQ supports a jobId that acts like a de-dupe key: if a job with the same id already exists, en

Coordinator pattern for navigation flow

The Coordinator pattern separates navigation logic from view controllers, promoting reusability and testability. Coordinators own navigation controllers and decide which screens to show based on user actions. Each flow (onboarding, main, settings) has

Foreign Data Wrappers for external data access

Foreign Data Wrappers (FDW) query external data sources as tables. I use postgresfdw for remote PostgreSQL databases. filefdw reads CSV files. mysql_fdw connects to MySQL. Understanding FDW limitations prevents surprises. Predicates push down to remot

Stimulus controller for drag-and-drop file uploads

Modern file uploads should support drag-and-drop in addition to traditional file inputs. I use Stimulus to handle dragover, drop, and paste events, showing upload previews and progress. The controller prevents default browser behavior for drag events