M-SIMS purchase management
How does a small business know exactly what is on its shelves?
Purchase module of an inventory and billing platform. Every purchase and return updates stock through one server-side code path, so the books always match the shelf.
- What it is
- Product at Mahat Innovations
- My role
- Module owner
- Year
- 2025
- Status
- In use
- React
- TypeScript
- Tailwind CSS
- Zustand
- Node.js
- Express
- MongoDB
The problem
Small businesses buy from many suppliers with different prices, taxes and discounts, and send some of it back. Tracked by hand, stock counts drift and owners order the wrong things.
How I solved it
- Every purchase adds to stock and every return takes it away, through the same rules on the server.
- Tax, discounts and payment status are worked out once on the server, never re-done in the browser.
- Forms validate as you type, so bad entries never reach the books.
System design
- Frontend: React, TypeScript and Tailwind CSS, with Zustand holding multi-step purchase state.
- API: Node.js and Express REST endpoints for purchases, returns, suppliers and products.
- Data: Mongoose models for purchases, suppliers, products and stock records; stock recalculated on every purchase and return.
- UI: reusable forms, searchable tables, pagination and modals with client-side validation.
Trade-offs
- Calculations on the server over the client: one source of truth for stock and totals. Cost: the UI waits on the API for final numbers.
- Zustand over Redux: a small store fits multi-step forms without the boilerplate. Cost: less built-in structure as the app grows.
- MongoDB documents for purchases: line items of any shape live in one document. Cost: updating stock across documents needs careful ordering or transactions to stay consistent.