
Programming
Waste collection point (PSZOK) record system
Electronic record-keeping for visits to the Municipal Waste Collection Point: searching for declarations in municipal data, limits assessed by staff, and a PDF protocol as per regulations. With personal data that never leaves the municipal network.
18/10/2026
The Selective Waste Collection Point the system was built for operated on paper for years. An employee manually filled out forms, checked declarations by phone, and calculated limits in a notebook.
I built an inventory system that guides the employee through a resident's entire visit, from searching for declarations to printing a report. It operates within the municipality's network and uses data that the municipality already has.
(enlarge)Employee Dashboard
The employee logs in with an account from the municipality's intranet, so they don't have to remember separate passwords. On the dashboard, they see how many acceptances there were today and this month, a list of recent visits with protocol numbers, and a button for new acceptances.
The system has been operational since May 2026. Alone in October, the facility processed over 400 visits through it, and the numbering of protocols exceeded 2300.
(enlarge)Data that doesn't need to be entered twice
A resident can deposit waste for free if they have an active waste declaration. This information is in the municipal tax system. Instead of building another copy, the PSZOK system reads it from the intranet on Directus.
A separate synchronisation connector links the data with the domain application. The PSZOK panel does not have direct access to it, limiting the attack surface to one controlled point.
The employee searches for the owner of a declaration in three ways:
- by their PESEL number from their ID or authorization document,
- by the collection point number or a barcode scanner,
- after the name and address.
The search by PESEL number is done using a POST request, so the number does not appear in the URL, browser history, or server logs.
A limit the system consciously does not count
The most interesting decision in this project concerned the limits. The council's resolution provides for 2.2 cubic meters of construction waste or 20 bags of 120 liters free of charge. The problem is that 20 such bags amount to 2.4 cubic meters.
Additionally, one time a resident brings bags, and another time they bring loose debris. Any machine that tries to determine this would eventually make a mistake at some point, either to the detriment of the resident or the municipality.
That's why the system shows the employee the history of visits for the current year and leaves the decision to them. The excess is always weighed, and the fee is calculated per kilogram based on the rate set in the settings.
(enlarge)One type of waste can result in two lines on the protocol: the free portion within the limit and the weighed surplus. This allows the resident to clearly see what they are being charged for.
Protocol in one click
After booking, the visit is assigned a number in the format PSZOK/year/sequential number, and the counter resets every year. The protocol is generated by an intranet service at the office, using a template that mirrors the annex to the point's regulations.
- part one: data of the declaration owner, the person delivering the waste, and a list of wastes with limits
- second part, only for surplus: additional service with mass, rate, amount and amount in words,
- both parts on one A4 page, with space for signatures,
- printing or downloading a PDF directly from the visit card.
After changing the template, the system automatically generated the missing reports for previous visits, so the archive is now complete.
(enlarge)Small things that make a difference at the gate
- authorization for another person is one field, and the proxy's details are only recorded when needed,
- waste photos attached to visits with preview, navigation arrows and downloading,
- cancelling an appointment within three hours of booking, as a flag rather than deleting from the database,
- system change log visible in the panel, generated from the repository history.
Placeholder page for an unimplemented website
When the facility is closed due to an inventory or malfunction, for example, staff can switch to displaying a message on the public page with a single toggle instead of the usual content. The editor has syntax highlighting and real-time preview, and changes take effect immediately without any deployment.
(enlarge)
(enlarge)GDPR from day one
The system processes PESEL numbers, names, and addresses, so I documented the data protection rules before writing a single line of code. Sensitive fields are not logged or exported, and the dashboard operates exclusively within the municipality's network.
The keys for external services are in environment variables rather than the code itself. If any are missing, the application raises a clear error message instead of silently operating without security.
Not every rule from the resolution can be turned into an if statement in code. Sometimes, the best a system can do is provide all the information to a human and not pretend to know better.
- Aleksander Kowal
Residents' portal
The public part is a single page with opening hours, live status of the point, a list of fractions and downloadable documents. The design of the site was prepared by Mateusz Duda, and I integrated it into the system as a static page and maintain it.
(enlarge)Stack
- Astro in SSR mode on Node.js, TypeScript,
- TailwindCSS v4 and Flowbit in the employee panel,
- The Directus intranet of the office as a data source and PDF service,
- a monorepo with npm and a shared Directus client for the public and system parts,
- Docker deployment on the municipality's servers.
