Problem
When I first met my client, they were running their fertilizer shop the way many small businesses do, with handwritten records, scattered Excel files, and a monthly ritual of trying to make sense of it all. What started as a simple digitization project became a comprehensive business transformation that's been serving them reliably for over two years.

This is an AI-generated image, not an actual before-and-after image.
The client's pain points were all too familiar for traditional retail operations. Important business records would go missing, month-end calculations rarely matched, and there was always that nagging uncertainty about whether the numbers were actually right. They were spending entire days trying to reconcile accounts, often without success.
Constraints
Calculations had to be exact. Fertilizer pricing and stock math involve messy multi-step formulas, and a single wrong figure breaks trust in the whole system. So I enforced ACID transactions at the database level for every operation.
The app had to replace the manual workflow, not run alongside it. That meant zero tolerance for data loss and daily usability for a non-technical shop owner.
It needed to stay cheap to run. I went with a serverless architecture so the client pays almost nothing at low traffic, but the app still holds up in production.
Later, when I modernized the codebase, all existing business logic and data had to survive the migration intact.
Approach
I built it full-stack on Next.js with PostgreSQL. The calculation engine handles the fertilizer-specific math and validates results instantly, so the owner sees correct numbers the moment a transaction is recorded, not at month-end. Database transactions keep every write consistent, and an audit trail replaces the notebook.
The first version ran in production for over two years on the Pages Router with Material-UI and NextAuth. Then I rebuilt it: migrated to the App Router, moved the UI to Tailwind and shadcn/ui, replaced API routes with server actions, and swapped NextAuth for Clerk. All calculation logic and historical data carried over without loss.
Outcomes
2+ years of continuous production use, replacing handwritten and Excel records entirely
Zero data loss incidents since launch, against frequent losses in the manual system
Month-end reconciliation eliminated. Calculations now verify in real time
100% calculation accuracy through database-enforced transactions, removing manual matching errors
Full codebase modernization shipped with no downtime in business workflows and no lost data
Stack: Next.js