The problem
A RAMP is a palm-oil buying station. Farmers bring their fruit in by truck, the truck is weighed full and then empty, the farmer is paid for the difference minus a deduction, and the station later sells the fruit on to a palm-oil mill.
The station I built this for ran all of that on paper tickets, a calculator and a notebook. That made two things hard. The owner couldn't see what was happening without being there in person, and there was no easy way to check that the cash in the drawer, the fruit on the ground and the tickets on the desk actually added up. On paper, a wrong number is hard to spot and even harder to trace. On top of that, weighing stations tend to sit where the signal is bad, so anything that needed the internet to work would stop the scale.
What I built
A desktop app for the PC next to the scale that works completely offline, a small server that keeps a copy whenever there's internet, and a phone app for the owner.
One place where the data is written
The key decision was that the PC at the scale is the only place where data gets written. The server only holds a copy, and the owner's phone never edits anything directly. When the owner does something from the phone, it sends a request, and the PC carries it out with the same checks and the same audit trail as a click at the desk. With only one writer, the phone and the PC can never disagree, and there's nothing to merge when the internet comes back.
Every change also takes the same path inside the app: the rules are checked, the change is saved, an audit entry is added and the copy for the server is queued, all in one step. Staff can't delete anything. A correction is a void by the owner plus a reversing entry, and each audit entry is chained to the one before it, so rewriting history after the fact shows up. Weights are whole kilograms and money is whole rupiah everywhere, which matches how the station already did its sums.
How a purchase flows
Step 1 / 5
- A loaded truck drives onto the scale. The app reads the gross weight straight from the scale's indicator over a serial cable, so nobody types the number in.
- The truck unloads and is weighed again empty. The difference is the weight of the fruit.
- The operator enters the deduction and the price, and the app works out the net weight in kilograms and the amount owed to the farmer.
- The farmer is paid in cash or by transfer, the ticket and receipt print on the dot-matrix printer the station already had, and the stock goes up.
- When the station sends fruit to a mill, the same scale weighs the station's own truck empty and then loaded. Once the mill's delivery note comes back, its figures are checked against the station's, and any fruit the mill turned away is recorded as a return.
Weights can still be typed in by hand when the cable acts up, but those tickets are flagged for the owner.

Cash and bank transfers are kept apart, and closing a cashier shift means counting the drawer, with any shortfall recorded on the spot. Whenever there's internet, the owner's phone shows cash, stock and anything that needs attention that day.

Each station gets its own database on the server, so an owner with more than one station can switch between them from the same phone login.
The result
The station weighs, pays and reports from one PC, and the owner can check the day from their phone instead of driving over. Any ticket can be followed from the scale reading through the payment to the delivery to the mill, and the numbers on the phone are the same ones on the PC.
The app updates itself from the server, so new versions reach the station without anyone turning up with a flash drive. The demo linked above runs the real app in your browser with made-up data, so you can weigh a truck yourself.

