A production-style multi-user expense tracker in Go where the authorization boundary between one user's financial data and everyone else's is a literal SQL `WHERE id = $1 AND user_id = $2` clause -- not an application-layer check -- so a single flipped operator or dropped predicate is a real, silent cross-account data breach, not a cosmetic bug.
Nobody has started this yet — be first.
Deleting an in-use category returns a raw 500
Categories that still have expenses pointing at them are protected from deletion at the database level (a foreign key constraint) -- that part still works. But the application is supposed to translate that DB-level rejection into a clean, actionable 409 Conflict ("category is still used by existing expenses"). Right now it doesn't recognize the error and falls through to a generic 500, which looks like the server crashed instead of telling the user exactly what to do (remove or reassign the expenses first). This is a support-ticket generator: users will report "the app is broken" for entirely expected, preventable behavior.
About this project
Expense Tracker is a Go (net/http, Go 1.22+'s enhanced ServeMux, no external router) REST API for personal expense tracking: users register, log in with JWT-issued bearer tokens, create and categorize expenses, and pull a monthly summary with optional per-category budget warnings. Categories are either global defaults (seven are seeded for every user -- Food, Transport, Housing, Utilities, Entertainment, Health, Other) or private to one user, and every expense's category_id must reference one that is either global or owned by the expense's own user.
The interesting engineering problem sits in one deliberate design choice, stated plainly in the project's own README: every read or write of a per-user row -- an expense, a private category, a budget -- is scoped inside the SQL clause itself (), never by fetching a row and checking its owner in application code afterward. A non-owner's request for someone else's row matches zero rows and returns a 404, identical to the id simply not existing -- there is no 403 Forbidden anywhere in this API, because returning one would itself confirm the id is valid and just belongs to someone else. That design makes the clause the single, load-bearing enforcement point for every resource in the system, which is exactly what makes a boolean operator getting flipped ( instead of ) or a predicate silently dropped (a missing ) such a severe class of bug here -- it isn't a typo, it's a hole in the actual security boundary. The same project also centers correct half-open-range month-boundary date math (for monthly summaries and budget-warning checks) and JWT token-expiry handling as first-class correctness problems, not incidental details.
Monthly summary drops expenses dated the last day of the month
Every user's month-end summary -- and every category budget-warning check, which reuses this exact date math -- silently undercounts spending by excluding anything dated on the final calendar day of the month. A user who pays rent or a subscription on the 30th/31st sees a "total spend this month" that's simply wrong, and -- worse -- a user relying on the budget-warning feature to catch overspending can blow through their limit on the last day of the month and never get warned, silently defeating the one feature that exists to prevent exactly that.
WHEREid = $1 AND user_id = $2WHEREORANDuser_id IS NULL ORTen tickets are deliberately injected into an otherwise working, tested Go codebase -- six bugs and four enhancements, ranging from a one-character SQLSTATE mixup and an unescaped regex dot to the OR/AND WHERE-clause flip described above and a JWT that's issued with no expiry claim at all. Every ticket has a dedicated Go test in practicetickets/ that goes green once the fix (or the feature) is correct, and several tickets are called out as collaterally breaking this project's own existing integration suite (cmd/server/*_test.go, including TestCrossUserExpenseIsolation) while they're unresolved -- that's intentional, and it's the clearest possible signal a ticket still needs work.