Context
Roleo is a wholesale distributor that works with pre-sales: a sales rep visits the customer and takes the order, and a driver delivers it on another day. They used a desktop system (ASP.NET with frames) with modules for purchasing, sales, customer accounts, checks, payroll and more.
What hurt
- Many towns and routes have no signal, so orders were taken on paper or from memory.
- The system had everything, but in practice they only used products and prices, pre-sales and routes. Sales invoices had been at zero since 2024 and customer accounts were empty.
- Planning each day's delivery run meant exporting spreadsheets by hand.
Decisions
Survey before building. I went through the old system in read-only mode to see what was really used. That set the scope: replace what is used, and add what was missing, like customer accounts, as a new practice. Not everything that existed was migrated.
Offline first, with a queue that never duplicates. The phone stores each order in a local queue and uploads it in order when there's signal. Every operation carries an ID generated on the phone and the server is idempotent: resending never duplicates. The price is always decided by the server.
A PWA instead of a native app. There was a React Native app, but it barely used native features and it was expensive to maintain. Every sales rep uses Android with Chrome, so an installable PWA did the same job at a fraction of the cost.
Infrastructure as code from day one. Postgres, a file bucket and four services defined in code, with CI on every PR and automatic deploys on merge.
What was built
- Sales rep PWA: daily route, customers, orders, collections and a rear-camera barcode scanner.
- Driver PWA: delivery sheet, deliveries with returns and payment on the spot.
- Admin panel: products, price lists, delivery runs, customer accounts, commissions, internal invoicing and reports.
- Public catalog with WhatsApp contact.
- Data migration with an idempotent script that can be run again safely.
What I learned
The most valuable part was the survey: once you watch how people actually work, the scope shrinks to what matters.
