Home / Projects / Palm Scale — Weighbridge Management System
active
2025 Featured

Palm Scale — Weighbridge Management System

An enterprise-grade weighbridge management system built for the palm oil industry, handling weight transactions, quality control, partner contracts, and real-time reporting — with offline-first capability and hardware integration for on-site scales.

Tech Stack SvelteKitTypeScriptPostgreSQLDrizzle ORMTailwind CSSBullMQBunDocker
About Project

What is Palm Scale — Weighbridge Management System?

Palm Scale was born out of a real operational need in the palm oil supply chain — mills and plantations need a reliable, fast way to record incoming and outgoing weight transactions, manage supplier contracts, and ensure quality compliance. Existing solutions were either too generic or locked behind expensive ERP licenses.

I built Palm Scale as a full-stack web application that runs on-premise (even on a Raspberry Pi) with offline support, so it keeps working when internet connectivity is unreliable — a common reality in remote plantation areas. The system integrates directly with physical weighbridge hardware via serial port, automates quality grading for palm fruit bunches, and syncs data to Odoo ERP when connectivity is available.

The project grew from a simple weighing tool into a comprehensive platform covering the entire transaction lifecycle: from partner onboarding and contract management, through weight-in/weight-out recording with automated calculations, to reporting and analytics dashboards.
Key Features

What makes this project special?

Offline-First Transactions

Records weight transactions even without internet using IndexedDB with a sync queue, ensuring zero downtime in remote plantation areas with unreliable connectivity.

Weighbridge Hardware Integration

Connects directly to physical weighbridge scales via configurable serial port, automatically capturing weight readings with customizable data filters and flow control.

Quality Control & Grading

Tracks palm oil quality parameters including DOBI, FFA, moisture, and impurity levels — with fruit bunch sortation grading and partner-provided vs internal assessments.

Role-Based Access & Audit Trail

Granular permission system with configurable roles, route-level guards, and comprehensive activity logging — ensuring accountability across multi-location operations.

Challenges & Solutions

Lessons from the development process

01

Running on Resource-Constrained Hardware

Many palm oil mills use Raspberry Pi or low-spec machines as their on-site server. Optimizing the SvelteKit build with adapter-node, tuning PostgreSQL for limited RAM, and using Bun as the runtime instead of Node.js were critical to achieving acceptable performance on ARM-based hardware with just 2GB of memory.

02

Reliable Offline-to-Online Synchronization

Transactions recorded offline need to eventually sync without data loss or duplication. I built a queue-based sync system using IndexedDB (via Dexie.js) that handles conflict detection, master data versioning, and graceful recovery from partial syncs — all transparent to the operator at the weighbridge.

03

Serial Port Communication in a Web Stack

Bridging physical weighbridge hardware with a web application required parsing raw serial data streams with varying formats across different scale manufacturers. I implemented a configurable serial filter system that extracts weight values from noisy data using pattern matching, with fallback handling for connection drops.

Tech Stack
SvelteKitTypeScriptPostgreSQLDrizzle ORMTailwind CSSBullMQBunDocker
Info
Year 2025
Status active
Category Enterprise / Industrial