Shakirin Mills Gold Refining Management System
A centralized operational and financial platform built to digitize the complete workflow of a gold grinding and refining business — from customers and grinding sessions to inventory, payroll, collections, accounting, and final profitability.
- Role
- Backend Architecture & Full-Stack Development
- Timeline
- Production
- Industry
- Gold Grinding & Refining Operations
- Status
- Production
What this system is
Shakirin Mills is an operational, financial, and administrative system built for a gold grinding and refining business. It takes a workflow that normally lives across notebooks, spreadsheets, and memory, and binds it into one dependent cycle: a customer arrives, a grinding session is opened against a machine, bags are ground, gold is produced and refined, direct expenses and inventory consumption are absorbed into the session, payroll accrues against the month, the company collects from its own profit, and every one of those movements lands in a single financial ledger that the accounting reports read from. The result is a mill whose operational and financial state can be read at any moment from one source instead of reconciled after the fact.
What we needed to solve
Running a grinding mill means keeping bags, price per bag, gold output, refining fees, customer discounts, direct expenses, inventory consumption, payroll, maintenance, and company collections consistent with one another. Held in separate registers or manual calculations, those figures drift: expenses get counted twice, calculations differ between screens, historical reports change when a price is edited, and real profitability becomes very hard to establish.
How we shipped it
A centralized platform where every operation is bound to the rest of the system and every financial calculation resolves through one shared engine. Prices are captured as snapshots on the transaction, so historical records never move when settings change. Dashboards, the administrative report, the accountant workbook, and the financial ledger all read the same numbers, which makes the mill's operational and financial position provable rather than estimated.
How the system is wired
The system is organised as a Laravel REST backend with a lightweight browser client, and the business rules live in a domain layer rather than in controllers. The operational lifecycle below is the spine of the product: each stage writes into the same financial source, which is why a figure on the dashboard, the administrative report, the accountant workbook, and the ledger cannot disagree.
A customer record opens a grinding session against a specific machine, with the number of bags and the grinding account for that session.
Gold output is recorded in grams, the refining account is calculated from it, and any customer discount is applied to reach the customer's net.
Direct operational expenses, inventory consumption, and maintenance are charged against the session so its profit reflects real cost.
Salaries accrue against the month and company remittances are drawn from validated available profit, both landing in the same ledger.
The ledger, the accountant workbook, and the administrative report resolve to one final company net profit for the selected period.
Engineering choices
In the wild
Services and data
A centralized financial layer rather than calculations scattered through controllers and views. It resolves grinding revenue, refining value, services, discounts, customer net due, operational expenses, inventory cost, maintenance, payroll, manual adjustments, company collections, grinding profit, and final company net profit — so every dashboard and report is reading the same computation.
Session lifecycle covering customer, grinding machine, number of bags, gold quantity, grinding cost, refining cost, customer discount, operational expenses, inventory consumption, customer net, and session profit.
Employees, monthly salary, employment start date, derived daily salary, worked days, accrued salary, and pending or paid state. Accrual is computed rather than entered by hand.
Remittances are checked against available company profit before they are written, and are stored with the acting user, timestamp, profit before, and profit after. They are kept distinct from operational expenses.
Item catalogue, current quantities, minimum thresholds, and inventory movements. Consumption is costed into the session so profit reflects the materials actually used.
Independent maintenance costs classified by type — emergency, periodic, and repair — tracked separately from session expenses but landing in the same ledger.
A read-only record of system operations — who acted, when, from which address, and on what entity. Entries such as accounting period creation, payroll changes, inventory updates, and authentication events cannot be edited or deleted.
Role-based authorisation across General Manager, Manager, Accountant, Supervisor, and Assistant Supervisor, enforced with Laravel policies so each user reaches only the functions their role allows.
External surfaces
The browser client talks to the system exclusively over a versioned Laravel REST API, with API Resources shaping every response so the client never depends on the database schema.
Authentication runs on a Sanctum session cookie, with password policy enforced at account creation and session events recorded in the audit log.
Input validation lives in Form Requests and authorisation in Policies, so a controller cannot accidentally accept an invalid payload or serve a record the role is not entitled to.
The administrative report and the accountant workbook export their period to CSV for archiving and for handover to external accounting.
What admins control
The registered customer the session belongs to, with their own history and statistics.
A session opened against a machine, carrying the number of bags and the grinding account.
Gold output recorded in grams for the session, or no gold at all when the operation produced none.
The refining account calculated from the gold, then reduced by any applicable customer discount.
Direct operational expenses attached to the session rather than pooled at the end of the month.
Materials and spare parts consumed by the session, costed into it from the inventory ledger.
Salaries accruing against the month from each employee's start date and worked days.
Company remittances drawn from available profit, validated before they are allowed to record.
The financial ledger, the accountant workbook, and the administrative report over the chosen period.
The final net figure for the period, derived from the same engine every other screen reads.
Hard problems, handled
Editing a financial setting retroactively changed historical operations and every report built on them.
Prices are snapshotted onto the transaction at creation time, so settings changes apply forward only and historical reports stay reproducible.
The same figure was at risk of being computed differently on the dashboard, the report, and the ledger.
All financial computation was moved behind one service layer that every consumer calls, removing the possibility of two screens disagreeing.
Operational expenses and inventory consumption were easy to double-count between the session and the monthly report.
Expenses and consumption are attached to the session that incurred them and flow upward into period reporting from there, so each cost is recognised exactly once.
Company remittances could be taken against profit that did not exist.
Collections calculate available profit first, reject a request larger than it, and store profit before and after alongside the acting user and timestamp.
Built to stay fast
Design and interaction
Ready to ship and operate
What it does
Every session records its customer, machine, bags, gold quantity, grinding cost, refining cost, customer discount, operational expenses, inventory consumption, customer net, and its own profit — visible as a filterable register with per-session detail.
A dedicated accountant surface listing each customer's grinding, gold weight, refining calculation, discount, total, microscope data, and notes for the day or month, with a period summary and CSV export.
Every financial movement appears in one record with its source — grinding, expense, maintenance, payroll, financial adjustment, or company collection — its actor, role, income, expense, net effect, and reference, so any figure can be traced back to what produced it.
Daily, monthly, yearly, and custom date ranges reporting customer net totals, operating expenses, session profits, payroll, maintenance, collections, and final company profit, with CSV export.
Employees with monthly salary, employment start date, derived daily salary, worked days, accrued salary, and paid or pending status, summarised by total, paid, and outstanding.
Item catalogue with supplier, category, unit, current quantity, minimum threshold, unit cost, and stock value, plus movement history and low or out-of-stock flags.
Machines are registered with a number and location, carry an availability state — available, under maintenance, or inactive with a stated reason — and each session is bound to the machine that performed it.
Bag price, gold price per gram, refining price, customer discounts, and additional financial items are all editable by management without touching code. Items can be created, renamed, repriced, and deactivated.
General Manager, Manager, Accountant, Supervisor, and Assistant Supervisor each reach only the functions their role permits, managed from a user register showing role, status, and last sign-in.
A read-only operations log recording who acted, when, from which address, and what changed — covering authentication, payroll, inventory, and accounting period activity.
Arabic, English, and French, with RTL for Arabic and LTR for English and French. The selected language is stored against the user rather than reset on each visit.
An enterprise interface in graphite and black with a gold accent, in both dark and light modes, built on professional tables, cards, responsive forms, and consistent modals.
Why we chose what we chose
Historical price snapshots on every transaction.
When a session is created at a given bag price, gold price, or refining price, those values are captured onto the transaction itself. If management changes a price later, the older operation does not move — and neither does any report built on it. Without this, editing a single financial setting would silently rewrite months of history.
One centralized financial engine instead of per-screen calculation.
Financial logic was deliberately kept out of controllers and out of the UI. Every consumer — dashboard, administrative report, accountant workbook, ledger — calls the same services, which is the only way two screens can be guaranteed to agree on a number.
Decimal-based money and gold arithmetic.
The system computes money against gold weights, where floating-point representation accumulates rounding error across a chain of multiplications and subtractions. Decimal-based backend calculation keeps totals stable across the grinding, refining, discount, and expense chain.
Payroll accrual derived, not entered.
Accrued salary is computed as monthly salary ÷ days in month × actual worked days, which handles months of different lengths and leap years without special cases. Once a salary is paid, the accrued value is frozen historically so a later month cannot alter a settled record.
Collections validated against available profit.
A company remittance is checked against calculated available profit before it can be recorded, and is stored with profit before and after. This prevents the company from collecting more than it actually earned, and keeps collections separate from operational expenses in every report.
Deactivate rather than delete financial items in use.
A financial item can only be deleted if it was never used historically. Anything referenced by an existing transaction is deactivated instead, so historical records keep resolving their line items and reports stay reproducible.
Operations that produce no gold are first-class.
Some sessions legitimately yield no gold. Rather than forcing a placeholder quantity to satisfy the schema, the system models the no-gold case directly, so reporting is never polluted with invented weights.
Vanilla JavaScript on the client, not a frontend framework.
The interface is a set of data-dense tables, forms, and modals driven by a REST API. HTML5, CSS3, and vanilla JavaScript keep it light and dependency-free; adding a frontend framework would have introduced a build pipeline and runtime weight this product did not need.
Results
Other case studies
Building something similar?
Let's scope your platform — dashboard, mobile apps, APIs, the full stack.
