(Business software)

Scrapyard management

I built a custom application to replace handwritten receipts and bring the office, scale operator, and customer into the same ticket workflow. In daily use since July, with ongoing support and improvements.

Client
Independent scrapyard · name withheld
Sector
Metal recycling
Year
2026
Services
Solo full-stack development, Workflow design, Ongoing support
Illustrative image of sorted steel and copper offcuts on an industrial work surface.

(Overview)

For roughly 50–60 years, this scrapyard wrote its receipts by hand. A customer would bring in metal, staff would sort and weigh it, and the customer would leave with an itemized receipt showing what they had been paid.

The business wanted digital records and a way to generate those receipts. I built the application alone, from an initial prototype to the production system the company uses today. It has been in daily use since July, and I continue to support and improve it.

The business is anonymous. The cover is an AI-generated illustration, not a photograph of the client’s premises.

Start with the work happening at the scale

Turning a paper receipt into a form was only part of the job. The application had to fit a transaction happening across several people and devices.

In the office, an employee looks up prices for different metals. At the scale, an operator talks with the customer and weighs the vehicle before and after unloading. Both employees need to work on the same ticket. A third screen, on a customer-facing tablet, updates as metals are added.

I demonstrated an initial approach, then built a more intuitive production application around that workflow. The ticket became the shared point of reference: the materials being purchased, their weights and prices, and the itemized record the customer would receive.

That shift shaped the project. I was building something staff would use while serving a customer, not just a database they could fill in afterward.

Build a foundation I could keep working on

I chose Next.js so I could build the frontend and backend in one full-stack application. These were tools I knew from my professional work, which let me spend more time understanding the business and less time learning a new stack.

PostgreSQL was central to the design. Metals, tickets, and saved records have relationships that need to stay understandable as the application grows. Transactions mattered because related changes needed to succeed together, rather than leave part of a ticket saved and another part unfinished.

The workflow also included generating PDF receipts, storing those files in storage buckets, and supporting end-of-day reporting and updates. Reliability, backups, access control, and use across multiple devices were considerations from the beginning. A useful first version needed a foundation I could maintain after launch.

When indexed queries were still too slow

Historical reporting exposed a weakness in the early approach. The queries used indexes, but they still read and combined large sets of records from several sources. Repeating those calculations whenever someone opened a report made pages slow, especially when several employees were using the application.

I changed when that work happened. Instead of repeatedly calculating historical totals from the underlying records, I introduced materialized views: saved query results that can be refreshed and reused. Precomputed daily summaries gave reporting a smaller set of results to read.

The reporting workflow covers metals purchased, sold, and shipped. Moving repeated calculations out of the page-loading path made day-to-day and historical reporting practical to use.

The lesson was that an indexed query can still be doing too much work. I needed to look at how much data each request touched, how often the same answer was recalculated, and how fresh that answer needed to be.

Keep three views of a ticket in sync

My first approach checked for changes over HTTP every few seconds. The screens could show different versions of the ticket between those checks. That was awkward when the office employee, scale operator, and customer were all following the same transaction.

I replaced that polling approach with event-driven updates. The application subscribes to database changes and uses those events to update the relevant views. When ticket details change, the other screens can respond to the change instead of waiting for their next scheduled check.

Keeping a display current and deciding whether an edit is valid are separate responsibilities. The event stream helps the screens stay in sync; correctness still depends on how the application validates and saves changes. Working through that distinction was an important part of building for several people using one ticket.

Shipping was the start of the responsibility

The application is now part of the scrapyard’s daily work. Staff use it to record purchases and produce receipts, and I continue to improve it as real use reveals what needs attention.

This has been one of the most rewarding parts of the project: building software a company relies on, then staying involved after it ships. The slow reports and inconsistent screens were useful lessons because they came from the actual workflow. Each improvement had a concrete purpose for the people using it.

I came into the project to replace handwritten receipts. I came away with a clearer understanding of what it means to own a production application: understand the work, make deliberate technical choices, and keep taking responsibility for the result.