Rename stalls to items and fix the broken initial migration - #65
Merged
Kaushik4141 merged 1 commit intoAug 7, 2026
Merged
Conversation
The app was built for a startup expo, so the domain concept was named "stalls" throughout. For a generic voting system the internal name should be neutral: items covers booths, teams, projects, talks, films and nominees equally. Renamed the stalls table to items and ratings.stall_id to item_id, the route mount /api/v1/stalls to /api/v1/items, the three stalls.* files to items.*, and the fetchStall/refreshStallAggregates/ getStallBySlug helpers to their item equivalents. VoteRequest.stallId becomes itemId, which changes the wire format; the API and web app deploy from the same commit so they stay in step. Also rewrote 0001_initial.sql, which did not match schema.ts: it declared is_completed where the ORM says completed, and its item table omitted description, logo and all five aggregate columns. A fresh clone produced a database the code could not query. User-facing copy still says "Item" literally; making it configurable is follow-up work.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #53.
The app was built for a startup expo, so the domain concept was named "stalls" everywhere — the table, the route path, the services, every frontend prop. For a generic voting system that name should be neutral.
itemscovers booths, teams, projects, talks, films and nominees equally, wherecandidates/entries/nomineeseach smuggle in an assumption.Rename
stalls→items,ratings.stall_id→item_id, and the unique index on(user_id, stall_id)/api/v1/stalls→/api/v1/itemsfetchStall/refreshStallAggregates/getStallBySlug→fetchItem/refreshItemAggregates/getItemBySlugstalls.Service.ts,stalls.route.ts,stalls.Controller.ts→items.*(moved withgit mv, so they show as renames)packages/shared/index.ts:VoteRequest.stallId→itemIdApp.tsx,RatingScreen,ProgressScreen,ScannerScreen,CompletionScreenFixed the initial migration
0001_initial.sqldid not matchschema.ts. It declaredis_completedwhere the ORM sayscompleted, and its item table omitteddescription,logo, and all five aggregate columns. A fresh clone produced a database the code could not query. Rewritten to match the ORM schema exactly, includingAUTOINCREMENTon both surrogate keys and theNOT NULLconstraints the ORM assumes.Two things worth a second look
The wire format changes.
VoteRequest.stallId→itemIdand the progress endpoint now returnsitemId/itemNameinstead ofstallId/stallName. The API and web app deploy from the same commit so they stay in step, but this is the one part of the rename that is not purely cosmetic.Two
localStoragekeys were renamed (ratedStalls→ratedItems). Anyone with the old key cached sees an empty rated list until the server sync inApp.tsxoverwrites it, which happens on the next sign-in. No data is lost — the server is the source of truth — but it is a visible blip for a returning user, so worth knowing.On user-facing copy
Strings like "Current Stall" and "Stall Directory" now read "Current Item" and "Item Directory" so the whole-word grep comes back clean. Making them configurable is #57's job — this PR only takes them to the neutral default.
The
11hardcoded in the copy and invote.Service.tsis deliberately untouched; that belongs to #55.Verification
pnpm buildpassesnpx tsc --noEmitinapps/apiis clean (turbo skips it — the API has nobuildscript, which is worth fixing separately)npx eslint .inapps/webis clean0001_initial.sqlagainst an in-memory SQLite and diffed the resulting columns againstschema.ts— they matchstallreturns onlydocs/prose about the original event..gitignore,ci.yml,apps/web/README.mdand the lock files were left alone; their matches are the substring "install"