Client project

Riziki Chemicals

A company website plus a full mixing, stock and point-of-sale system for an industrial-chemicals business that repacks bulk drums, blends its own formulas, and sells retail and wholesale on credit.

year
2026
role
Product design & full-stack engineering
type
Client project
stack
7 technologies
RC

The problem

Riziki buys detergent chemicals in bulk drums and bags, repacks them into smaller sizes, and blends finished products from its own recipes — then sells to walk-in retail and to wholesale buyers who take goods on credit. All of it ran on paper. Stock never reconciled, credit was tracked from memory, and the owner's formulas and margins had to stay invisible to counter staff.

My approach

I built two applications: a public website for products and enquiries, and a point-of-sale system covering the whole operation — selling, invoicing, stock, repacking, batch production from versioned formulas, customers and credit, purchases, expenses, stocktakes, day-close cash counts, reports and an activity log. The counter runs offline-tolerant, and the owner's view is gated server-side so staff never receive formulas, cost prices or profit.

How it's built

  • Next.js 16 (App Router, Server Actions) + React 19 + TypeScript on SQLite via node:sqlite; deployed with Docker and Caddy HTTPS on a VPS, with nightly backups.
  • Money as integer cents and quantity as integer thousandths — no floating-point drift anywhere in stock or accounting.
  • Stock is an append-only ledger: the database physically blocks UPDATE and DELETE on stock movements, so quantities can only change by posting a movement.
  • Sales are immutable — voiding posts compensating movements — and prices are snapshotted onto sale lines so reports can never be rewritten by a later price change.
  • Formulas are versioned: editing a recipe inserts a new version, and every batch records the version it was produced from.
  • Role-gated server-side: formulas, cost prices and profit are never sent to a staff session. Offline service worker, ESC/POS receipt printing, and Africa/Nairobi business dates so evening sales land on the right day.

Highlights

  • A trade-secret boundary enforced on the server — staff can sell without ever seeing a formula, a cost or a margin.
  • Append-only stock and immutable sales: the books reconcile because history physically cannot be edited.
  • Versioned formulas and batch production tying every mixed product back to the exact recipe used.
  • Offline-tolerant counter with receipt printing, day-close cash counts and a full activity log.