A lunch randomizer worth studying for its architecture docs, not its spinning wheel
on: truanayangi-com/truanayangi
The Vietnamese lunch-decision problem is real, and this repo solves it with appropriate seriousness: spin a wheel, get a meal suggestion, stop arguing with your coworkers. "Trưa Nay Ăn Gì" translates roughly to "What to eat for lunch today," and the app does exactly that — a browser-based randomizer with filtering, custom dish lists, and preference storage.
What's worth noting architecturally is the deliberate choice to keep everything local and cookied. No login, no backend, no .env file required. Preferences, spin history, and custom lists all live in browser cookies, which means clearing cookies resets everything and nothing syncs across devices. The README is honest about the failure modes: if cookies are blocked or the dish list grows too large, the app will tell you it couldn't save. That's a reasonable trade-off for a tool that genuinely needs zero infrastructure to run.
The GitHub Pages setup reveals something about how the project thinks about consistency. Rather than deploying a static build to Pages, the repo redirects all Pages traffic to the production site at truanayangi.com. The reasoning is explicit: a second static deployment would drift from the production frontend, and login cookies wouldn't survive an origin change on reload. So the public repo is the community-runnable version, and the production frontend lives in a separate private repo. Only the redirect folder gets published to the gh-pages branch. This is a clean split, though it means any UI or animation changes shared between the two need coordinated updates in both places — a maintenance surface the README acknowledges directly.
The stack requires Node.js 22.12 or newer and pnpm at whatever version is pinned in package.json. The dev server binds only to 127.0.0.1, not 0.0.0.0, which is a small but correct default for a local tool. External links only fire on explicit user interaction; after install, the app loads from local resources.
The repo was migrated from an earlier account (nagisanzenin/truanayangi) with Git history and community contributions preserved. Contributions are welcome in Vietnamese or English, draft PRs are fine, and no prior issue approval is required. That's a low-friction contribution model that matches the project's scope.
This is a small, well-scoped tool that does one thing and explains its constraints clearly. The architecture choices — cookie-only storage, no backend, redirect-only Pages deployment — are all justified in the README rather than glossed over. For anyone building lightweight, zero-infrastructure browser tools, the explicit reasoning about where state lives and why is more instructive than the spinning wheel itself.
A lunch randomizer that earns attention not for what it does but for how clearly it explains every architectural trade-off it made.