Skip to content

Foodbank Barley

v1.0

A food bank's web app on a warm oat bento: drag items into a parcel crate to pack it, with donations, stock, households, volunteers and reports.

$69

Page address: /

Built in

What you get
  • Light and darkUses your theme colors
  • Desktop, tablet, and phoneThe screens it is built for
  • Packages…
  • Code size…
  • Light on battery30 fps, idle when still
  • Pauses when hiddenOff-screen or other tab
  • Reduce motionCalm for people who ask

Checked on every change

Security checked Dec 3
  • Type checkTypeScript strict
  • Lint and formatESLint · Prettier
  • Tests and buildLight and dark screenshots
  • Security auditNo high or critical advisories
  • Package ageEvery version public 7+ days
  • Idle CPUUnder half a core at rest, ≤ 30 fps

Code

foodbank-barleyReact
  • foodbank-barley.tsxThe page: the sections in order.
  • content.tsEvery word and number: brand, nav links, each section's copy and lists.
  • theme.tsThe colors as CSS variables, and the shared class strings.
  • README.mdHow to install it, and where to change the text, colors and form.
  • pagesOne file per page: the sections it shows, in order.
    • donations.tsxDonations: the last 7 days' kilos in (the hero), the mix by category, this month's donors and the top one, and the log you search, filter by category and open to edit.
    • household.tsxOne household: its kilos a week over the last six weeks, its visits, today's pickup, and tabs for visits, needs and the referral, with edit and archive.
    • households.tsxHouseholds: how many homes were helped this week against the target, the needs to plan parcels for, new referrals, today's pickups, and the searchable list of referred households.
    • overview.tsxThe Overview: a bento of the week's kilos, today's parcels, the shift on now, low stock, households helped, the latest in and use-by soon, around the packing tile. It stays live: the door scale logs a delivery and the front desk hands out a parcel every few seconds while it is on screen.
    • parcels.tsxParcels: today's pickups packed by household size — how many are packed, on the shelf and handed out, the packing list for each size, and the day's list to hand out, move back or remove.
    • reports.tsxReports: kilos in and out a week, households helped, use-by waste and kilos in by category, over the last 4, 12 or 26 weeks (?range=).
    • settings.tsxThe settings page: the food bank's own settings (weekly target, door hours, when each category counts as low) and Appearance (style, theme and language), as two tiles.
    • sign-in.tsxThe sign-in page (#/sign-in): the logo, the food bank and the form on one card over the oat backdrop, without the rail and top bar.
    • stock.tsxStock: kilos on the shelves by category against each low mark (the hero), what goes out of date this week, the low categories and the item count, and every shelf item, searchable and filtered, opened to edit.
    • volunteer.tsxOne volunteer: who they are and how to reach them, hours given this year, their next shift, and tabs for their shifts this week and the roles they take.
    • volunteers.tsxVolunteers: who is on shift now (with a live countdown), how well the week ahead is covered, people by role, the week's shifts by day and the list of volunteers.
  • sectionsOne file per page section.
    • account-menu.tsxThe account menu under the avatar in the top bar: who is signed in, Settings and Sign out; the arrow keys move through it, Escape, Tab or a click outside closes it.
    • appearance.tsxSettings → Appearance: the style (Glass or Solid) and the theme (System, Dark or Light), each choice shown as a small preview, and the language (System or one of locales/list.ts).
    • booking-dialog.tsxBook a pickup for today: pick a household without a parcel yet and a pickup time between the doors opening and closing.
    • crate.tsxThe parcel crate the packing tile fills: a slatted box whose packed items stack up from its floor, each dropping in as it is added, lit while an item is dragged over it, and stamped Ready once the parcel is saved.
    • donation-dialog.tsxThe dialog to log a new donation or edit one: donor, donor type, category and weight, checked inline; an edit can also delete it, with Undo.
    • household-dialog.tsxA new referral or a household's edit: name, people, area, phone, who referred them, until when, and the needs their parcels plan for.
    • overview-tiles.tsxThe Overview's tiles around the packing tile: the week's kilos (the hero, live from the door scale), today's parcels ring, the shift on now with its countdown, low stock counting down as you pack, households helped, the latest donations in and what goes out of date soon.
    • pack-list-dialog.tsxEdit one household size's packing list: how many units of each food category go in its parcel, 0 to 30.
    • packing-tile.tsxThe Overview's packing tile, the app's signature: the next parcel to pack, its items as chips you drag into the crate (or tap), the crate filling with stacked blocks, the Stock low tile counting down as each one goes in, and Save as ready taking it all off the shelves.
    • person-dialog.tsxAdd or edit a volunteer: their name, phone and the roles they take, picked as toggle pills; saves through the fake API and says so in a toast.
    • shift-dialog.tsxAdd or edit a shift: the day (one of the next seven), its times, the role, how many people it needs and who is on, picked from the volunteers who take that role; an existing shift can be removed.
    • sidebar.tsxThe left rail: the logo and food bank, search with the command palette shortcut, the pages in three groups with an ochre pill that glides to the current one, and today's opening hours at the foot.
    • sign-in-form.tsxThe sign-in form: email and password with their errors under them, show or hide the password, keep me signed in, and the demo account to fill in; a wrong pair says so above the fields.
    • stock-dialog.tsxThe dialog to add a shelf item or edit one: name, category, shelf, units, kilos per unit and use-by, checked inline; an edit can also remove it or log it as waste, with Undo.
    • top-bar.tsxThe top bar: the menu button on narrow screens, where you are, the main action (log a donation), the theme switch and the account menu. Plain at rest; once the page scrolls it gets a soft blur, a ground fill and a thin bottom edge.
  • partsWhat several sections share.
    • buildWhat several sections share.
      • cardsWhat several sections share.
        • unfold.tsThe unfold card style: cards unfold downward from their top edge, their contents fading in.
      • rowsWhat several sections share.
        • stack.tsThe stack row motion, a drawer: the rows on screen start stacked under the first and spread to their places together.
      • core.tsxThe page's build-in: on first load and on every page switch the cards arrive in the app's card style and their contents build: bars grow, lines draw, rings fill, the list rows on screen ripple in in the app's row motion, numbers count. The two picks are wired in ./index.ts.
      • index.tsThe app's two build-in picks, wired here and nowhere else: its card style (cards/) and its row motion (rows/). npm run new-app copies only the two it is given (--cards, --rows).
    • appearance.tsHow the app looks right now: dark or light, Glass or Solid, from Settings → Appearance, the page around it and the Style setting.
    • avatar.tsxA person's initials in a round badge, tinted with the primary.
    • backdrop.tsxThe Glass style's backdrop: what shows through the see-through panels, faded out in Solid; with followBackground it paints your background instead.
    • charts.tsxThe charts the tiles draw: rounded bars with the current one in the accent, a smooth line with a soft area under it, a ring that fills, a meter and a share bar. Every color is a theme shade; each plot box carries data-chart for the studios.
    • clock.tsThe demo's clock and the one shared live clock: "now" is today at 11:20 plus the time since the app loaded (so today is never thin), and every live tile ticks on one timer, at most 30 times a second, paused in a hidden tab and while the tile is off screen.
    • command-palette.tsxThe command palette (⌘K or Ctrl K): type to find a page or an action, then Enter.
    • dialog.tsxA centered modal dialog (a form, a confirm): rises in, plays its way out, Escape or a tap outside closes it, and the focus goes back where it was.
    • drag-crate.tsDrag an item chip into the parcel crate: mouse and pen after a few pixels, touch after a short hold (a swipe still scrolls), the lifted copy kept under the grab point, the crate lighting up while it is over it, the copy sinking into the crate on a drop or gliding home on a miss, and Escape to cancel. A plain click, Enter or Space puts the item in at once (the tap and keyboard path).
    • field.tsxA labeled form field (a text input or a select) with its error line under it, tied together for screen readers.
    • format.tsHow numbers and dates are written: by Intl, the current language's way ("1,240", "1.240"; "Nov 19", "19 nov."). Add a helper here when a page needs money, times or a list.
    • grids.tsEach page's bento: the named tile areas at phone and tablet (2 columns), small laptop (4, from a 64rem wide app) and desktop (6, from 86rem). Every row is filled, so the grid closes into a rectangle at each width.
    • icons.tsxThe logo and the line icons, drawn on a 24-unit grid with round ends: the rail's pages, the food categories and the small action marks.
    • language.tsThe app's language: the words every page reads (useWords), how dates and numbers are written (parts/format.ts) and the reading direction. Picked in Settings → Appearance (or System: the page's own language) and kept in this browser; English is built in, any other language loads only when it shows (locales/list.ts).
    • moments.tsThe animations the rail, the sign-in card, menus, dialogs, the phone sheet, toasts, the crate's blocks and stamp, new rows and the live dot play, timed by their moments in theme.ts.
    • motion.tsMotion helpers: the reduced-motion check, live, and run-once-in-view.
    • router.tsThe page switcher: reads the app's page from the address hash (#/settings, #/?status=open).
    • scroll-to-view.tsScrolls an element into view moving only its own scroll container, never the page around it.
    • select-box.tsxA native select dressed to match the app: no browser arrow, a drawn chevron instead.
    • session.tsWhether someone is signed in: a first visit is signed in as the demo account; Sign out holds until the next sign-in, and a sign-in without Keep me signed in lasts only this tab.
    • sheet.tsxThe phone sheet: a modal panel that springs in from the left with the sidebar; Escape, a tap outside or its close button slides it away.
    • states.tsxThe data states every page shares: a calm skeleton while loading, an error with Try again, and an empty note with a way out.
    • store.tsThe app-wide state several parts share: the theme mode and style (kept in the browser) and the toasts.
    • ticker.tsxA number that counts up while its page builds in, and rolls to its new value whenever it changes.
    • tile.tsxThe bento's pieces: a tile (one idea, an h3, one card look), the hero variant, the page head over the grid, the grid's loading skeleton and the small marks tiles share (live dot, status chip).
    • toasts.tsxThe toasts: short notes that confirm what just happened, at the bottom end.
    • use-api.tsLoads data through the fake API with loading, error and retry, remembering each answer so a page you come back to shows at once.
    • use-dialog.tsOpens and closes a native <dialog> as a modal; on close it plays its way out first (data-closing), so dialogs, sheets and the palette never vanish in one frame.
  • dataThe pretend data and the fake API: swap it for your backend.
    • account.tsThe demo account: who is signed in (the account menu shows them) and the email and password the sign-in page takes.
    • api.tsThe fake API: every page loads and saves through these functions, so wiring a real backend happens here only.
    • db.tsThe pretend database the fake API reads and writes: made from data/seed.ts on first use and kept for the visit. The rules a real backend would hold live here too: which item a parcel takes (soonest use-by first, no meat for halal, vegetarian or no-pork homes) and what a hand-out or a waste changes.
    • seed.tsThe pretend food bank: 360 referred households (about 350 helped a week), 60 volunteers, the shelves, four weeks of donations at the door, today's pickups and half a year of weekly numbers. Made from a fixed seed, around the demo's today (parts/clock.ts).
    • types.tsThe shapes the fake API answers with: donations in, stock on the shelves, parcels packed and handed out, the households they go to, volunteers and their shifts, and the weekly numbers the reports read.
  • localesEvery word the app shows, one JSON file a language; list.ts names them.
    • en.jsonOne language's words, with the keys of en.json.
    • es.jsonOne language's words, with the keys of en.json.
    • list.tsThe languages the app offers, in the picker's order: one JSON file each, en.json the source. To remove one, delete its file and its line; to add one, copy es.json, translate it and add a line. English is built in; the rest load only when picked. TypeScript checks each file has en.json's keys, scripts/check/check-locales.mjs the rest (no extra keys, plural forms, {slots}).

foodbank-barley.tsx

The page: the sections in order.

Loading…
Good for
Food banks and pantries run by volunteers who log donations, watch stock and use-by dates, pack parcels and plan shifts.
How it works
Drag each item into the crate: blocks stack in, low stock counts down, and Save as ready shelves the parcel.
How to use
Edit words in locales/, colors in theme.ts and the food bank in data/seed.ts, and swap the bodies in data/api.ts for your backend.