Menu
Dev.to #architecture·November 30, 2026

Designing Zero-Backend Web Applications for Offline Functionality and Instant Calculations

This article presents a system architecture for a zero-backend web utility, specifically a construction material calculator, that prioritizes client-side functionality, offline access, and instant calculations. It highlights how architectural decisions like encoding domain logic as deterministic formulas, using parametric SVGs for dynamic UI, and leveraging URL-driven state enable a performant and resilient user experience without server-side dependencies.

Read original on Dev.to #architecture

The core architectural decision for this construction material calculator was to adopt a 100% client-side, zero-backend architecture. This approach directly addresses common challenges faced by users in specific domains, such as contractors on job sites with unreliable internet connectivity, who require immediate calculations and easy sharing without needing account creation or server-side interactions. This strategy moves all computation and state management to the client, contrasting with the typical database-backed SPA.

Deterministic Formulas for Domain Logic

A key enabler for the zero-backend approach is encoding all domain-specific construction norms (like concrete dosages, masonry block counts, and roof pitch conversions) as deterministic TypeScript formulas. This allows for precise, repeatable calculations entirely within the browser. Keeping these coefficients and formulas in pure TypeScript modules simplifies unit testing and, crucially, eliminates API latency, ensuring instant results regardless of network conditions.

Parametric SVGs for Dynamic, Offline UI

To provide intuitive spatial feedback without heavy libraries, the system generates parametric SVG blueprints. These SVGs are dynamically updated based on user input, rendering crisply on various devices. This choice avoids the need for server-side rendering or complex client-side 3D libraries (like WebGL), further supporting the offline-first, performance-optimized design. The SVG elements (lines, markers, text) update reactively, offering an immediate visual representation of inputs.

typescript
const pad = 24;
const scale = Math.min((viewW - pad * 2) / lengthM, (viewH - pad * 2) / widthM);
const rectW = Math.round(lengthM * scale);
const rectH = Math.round(widthM * scale);

Client-Side State Management and Export

For state persistence and sharing, the architecture utilizes URL State Synchronization. Every user input and selection is serialized into query parameters using `history.replaceState`, allowing the exact configuration to be saved and shared simply by copying the URL. Additionally, to facilitate offline sharing of results, a client-side PNG export feature leverages the HTML5 `` API to render a structured summary sheet directly in the browser, bypassing the need for server-side PDF generation or microservices.

💡

Trade-offs of a Zero-Backend Architecture

While offering high performance, offline capability, and reduced operational costs, a zero-backend architecture has trade-offs. It is best suited for applications with primarily stateless or client-side managed state, where complex server-side business logic, persistent user accounts, or large-scale data storage are not critical requirements. For instance, analytics or dynamic content updates would typically require a backend.

client-side architecturezero-backendoffline-firstPWASVGTypeScriptperformanceedge computing

Comments

Loading comments...