Week 020 — The Found Page Takes Shape
The found page went from a stub to something real this week, and it kept pulling in more of the codebase as it did.
Week of March 31, 2025
Progress
The found page now distinguishes between two cases: an item that was reported lost, and one that wasn't. In both cases, the finder sees the item's image to confirm what they've picked up. From there, the return options are presented — leave in place with geolocation, meet up, and other options — with UI that shows and hides sections based on the finder's selections.
Image upload was added for the scenario where a QR code is scanned but the finder's item doesn't match the registered item. That case doesn't change the fact that the owner wants their item back, but it's worth capturing the image and attaching it to the lost item record.
The User DTO/Service/Repository refactor was started this week. It wasn't originally on the plan for this period, but the found page needed to display the finder's name, which required the user data to be accessible through the same class structure being used everywhere else. One refactor pulling in another.
Also fixed a routing remnant: the login redirect was still pointing to items.php instead of /items. Found it while testing the found page flow.
The Hard Part
The processImage function was embedded in the item API, which meant the found page couldn't use it. Moved it to utils.php so it's available across contexts. Small change, right call.
A trickier question: image upload on the found page was using form submission. Researched alternatives that don't depend on the form — which would enable things like progress indicators and client-side resizing before upload. Decided to revisit the implementation later; getting something working was the priority.
Decision Made
Several this week:
The router (index.php) is now responsible for including the header and footer on every page. It's the right place for that — it builds every page anyway, and it avoids each page having to manage those includes independently.
Found logic moved out of index.php and into found.php. The router should stay lean; per-page logic belongs in the page's own file.
HTML <button> elements replaced <span> elements styled as buttons throughout the app. Browsers understand what a button is — focus behavior, keyboard accessibility, semantic meaning. The styling is equivalent, the semantics are better.
Coordinates stored as a POINT type in MySQL rather than separate lat/lng columns. Easier to work with for any map or proximity services later.
Next Week
The found page has UI. The API backend to receive and process the found item submission still needs to be built.
