DEV Community

Momenul Ahmad
Momenul Ahmad

Posted on

Why We Abandoned Backend APIs for a "Sovereign" Client-Side FinTech Engine

When building enterprise FinTech tools, the standard industry playbook usually looks like this: build a React/Vue frontend, send sensitive user financial data via REST API to a heavy backend (like Python/FastAPI or Node.js), crunch the numbers, and send the result back.

But when we built the SEOSiri CapEx Engine (https://capex.seosiri.com) for multinational capital budgeting, we realized this standard API-driven architecture had a massive flaw: Data Privacy & Sovereignty.

To convince CFOs to test complex global capital allocations, we couldn't ask them to transmit highly sensitive financial strategies to an external server. So, we threw out the backend API entirely.

Here is how we built a "Sovereign, Browser-Based" financial engine.

The Architecture: 100% Client-Side Execution

Instead of relying on serverless functions or legacy ERP monoliths to do the heavy lifting, we moved the entirety of our financial mathematics into the client layer.

By utilizing highly optimized JavaScript, we engineered the engine to process everything directly in the user's browser.

  • Zero Data Transit: Because there is no backend API processing the inputs, the financial data never leaves the user's local machine. It is the ultimate form of data security.
  • Zero API Latency: Since we don't have to wait for network handshakes, server cold starts, or database queries, the UI updates with sub-millisecond instant calculation velocity.
  • Instant Edge Delivery: The entire application is a static payload deployed at the edge. Once the HTML/JS loads, the user has a fully functioning, audit-grade financial calculator.

The Challenge: Handling Complex Math in JavaScript

The biggest hurdle with moving FinTech math to the browser is JavaScript's infamous floating-point arithmetic (e.g., 0.1 + 0.2 = 0.30000000000000004). In capital expenditure (CapEx) tracking, being off by a fraction of a cent breaks audit compliance.

To solve this, we couldn't just use standard Math.pow() loops. We had to carefully engineer client-side precision logic to handle:

  1. Net Present Value (NPV): Safe decimal mapping for complex multi-year cash flows.
  2. The Secant-Method for IRR: Internal Rate of Return is notoriously difficult to calculate because it requires algorithmic guessing. We built a custom client-side loop that safely iterates the Secant Method without locking up the browser's main thread.
  3. Automated ESG Deductions: Shadow carbon pricing logic that instantly deducts from the final NPV based on user slider inputs.

The Shift to "Local-First" B2B Software

By eliminating the backend data-processing layer, we achieved two massive wins for B2B FinTech:

  1. Absolute Trust: We can tell enterprise users, "We literally cannot see your data, because our servers never receive it."
  2. Zero Compute Costs: Our infrastructure costs are effectively zero, allowing us to maintain a hyper-lean product lifecycle.

If you are building data-sensitive B2B tools, consider whether you actually need an API backend. Sometimes, the most secure architecture is simply pushing the math back to the browser.

Have you experimented with pure client-side math architectures for complex calculations? Let’s discuss in the comments! 👇

Top comments (0)