Progressive Web Apps - service workers and offline support

Progressive Web Apps (PWAs) combine web and native app features. I register service workers to intercept network requests and enable offline functionality. The service worker lifecycle includes install, activate, and fetch events. Cache API stores ass

Testing Express routes with Supertest + Jest

Route tests give me fast feedback about the API contract without needing a full browser. I structure the app so I can import an app instance without binding a port, then use supertest to make requests. The key detail is determinism: stub time and rand

Keyboard navigation and focus management

Accessible apps support keyboard-only navigation with proper focus management. Tab order should follow visual order, and all interactive elements must be keyboard accessible. I use tabIndex={0} to make custom controls focusable and tabIndex={-1} for p

Typed env parsing with zod

Shipping a deploy with a missing env var is an easy way to create a confusing outage. process.env is just a bag of strings, so I parse env at startup, validate required variables, and fail fast with a clear message. The other win is type safety: once

Recursive queries and hierarchical data with CTEs

Recursive CTEs traverse hierarchical data—org charts, category trees, graphs. I use WITH RECURSIVE for self-referential queries. Base case provides starting rows. Recursive case joins to previous iteration. Understanding termination prevents infinite

Vec<T> for growable arrays with owned data

Vec&lt;T&gt; is Rust's dynamic array, stored on the heap. It grows as needed, amortizing allocations. I use Vec for collections of owned data, return values, and when you don't know the size upfront. Common methods: .push() appends, .pop() removes the

Biometric authentication implementation

BiometricPrompt provides secure authentication via fingerprint, face, or iris. I create BiometricPrompt with callback handling success, error, and failure. PromptInfo configures title, subtitle, description, and allowed authenticators. Negative button

Request deduplication with idempotency keys

Network failures and client retries can cause duplicate request processing, leading to duplicate charges, double-created resources, or inconsistent state. Idempotency keys solve this by tracking processed requests and returning cached responses for du

Builder pattern for object construction

The Builder pattern creates complex objects step-by-step, improving readability and flexibility. I implement builders with static inner classes—fluent methods return the builder for chaining. Required fields use constructor parameters, optional fields

MaybeUninit for safe uninitialized memory

MaybeUninit&lt;T&gt; is the safe way to work with uninitialized memory. It's useful for FFI, performance-critical code, or when you need to initialize large arrays element-by-element. Unlike uninitialized variables (which are UB), MaybeUninit is expli

Paging 3 library for data pagination

Paging 3 loads large datasets incrementally with network and database support. I create a PagingSource implementing load() method to fetch pages. RemoteMediator orchestrates network and database, fetching from API and caching locally. Pager configurat

Build scripts (build.rs) for compile-time code generation

A build.rs file runs before compiling your crate, enabling code generation, FFI binding generation, or environment checks. I use build scripts to generate Rust code from proto files (with prost), compile C libraries, or set cfg flags based on the targ