How ecommercetool.io Works: A Deep Look Under the Hood
An architectural deep dive into Next.js 14 App Router, deterministic TypeScript engines, and browser storage persistence.
1. The Zero-Backend Architecture Paradigm
Most modern web applications follow a client-server paradigm: user input → network payload → API gateway → application server → relational database → network response. While standard, this architecture introduces network latency (100ms–800ms per action), cold starts, database hosting costs, and security attack vectors.
ecommercetool.io inverts this model completely. The entire application runs as a static, pre-compiled Single Page Application (SPA) executed directly inside the user’s browser JavaScript runtime engine.
Because state mutations happen directly in browser memory without HTTP round-trips, calculations complete in under 5 milliseconds.
2. Pure Domain Calculation Engines
A fundamental flaw in spreadsheet-driven workflows is calculation fragmentation. For example, if a seller updates their return rate in one sheet, that adjustment rarely propagates correctly to inventory stock, net sales, and GST tax liability.
In ecommercetool.io, all business logic is organized into Pure Domain Services written in strictly-typed TypeScript:
3. Browser LocalStorage Persistence Layer
To ensure your data persists across browser reloads without requiring a backend database, ecommercetool.io utilizes a Schema-Validated LocalStorage Abstraction Layer (`storageService.ts`).
Every record (Product, Dispatch, Order, Return, Settlement) is validated against strict TypeScript interfaces before writing to disk. To prevent data corruption during imports or updates, the storage engine takes an in-memory snapshot before writing and automatically rolls back if an anomaly is detected.
// Atomic snapshot & safe write pattern
const snapshot = localStorage.getItem(STORAGE_KEY);
try {
validateSchema(newPayload);
localStorage.setItem(STORAGE_KEY, JSON.stringify(newPayload));
} catch (error) {
// Automatic rollback to restore safety
if (snapshot) localStorage.setItem(STORAGE_KEY, snapshot);
throw new Error("Write failed: Storage rolled back to prior consistent state.");
}4. Static Export & High-Performance Delivery
The entire application is compiled using Next.js 14 App Router into optimized, static HTML/CSS/JS bundles. There is no application server holding your business data, pages paint quickly, and the workspace keeps working offline after the first load.
Free tools for this guide
- DashboardFree ecommerce dashboard for sellers: daily dispatches, expected vs actual returns, physical stock, GST and profit, calculated row by row in your browser.
- SettingsSet business defaults, back up and restore your workspace as a JSON file, check storage health and connect the optional Google Sheets sync.
- Bulk Data Import / ExportBulk import tool for ecommerce sellers in India: import and export products, orders, dispatches and settlements as CSV, with row-level validation first.
- ReportsFree ecommerce GST report tool: daily and monthly profit and loss, product performance, inventory movement and a GST audit built from your own data.
Try it with your own numbers
Open the free seller dashboard: no signup, no fees, and your data stays in your browser.
Open the free dashboard