How Algoramming built an offline-first, weighbridge-integrated waste management platform for Dhaka South City Corporation: a Flutter ecosystem that reads live scale weights, prints tamper-resistant slips, and syncs across transfer stations even when the network drops.

Dhaka South City Corporation's weighbridge records lived on paper and in memory, which left the city with no reliable way to prove how much waste a contractor actually delivered. The setting made this hard to fix. Transfer stations sit at the edge of the network, so a cloud-only app would stop working during an outage,
Algoramming replaced the paper slip with a digital weighing record that is captured straight from the scale and printed the moment it is confirmed. The whole platform was built offline-first: every screen reads and writes an encrypted local database, and PowerSync syncs to Supabase in the background rather than in the
Every weighing now carries a matching physical slip and digital record that reconciles cleanly per client. The station never stops for the network, since records save instantly and upload automatically when connectivity returns. The number on the slip is the number on the scale, silent tampering is blocked while honest
In short: For years, Dhaka South City Corporation had no dependable way to prove how much waste its contractors actually delivered — the record lived on paper slips and in memory. Algoramming Systems Ltd. replaced that with the DSCC Waste Management System (DSCC WMS): an offline-first platform that captures every weighing straight from the weighbridge scale, prints a tamper-resistant slip on the spot, and rolls each record up into auditable, per-client statements the corporation can reconcile its contractors against. It runs on the transfer-station floor and in the management office at once, keeps working when the internet does not, and enforces who-can-do-what at the database layer rather than in the interface. A single Flutter codebase serves five staff roles across desktop and mobile, in English and Bengali. The result is a paper-and-clipboard process turned into a verifiable digital record for a city of millions.
Dhaka South City Corporation moves an enormous volume of waste every single day. That waste travels from wards and zones across the city to transfer stations, where trucks are weighed, unloaded, and weighed again. For years the record of what came in, from whom, on which vehicle, and how heavy it was, lived on paper slips and in memory. Paper does not reconcile. It gets lost, it gets rewritten, and it gives a city no reliable way to answer a simple question: how much waste did this contractor actually deliver last month, and can we prove it?
The corporation needed to replace that process with something trustworthy. The requirements were unusually demanding for a piece of municipal software:
This is not a content app or a dashboard. It is an operational system that sits between a truck, a scale, a printer, and a government's books — a chain in which every link has to hold. If any single point in that chain is unreliable, the whole record is worthless, and a city loses its ability to hold contractors to account.
Algoramming delivered the DSCC WMS as a single Flutter codebase that behaves like a different product for each kind of user, all backed by the same encrypted local database and the same cloud. One architectural decision shapes everything else: the record is read from the scale and committed locally before anything touches the network — which is what makes the number both trustworthy and outage-proof. In practice, it is one ecosystem with three faces:
| Capability | What it does |
|---|---|
| Live weighbridge capture | Reads gross weight straight from an RS-232 scale over serial, frames each reading, and computes net garbage as gross minus the vehicle's tare weight |
| Offline-first data layer | Every read and write hits an encrypted local SQLite database first, then syncs to the cloud through PowerSync when a connection is available |
| Tamper-resistant slips | Prints an 80mm ESC/POS thermal receipt over the network at the moment a weighing is confirmed |
| Double-check workflow | Holds a new weighing as unconfirmed and lets an operator reprint and confirm it only inside a controlled time window |
| Role-based access | Five roles from Owner to Dispose, enforced at the database layer through Row-Level Security and sync rules, not just hidden in the interface |
| Client statements | Generates per-client PDF and Excel wastage statements over any date range, in a background isolate so the interface never freezes |
| Bilingual, multi-platform | Runs on Windows, Android, iOS, macOS, Linux, and the web, in both English and Bengali |
The foundation of the whole system is a deliberate decision: the app talks to a local database, never directly to the cloud in the critical path. Every screen reads from and writes to an on-device SQLite database. PowerSync then handles the two-way sync between that local database and Supabase Postgres in the background.
This is what makes the platform usable at a transfer station. When a truck is on the scale and the network is down, the operator does not know or care. The weighing is saved locally in milliseconds, the slip prints from the local record, and the row quietly uploads later when connectivity returns. There is no spinner, no failed request, no lost weighing.
A few engineering choices are worth calling out, because they are the difference between a demo and a system a city can trust:
The core transaction in the whole system is a single weighing event, called a wastage record. Watching one happen end to end is the clearest way to understand the product.
The truck arrives and the operator identifies it. In the capture screen the operator selects the client, which the system calls the Tender Id, and the vehicle by its registration number. Both fields use type-ahead search against the local database, so selection is fast even with thousands of vehicles on file. Choosing the vehicle auto-fills its ward and zone, because those belong to the vehicle's record.
The scale, not the operator, provides the weight. The truck sits on the weighbridge. The app opens the scale's serial port at 9600 baud and listens to the byte stream. The scale wraps each reading between two control characters, so the parser waits for a start marker, reads until the end marker, strips out any non-numeric noise, and scales the raw number into kilograms based on the unit the scale reports. That live gross weight streams straight into a weight field that ordinary operators cannot type into. Only elevated roles can hand-enter a value, and even then it is the exception, not the rule.
The system computes net garbage automatically. The value on the scale is the gross weight, truck plus load. The vehicle's own tare weight is already stored against its record. The app subtracts the two to get the net garbage weight, and it refuses to save a weighing lighter than the vehicle's own tare, which catches an obvious class of bad readings before they ever reach the database.
The record is saved locally and, if configured, held for review. Here the double-check workflow comes in, and it is one of the most important business rules in the system. When double-check is enabled, a new weighing is saved with an unconfirmed status and no slip is printed yet. The record sits in a pending state, visibly flagged as temporary, until someone confirms it.
Confirmation prints the slip inside a controlled window. An operator can confirm and print a pending weighing, but only between five and thirty minutes after it was created. Too soon is blocked, too late is blocked, and an already-confirmed slip cannot be reprinted by an operator at all. That single rule, expressed in a few lines of code, is what prevents the two abuses a manual weighbridge is prone to: printing before the truck has settled, and quietly rewriting a weight hours later. Legitimate corrections stay possible; silent tampering does not.
The slip prints over the network. Confirmation sends an 80mm receipt to a network thermal printer using the ESC/POS protocol. The slip carries the corporation's name, the Tender Id, the vehicle registration number, the garbage collected in kilograms, the ward and zone, a timestamp, and a footer. The driver leaves with a printed record that matches the digital one exactly.
A subtle but important design decision sits under all of this: the weighing record stores its own snapshot of the client and vehicle details at the moment it is written. If a client's name or a vehicle's ward changes later, historical slips and statements do not silently change with them. The record is a photograph of that moment, which is exactly what an auditable system needs.
Individual weighings only matter if they roll up into something the corporation can reconcile. That is the job of the wastage book and the statement generator.
The wastage book is the full ledger of weighings, filterable by client, by vehicle, and by date. From there, staff generate a wastage statement for a chosen client set over any date range, as a PDF or an Excel file. Two rules make these statements trustworthy:
Because a statement can span thousands of records, the generation runs in a background isolate rather than on the interface thread. On the web, where isolates are not available, it falls back gracefully to the main thread. Either way, the person generating a month-end statement never watches the app freeze.
The DSCC WMS recognises five roles: Owner, Admin, Manager, Operator, and Dispose. What matters is not that these roles exist, but that they are enforced at the layer that cannot be bypassed.
Every one of these boundaries is expressed twice: once in the interface, so people only see what they should, and once in the database through Row-Level Security policies and PowerSync sync rules, so a device physically cannot download or write rows it is not entitled to. That belt-and-braces approach is what makes the access model defensible rather than cosmetic.
The interesting problems in this project were all at the seams, where software meets hardware, an unreliable network, or a real government's expectations.
Problem. A transfer station often runs two builds of the platform on the same Windows PC at the same time, an Outside build and a sister Inside build. But a serial port is exclusive: only one process can hold the scale at once, so the two apps could not both read the weighbridge.
Approach. Rather than rewrite the apps to fight over the port, Algoramming solved it at the operating-system level. A signed virtual-null-modem driver creates paired COM ports, and a small multiplexer, installed as an auto-restarting Windows service, copies every byte from the one real scale port to two virtual ports. The Outside app reads one virtual port, the Inside app reads the other, and neither app needed a single line of code changed.
Outcome. Both apps show the same live weight at the same time. The setup survives a reboot and survives one app crashing, because the other keeps reading its own clean copy of the scale feed. It is the right trade-off for a fixed-purpose weighbridge PC where the city's IT team controls the machine image.
Problem. Field devices are modest, and a transfer station accumulates thousands of weighings. PowerSync creates its local tables with only a primary key, which meant every query that filtered by operator, client, or vehicle, and every list sorted by date, was scanning the entire table. The dashboard made it worse by running four separate aggregation queries on every refresh, and debug logging serialised entire result sets on every query in both debug and release builds.
Approach. Algoramming added targeted SQLite indexes to the hot columns, declared in the schema so they are created automatically when the database opens, with no migration script to run on live devices. The most valuable is a composite index on operator plus creation date, which lets an operator's own list resolve as a single index seek instead of a scan followed by a sort. The four dashboard aggregations were collapsed into one query using conditional sums, and the heavy logging was gated behind a compile-time flag so it is stripped entirely from production builds.
Outcome. A dashboard refresh now runs two queries instead of five, hot lists resolve as index seeks rather than table scans, and logging costs nothing in release. This was the single biggest performance win in the project on the hardware the app actually runs on.
Problem. Left unbounded, an operator's device would try to pull an ever-growing history of weighings, which slows initial sync and wastes storage on modest field devices. PowerSync's sync rules cannot express "the last five hundred records," because rules are evaluated one row at a time.
Approach. The pragmatic fix was a date cutoff in the operator's sync bucket, so field devices only download recent weighings rather than the entire history. The cutoff can be moved forward with a small change when needed.
Outcome. Operator devices stay lean and initial sync stays fast, while Owner, Admin, and Manager accounts still receive the full record for reporting.
Problem. The vehicle master data arrived as spreadsheets full of the inconsistencies real operations produce: capacities recorded in tonnes where kilograms were expected, tare weights left as placeholders, and phone numbers missing a leading zero. Bad master data would quietly corrupt every net-weight calculation downstream.
Approach. Algoramming built a CSV and Excel importer that cleans as it ingests, and wrote a careful set of database migrations to backfill and correct historical rows, each one with a preview step so a human could eyeball exactly what would change before committing. Those migrations also renamed the core weight field and derived a proper net-versus-gross model, coordinated so the app update shipped before the schema change to avoid breaking live devices mid-sync.
Outcome. Historical records were corrected without downtime or data loss, and the net garbage weight on every new weighing is computed from clean, consistent tare values.
The platform is a single Flutter codebase that ships to Windows, Android, iOS, macOS, Linux, and the web. Windows is packaged as an auto-updating MSIX installer, which matters because the weighbridge PCs need to update themselves without an IT visit. The web build gracefully drops the features that make no sense in a browser, such as direct scale and printer access, and the whole interface is fully bilingual in English and Bengali, with a bundled Bengali font so the corporation's staff can work in the language they actually use.
The platform changed what the corporation can prove, not just how it works. A weighing floor that once ran on paper now produces a record that stands up to reconciliation, survives a network outage, and cannot be quietly rewritten — in concrete terms:
Client: Flutter and Dart, one codebase across Windows, Android, iOS, macOS, Linux, and web. State management with Riverpod, local settings in Hive, navigation with Beamer.
Data and sync: PowerSync as the local-first sync engine, an on-device SQLite database encrypted with SQLite3MultipleCiphers, syncing to Supabase Postgres. Access control through Supabase Auth, Row-Level Security policies, and PowerSync sync rules.
Hardware integration: RS-232 serial weight-scale reading over the serial port, network thermal printing over the ESC/POS protocol, plus a virtual-COM-port multiplexer at the OS level to share one scale between two apps.
Documents and media: PDF and Excel statement generation in a background isolate, image handling and avatars in Supabase Storage.
It is an offline-first waste management platform built by Algoramming Systems Ltd. for Dhaka South City Corporation. It runs on the weighbridge floor of a transfer station, reads truck weights directly from the scale, prints thermal slips, and generates auditable per-client statements, while syncing every record to the cloud in the background.
Every screen reads from and writes to an encrypted local SQLite database on the device, never directly to the cloud in the critical path. PowerSync then syncs that local database with Supabase Postgres whenever a connection is available. An operator can weigh a truck, save the record, and print a slip with no network at all, and the record uploads automatically later.
The weight is read live from the RS-232 scale, and ordinary operators cannot type into the weight field. The system computes net garbage as gross weight minus the vehicle's stored tare weight, and rejects any reading lighter than the tare. A double-check workflow then holds each weighing as unconfirmed and only allows it to be printed and confirmed inside a five to thirty minute window, which blocks both premature and after-the-fact edits.
Transfer stations sit at the edge of the network, where connectivity is unreliable. A cloud-only app would stop working during an outage, which is unacceptable when a truck is on the scale. A local-first architecture keeps the app instant and always available, and treats the network as a background convenience rather than a dependency.
There are five roles: Owner, Admin, Manager, Operator, and Dispose. Access is enforced at the database layer through Supabase Row-Level Security and PowerSync sync rules, not just hidden in the interface, so a device can only ever download and write the rows its role permits.
A single Flutter codebase ships to Windows, Android, iOS, macOS, Linux, and the web, in both English and Bengali. Windows is delivered as an auto-updating MSIX installer for the weighbridge PCs.
Staff choose a client set and a date range in the wastage book, and the system generates a PDF or Excel statement that includes only confirmed weighings, totalled in kilograms and tonnes. Generation runs in a background isolate so the app stays responsive even for statements covering thousands of records.
Algoramming Systems Ltd. builds offline-first, hardware-integrated software for operations that cannot afford to stop. If you are digitising a weighbridge, a warehouse, a field operation, or any process where the network is unreliable and the record has to be trusted, get in touch with Algoramming.
We are pleased with the service and software solution provided for our DSCC Wastage Management System. Since implementation, it has improved our operational efficiency by making data tracking, reporting, and workflow management more organized. The development team maintained professionalism and clear communication throughout the project. Their responsive support has also helped our staff adapt to the system smoothly.
FeaturedAlgonize is the cloud ERP, CRM and POS platform built in Dhaka for multi-branch retail shops, restaurants and delivery businesses. This case study shows how one real-time dashboard unifies sales, inventory, riders, loyalty and accounting across Android, iOS, macOS and the web.
Read case studyAlgoramming presents DNCC EMS - a secure, scalable solution that automates tracking, maintenance, and assignment of vehicles, machinery, tools, and supplies for Dhaka North City Corporation, with insightful reports and streamlined workflows to boost productivity and cut costs.
Read case studyA tailoring business management SaaS built for a Qatar-based client, orders, measurements, billing, and customer records handled in one place.
Read case studyWe will reply in plain English within one business day, NDA on request. Discovery call is free.