Skip to content
LogicSpark Technology logo
All case studies

SaaS Platform · Natural-Resource Extraction & Heavy Operations

ResourceFlow

A multi-tenant operations platform running extraction, fleet, inventory and sales on an auditable ledger.

Overview

ResourceFlow is a multi-tenant resource and operations management platform that runs an entire extractive-materials business end to end, extraction, refining, warehousing and sales. First implemented for sand-mining operations, every domain term (material, units, grade, source) is a tenant-configurable label, so the same system serves quarrying, timber, grain, minerals and aggregates. Each operator gets a fully isolated tenant with its own users, roles, data and documents.

The challenge

Extractive operations juggle inventory, money, fleet and compliance across disconnected spreadsheets and paper, with no single trustworthy source of stock or financials. For licensed, regulated businesses that is a real risk: cached stock numbers drift, financial records are hard to audit, and license documents expire unnoticed. The client needed one source of truth where stock balances are always derived rather than cached, every write is audited, and multiple operators can run on the same platform in complete isolation.

What we built

We built ResourceFlow on Next.js 14 with a tRPC API (25 routers) over MongoDB via Mongoose. True multi-tenancy is enforced by a Mongoose plugin that injects tenantId on every collection using AsyncLocalStorage. Inventory is ledger-based, current stock is always computed by aggregating an immutable ledger rather than stored as a mutable number. Role-based access control bundles module-action permissions and is enforced per tRPC procedure. Modules span licenses, extraction, refineries, inventory, procurement, customers, sales, invoices, payments, contractors, fleet and maintenance, drivers, trips, documents (S3, expiry-tracked), reporting and alerts. Multi-document operations run inside MongoDB transactions, and every change is captured in a full audit trail with before/after state, user, IP and user agent.

Results

ResourceFlow replaces fragmented spreadsheets and paperwork with a single auditable system across extraction, fleet and sales. The ledger plus full audit log produce tamper-evident inventory and financial records well suited to regulated, licensed operations, while expiry-tracked documents and a daily alerts engine keep compliance current. Because domain labels are tenant-configurable, the platform is reusable across material verticals without code changes, and clear Owner/Manager/Operator/Viewer roles reduce operational risk.