Skip to content

Rename stalls to items and fix the broken initial migration - #65

Merged
Kaushik4141 merged 1 commit into
Developer-Kommunity-24:mainfrom
Kaushik4141:rename-stalls-to-items
Aug 7, 2026
Merged

Rename stalls to items and fix the broken initial migration#65
Kaushik4141 merged 1 commit into
Developer-Kommunity-24:mainfrom
Kaushik4141:rename-stalls-to-items

Conversation

@Kaushik4141

Copy link
Copy Markdown
Collaborator

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. items covers booths, teams, projects, talks, films and nominees equally, where candidates/entries/nominees each smuggle in an assumption.

Rename

  • Table stallsitems, ratings.stall_iditem_id, and the unique index on (user_id, stall_id)
  • Route mount /api/v1/stalls/api/v1/items
  • fetchStall / refreshStallAggregates / getStallBySlugfetchItem / refreshItemAggregates / getItemBySlug
  • stalls.Service.ts, stalls.route.ts, stalls.Controller.tsitems.* (moved with git mv, so they show as renames)
  • packages/shared/index.ts: VoteRequest.stallIditemId
  • Frontend state and props in App.tsx, RatingScreen, ProgressScreen, ScannerScreen, CompletionScreen

Fixed the initial migration

0001_initial.sql 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. Rewritten to match the ORM schema exactly, including AUTOINCREMENT on both surrogate keys and the NOT NULL constraints the ORM assumes.

Two things worth a second look

The wire format changes. VoteRequest.stallIditemId and the progress endpoint now returns itemId/itemName instead of stallId/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 localStorage keys were renamed (ratedStallsratedItems). Anyone with the old key cached sees an empty rated list until the server sync in App.tsx overwrites 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 11 hardcoded in the copy and in vote.Service.ts is deliberately untouched; that belongs to #55.

Verification

  • pnpm build passes
  • npx tsc --noEmit in apps/api is clean (turbo skips it — the API has no build script, which is worth fixing separately)
  • npx eslint . in apps/web is clean
  • Ran 0001_initial.sql against an in-memory SQLite and diffed the resulting columns against schema.ts — they match
  • A whole-word grep for stall returns only docs/ prose about the original event. .gitignore, ci.yml, apps/web/README.md and the lock files were left alone; their matches are the substring "install"

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.
@Kaushik4141
Kaushik4141 merged commit 70a3bb1 into Developer-Kommunity-24:main Aug 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename stalls to items and fix the broken initial migration

1 participant