Skip to content

Custom internal system · in production

The route closes itself and the driver sells without signal: an ERP for a wholesale distributor

From a spreadsheet with three blocks of columns pasted side by side to a system where inventory, routes, customer credit and cash reconcile. Nineteen modules in six phases, in production since August 2026.

Client
Distribuidora del Golfo
Industry
Wholesale and retail distribution with route sales · Morelos, Mexico
19
Modules in scope
6
Phases accepted working
1,148
Automated tests
about 6 weeks
Development time

The problem

The scope document said it in one line: control was manual and scattered across four fronts at once: inventory, routes, customer credit and cash.

  • Warehouse and truck inventory lived outside any system; knowing what left, what sold and what came back depended on someone reconciling it by hand.
  • Customer credit (limit, terms, balance, due dates) had no single place and no rule preventing over-extension.
  • Cash handed in by each driver at the end of the day was never automatically compared against what was owed.
  • The business wanted to grow in routes and catalog, and manual control does not scale.
  • Two field conditions ruled out off-the-shelf software: drivers work in areas without signal, on mixed Android and iPhone devices, and the business has its own rules (prices per truck, commissions per driver or product, per-route driver meal allowance, drivers do not extend credit on the street).

Before

  • Inventory: one spreadsheet with three blocks of columns pasted side by side: catalog, route inventory and weekly sales. One price per product, no wholesale/retail or warehouse/truck distinction, no purchase costs.
  • Routes, credit and cash: manual and scattered, as the agreed scope stated.

What we built

PhaseDelivered working
1. Core and catalogDatabase and role-based access. Products and categories. Independent inventory per warehouse (central and each truck) with wholesale and retail prices per product per warehouse, minimum stock and valued inventory.
2. Warehouse, routes and point of saleTransfers between warehouse and trucks with folio and responsible user. Routes with customers and driver. Load opening and closing. Counter POS with receipt. Four-screen driver app: home, sell, collect, expense.
3. Credit, collections and cashCredit limit and terms per customer, statement with aging, automatic blocking of sales over the limit, daily collections. Daily cash with expected vs delivered and the difference computed by the database.
4. Purchases, costs, commissions and profitSuppliers and purchases that update inventory on their own; average and last cost; commissions per driver, product and category with a five-level hierarchy; profit by product, customer, seller and route.
5. Reports, alerts, dashboard and auditCash flow by concept, product analytics, per-driver report. Four live alerts. Trigger-based audit log over fifteen tables; sales are never deleted, only cancelled with a reason. Nine-indicator dashboard.
6. Offline, bulk import, backup and deliveryThe driver app works all day without signal and syncs in order when the network returns. Bulk import from the client's spreadsheet with a row-by-row preview. Daily encrypted backup in two places, one of them the client's own account. User manual inside the app.

Adjustments after delivery

  • Integer quantities in every capture and driver commission deducted automatically at load closing.
  • Purchase cost editable by hand on the product card.
  • Truck onboarding by the owner from the system itself.

Screens

ERP dashboard showing sales for the day, receivables, valued inventory and vehicles on route
The owner's dashboard: nine indicators, each one linking to the report behind it.
Inventory screen with one tab per warehouse and totals valued at cost and at sale price
Separate inventory per warehouse: the depot and each vehicle, valued at cost and at sale price.
Product page with a table of prices and minimum stock per warehouse
Every product carries retail price, wholesale price and minimum stock, set per warehouse.
Route screen with the open load, the assigned driver and the loaded value
An open load: departure time, driver on record, and what went out valued at cost and at price.
Daily cash screen with opening float, cash sales, expenses, deposits and estimated cash
The day's cash builds itself: float, cash sales, expenses and deposits produce the estimate.
Receivables report with customers sorted by the most overdue balance
Receivables: the most overdue first, with each customer's days past due.
Customer account statement with charges, payments and balance aging
Per-customer statement: charges, payments and how old the balance is.
Profit report by product with sales, cost, profit, commission and net profit
Profit by product, customer, salesperson or route, with commission already deducted.
Point of sale blocking a credit sale because it exceeds the customer's limit
The credit limit is enforced on screen: the sale exceeds it by $150, the system says so and disables the charge.
Alerts screen with low stock, out of stock, credit exceeded and overdue balances
Four live alerts, plus the tray of operations the server rejected.
Audit log showing who changed what and when, by table and by user
Audit log written by database triggers: who changed what, when, and what the previous value was.
Two screens from the driver app: the load summary and the first step of a sale
The driver app on a phone: the load summary and a four-step sale with large buttons.

How it was built

  1. 01

    Written product definition

    Nineteen-module scope, business rules validated with the owner and a six-phase plan with a deliverable per phase. Nothing was renegotiated silently.

  2. 02

    Design system before the first screen

    One visual language for the admin area and the driver app.

  3. 03

    Plan per phase, tests first, review

    Every task was built with tests written before the code and reviewed before merging.

  4. 04

    Quality gate before closing each phase

    Clean build and four green suites. Delivery run: 1,148 automated tests, including one that verifies inventory, cash, credit and profit reconcile with each other, and a cold-start test with the network off.

  5. 05

    Verification with evidence

    The 'Requirements met' document maps all 19 modules to the exact screen where each is fulfilled and names what is missing.

  6. 06

    Delivery and production

    Six PDF documents, training, restore of the backup tested. Live since August 18, 2026 with 183 products imported from the client's spreadsheet.

Technology

Next.js 15, React 19 and TypeScript; Tailwind 4 with a single design system; Supabase (PostgreSQL with row-level permissions, atomic functions per business operation and trigger-based audit log); offline-first PWA with an IndexedDB write queue; Vercel with a custom domain. Tests with Vitest, pgTAP and Playwright. 49 migrations, 24 tables, 6 views.

Verified figures

Modules in scope
19
Phases accepted working
6
Automated tests
1,148
Development time
about 6 weeks
In production since
Aug 18, 2026
Products imported from the client's spreadsheet
183
Migrations · tables · views
49 · 24 · 6
Delivery documents
6

Business metrics (route closing time, cash differences, overdue receivables) will be published once the client measures them after 90 days of use. We do not estimate any.

What changed

Drivers sell, collect and log expenses without signal

From their phone; the system sends everything on its own when the network returns, in order and without duplicates. No signal is the normal mode of work, not a failure.

Route closing reconciles itself

On closing a load, the system computes what was sold, returned and the difference, and compares the cash the driver must hand in against what they deliver.

Credit limits are real

A credit sale over the customer's limit is rejected with balance, limit and available amount shown before charging.

Cash cut computed by the database

Opening float, cash sales and payments, expenses and deposits, with the difference shown in red when it does not match.

Everything in one place

Inventory per warehouse, prices per truck, purchases and costs, commissions, collections and cash, with a nine-indicator dashboard on login.

The client owns everything

Code, database, domain and a daily encrypted backup stored in their own account; the technical manual lets any developer continue.

Sound familiar?

Inventory in spreadsheets, sales reps on the road, credit you only know about on Friday. Tell us how you run it today and in 20 minutes we will tell you whether a custom system makes sense.