Load the real food menu (11 categories, 137 items)

- app/src/data/menu-data.mjs: single source for PB sync + offline fallback
- pb/migrations/1788500000_menu_items_v2.js: price number -> text (supports
  ranges like 449/549), adds group field for veg/non-veg badges
- scripts/update-menu.mjs: replaces menu_categories/menu_items in any
  PocketBase (local dev or https://admin.greatbear.in)
- menu cards: category icons when no image, FSSAI-style dietary badge,
  text prices, optional pairing/tag footer
- content.json drops placeholder menu arrays (menu now lives in code)
This commit is contained in:
2026-09-03 18:04:46 +05:30
parent 0ff90cde27
commit bcb41353ce
8 changed files with 784 additions and 140 deletions
+20
View File
@@ -150,6 +150,26 @@ Content collections: `brews`, `menu_categories`, `menu_items`, `experiences`, `t
The seed only creates records that are missing (matched by `uid`), so edits made in the admin
are never overwritten by redeploys. Schema changes belong in `pb/migrations/`.
## Updating the food menu
The food menu is managed in code: `app/src/data/menu-data.mjs` (11 categories, ~137 items,
single source for the PocketBase sync **and** the site's offline fallback).
```bash
# 1. Edit app/src/data/menu-data.mjs, commit & push, deploy (if the image changed)
# 2. Sync the menu into PocketBase — from anywhere with admin credentials:
PB_URL=https://admin.greatbear.in \
PB_SUPERUSER_EMAIL=admin@greatbear.in \
PB_SUPERUSER_PASSWORD=... \
node scripts/update-menu.mjs
```
The script **replaces** all `menu_categories` / `menu_items` records (deletes old, inserts
new) and touches nothing else. Item prices are text, so ranges like `449/549` work;
`group` (`veg` / `nonveg`) drives the dietary badge; `image` is an optional URL. Admin edits
to menu records are overwritten by the next sync — treat this file as the menu's source of
truth.
## Container environment
| Variable | Default | Purpose |