Client project for Marikamba Agencies, an FMCG distributor in Karnataka
DistribuFlow
From an order taken in a shop to a GST invoice, on one system.
Marikamba Agencies supplies groceries and household goods to shops across its routes. Sales executives took orders on paper and by phone, and the office rekeyed them into bills. I built DistribuFlow: an Android app the executives use in each shop, a Windows app where the office reviews orders, issues GST invoices, and tracks stock and payments, and one Spring Boot server behind both that decides every price, tax and total.
- Role
- Sole developer, working with the owner
- Timeline
- October 2026 – present
- Team
- Solo, working with the business owner
- Platforms
- Desktop · Mobile
- Built for
- The distributor's owner and office staff, and the sales executives who take orders in shops
- Status
- Status: Live
At a glance
- Built solo and in daily use: a Spring Boot API, an Electron office app and an Expo Android app.
- The server prices every order line; issued invoices can't be changed, even directly in the database.
- Orders, approvals and price changes reach both apps within about a second, with no refresh.
- 698 backend tests run against a real PostgreSQL database, including the accountant's GST examples.
Built with
The challenge
Orders written in shops, retyped in the office.
A distributor's day runs from the shop counter to the office desk. Executives visit their route's shops and write down orders; the office types those orders into bills, checks stock, sends the goods and chases payment.
Every handover is a chance for a wrong price, a missed line or a duplicate order, and the owner had no single place to see what was ordered, billed, delivered and still owed.
Project objectives
- Let executives take orders in the shop on an Android phone, from the office's own catalogue and prices.
- Give the office one app to review and amend orders, issue GST invoices, dispatch goods and record payments and returns.
- Keep stock correct from purchase to dispatch, with stock reserved for approved orders.
- Produce the sales and GST reports the owner and the accountant need.
- Run on the business's own server, with backups that are tested by restoring them.
My contribution
Sole developer: requirements, architecture, backend, desktop app, Android app, deployment
Planning with the client
- Wrote the delivery plan and agreed the scope with the owner.
- Recorded each business rule as a numbered decision, and who confirmed it.
- Prepared a pack of worked GST examples for the client's chartered accountant.
Backend
- Built the API in Java 21 and Spring Boot: orders, pricing, invoicing, stock, payments, returns, field work and reports.
- Designed the PostgreSQL schema, with every change as a Flyway migration.
- Added role-based access for the owner, billing staff, stock staff and sales executives.
Desktop and Android apps
- Built the office app in Electron, React and TypeScript, with a Windows installer and updates published from inside the app.
- Built the sales app in Expo and React Native: shops, catalogue, cart, order history and the working day.
- Added live updates and notifications to both apps.
Deployment
- Deployed the API and database to a VPS with Docker Compose and Caddy for HTTPS.
- Set up encrypted off-site backups, and ran a restore drill on the production server.
How I approached it
Agree the rules first, then enforce them in one place.
I started from the workflow, not the screens: an order goes from submitted to approved, invoiced, dispatched and delivered, and each step has one owner and one set of rules, all enforced by the server.
Before writing code I wrote a plan, then a decision log. Every rule the software follows is numbered, with its status: confirmed by the owner, confirmed by the accountant, or a default that still has to be checked. More than a hundred decisions are recorded, so when the owner changes their mind, the change is in one known place.
I built it in stages, from the core order-to-invoice flow out to payments, returns, stock and field work, with tests for each rule as it was added. The owner tried each stage and asked for changes, which went back into the log.
Technical architecture
API
Java 21 and Spring Boot 4, organised by area: orders, pricing, billing, inventory, payments, returns, field work, reports and audit. JWT sign-in with refresh-token rotation.
Data
PostgreSQL 18 with Flyway migrations. Database triggers refuse any change to an issued invoice, and changes are recorded in an append-only audit trail.
Office app
Electron with React 19, TypeScript and Vite; TanStack Query for server data, and React Hook Form with Zod for forms. Packaged as a Windows installer.
Sales app
Expo and React Native with Expo Router, built as an Android APK with EAS Build.
Live updates
The server publishes each committed change on a Server-Sent Events stream, and each app refetches only what's on screen. New orders also raise an alert in the office.
Hosting
A VPS running Docker Compose, with Caddy for HTTPS, encrypted off-site backups, monitoring and a separate staging setup.
Quality
698 backend tests on a real embedded PostgreSQL, covering the role matrix and concurrency cases, plus typed, tested clients and CI on GitHub Actions.
Engineering decisions
The server decides every price
The phone shows prices, but it never sets them. The server recalculates every line, discount and tax from the product master. If the catalogue on the phone is out of date, the order comes back with the new figures for the executive to accept, so an old price list can't turn into a wrong invoice.
An order is sent exactly once
On the road, a phone can lose signal halfway through a send. Each order carries an idempotency key, so a retry after an uncertain send returns the order that already exists instead of creating a second one. Tests send the same order in parallel and check that only one is created.
Invoices that can't be rewritten
An invoice number is taken in the same transaction that creates the invoice, so numbers run without gaps even when two people bill at once. The invoice stores a copy of every price and tax at that moment, and database triggers refuse edits. A mistake is put right by cancelling and re-billing, which the accountant can follow.
Stock reserved at approval, removed at dispatch
Approving an order reserves its stock, so the office can't promise the same boxes twice. The stock only leaves the books when the goods are dispatched. Executives see In stock, Low or Out, and can still take an order.
Assumptions kept separate from requirements
Where the owner or the accountant hadn't decided yet, I chose a default, marked it as an assumption in the decision log, and kept it in one place in the code. The GST price model and e-invoicing stay with the accountant to confirm, rather than being guessed.
Key functionality
- Order taking in the shop, with catalogue search and the shop's own history.
- Order review with amendments, approval rules for large orders and big discounts, and rejection with a reason.
- GST invoices with CGST, SGST or IGST, printable and saved as PDF.
- Dispatch, delivery, part-supply and backorders.
- Payments by cash, UPI, cheque or bank transfer, allocated to invoices, with outstanding and overdue balances.
- Returns with inspection, and credit notes.
- Stock ledger, stock counts, reorder levels and damaged-goods write-offs.
- Routes, weekly beat plans, sales targets and check-ins at shops.
- Sales, GST and accountant reports, with CSV exports.
- Live updates and notifications on both apps, and app updates published from the office.
Inside the software.






On a phone
Outcome
In daily use, from the shop counter to the accountant.
DistribuFlow runs on the business's own server, and the office and the sales executives use it every day to take orders, bill, and track stock and payments.
I haven't measured time saved or error rates, so this case study doesn't quote any figures.
In daily use at Marikamba Agencies. The office app and the Android app run against the business's own server, and I'm continuing to add features with the owner.
Built for internal use, so there is no public demo or repository.
Next steps and lessons
Next steps
- E-invoicing and e-way bills, once the accountant confirms what the business needs.
- Confirm the remaining default rules in the decision log with the owner and the accountant.
What I learned
Writing every business rule down with its status made the difference. When the owner asked for a change, the rule, the reason and the code were already in one place, and nothing that was only my guess got treated as a requirement.
Putting the rules on the server first is what made two very different apps practical: the desktop app and the phone app can't disagree about a price or a stock level, because neither of them decides it.


































