تخطَّ إلى المحتوى

Boba Taro

v1.0

A bubble tea shop's back office in soft clay: a live order queue, a clay cup builder with puffy sliders and plopping toppings, menu, stock, pearl batches, staff and reports.

$69

عنوان الصفحة: /

مدمج

ما تحصل عليه
  • فاتح وداكنيستخدم ألوان سمتك
  • سطح المكتب والجهاز اللوحي والهاتفالشاشات المصمّم لها
  • الحزم…
  • حجم الكود…
  • خفيف على البطارية30 إطارًا في الثانية، ويهدأ حين يسكن
  • يتوقّف حين يُخفىخارج الشاشة أو في تبويب آخر
  • تقليل الحركةهادئ لمن يطلب ذلك

يُفحص مع كل تغيير

فُحص أمنيًا في 3 ديسمبر
  • فحص الأنواعTypeScript strict
  • التدقيق والتنسيقESLint · Prettier
  • الاختبارات والبناءلقطات شاشة بالوضعين الفاتح والداكن
  • تدقيق أمنيلا تحذيرات عالية أو حرجة
  • عمر الحزمكل إصدار منشور منذ أكثر من 7 أيام
  • المعالج عند السكونأقل من نصف نواة عند السكون، ≤ 30 إطارًا في الثانية

الكود

boba-taroReact
  • boba-taro.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.
    • builder.tsxThe cup builder: pick a tea, a milk and a size, set sweetness and ice on puffy sliders and drop toppings in; the clay cup changes as you go. Then add the cup to an order or save it to the menu. ?drink= starts from a menu drink, ?order= adds to that order, ?for=menu leads with saving to the menu.
    • home.tsxThe overview: the live order queue, the pearl pot, today's numbers, the top drinks, drinks per hour, what is running low and who is on shift. Every card links through to its page, already filtered.
    • menu.tsxThe menu: every drink as a little clay cup with its prices; filter by category or base tea (kept in the address), drag a cup by its handle (or use the arrow keys) to change the menu order, and mark a drink sold out. #/menu/<id> opens one drink.
    • orders.tsxOrders: the live queue as a board of four lanes (new, making, ready, picked up); drag a ticket to move it on, with Undo. The filters live in the address, so Back brings them back. #/orders/<id> opens one order.
    • reports.tsxReports: drinks made by hour, over 7 or 30 days (the range lives in the address), the toppings people add most as a clay donut, what was thrown out and what each drink sold, with a CSV export.
    • settings.tsxThe settings page: its title and Appearance (style, theme and language); add the app's own settings sections here.
    • sign-in.tsxThe sign-in page (#/sign-in): a big clay taro cup beside the form card over the backdrop, without the rail and top bar.
    • staff.tsxStaff: the week's rota as a grid of people by day (tap a shift to change it, an empty day to add one) and the team beside it. ?station= filters, and lives in the address. #/staff/<id> opens one person.
    • stock.tsxStock: teas, milks and toppings against their par level by shelf, with restock and waste, and today's pearl batches beside them (cook one, throw one out). ?group=, ?low=1 and ?batch=new live in the address. #/stock/<id> opens one item.
  • 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).
    • builder-dialogs.tsxThe builder's two endings: add the cup to an order (a new one, or one already in the queue), or save it as a drink on the menu.
    • cup-controls.tsxThe cup builder's controls: a puffy clay slider (sweetness, ice) whose knob follows the finger 1:1 and springs to the nearest stop, and the topping chips: tap one, or drag it onto the cup and let go.
    • drink-detail.tsxOne menu drink: its recipe (edit and save), which toppings guests may add and which it comes with, and its sales over 14 days, as tabs; open it in the builder or delete it.
    • order-detail.tsxOne order: its drinks (each a little cup), its timeline and its customer, as tabs; move it to the next step, change the pickup time, take a drink off, add one in the builder, or cancel it.
    • pearl-pot.tsxThe pearl pot: a clay pot where the batch now on simmers (pearls bob while it cooks, rest while it holds), with a live countdown to the next step and a sugar bar for how far along it is.
    • pearl-rail.tsxThe pearl rail: one glossy tapioca pearl per page in a clay straw down the left edge (a bar along the bottom on phones). The current pearl turns taro lilac with a caramel ring, swells and squashes with a spring, a sleeve glides behind it, and its name sits under it; the others' names pop out on hover.
    • person-detail.tsxOne person on the team: their shifts this week, their drinks made and pace, and their profile, as tabs; edit them or take them off the team.
    • shop-settings.tsxThe shop's own settings: counters open, opening hours, the pickup slot, the pearl cook and hold times and when stock counts as low.
    • 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.
    • staff-forms.tsxThe rota's forms: add, edit or delete a shift, and add or edit a person.
    • stock-detail.tsxOne stock item: its level against par and what it is worth, the pearl batches cooked from it, and its history of deliveries and waste, as tabs; restock, log waste, edit or delete it.
    • stock-forms.tsxThe stock room's forms: add or edit an item, restock or log waste for one, and put a pearl batch in the pot.
    • top-bar.tsxThe top bar: the logo and shop, the shop's clock, search, the theme switch and the account menu; once the page scrolls, the bar frosts itself so nothing reads through.
  • partsWhat several sections share.
    • buildWhat several sections share.
      • cardsWhat several sections share.
        • deal.tsThe deal card style: each card is dealt from the side of the current nav item, a short slide toward its place, one quickly after another.
      • 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: soft clay blobs and a scatter of taro pearls behind the clay, faded out in Solid; with followBackground it paints your background instead.
    • bar-chart.tsxA bar chart: bars grow in, and the picked bar (in the primary), its guide line and tooltip glide to the bar you point at or pick with the arrow keys; a new range morphs the bars instead of drawing them again.
    • bits.tsxThe small pieces every page shares: the page head, a pill switch of links (filters, tabs), the back link, a clay stat tile and a recipe turned into a cup's look.
    • board-model.tsA board as data: every card's place (one order) and column, and how a move changes them.
    • board.tsxA board of columns and cards: drag a card (mouse, pen or a short press on touch) with a lift and a gap where it will land, or pick it up with Space and move it with the arrow keys; the other cards glide out of the way.
    • clock.tsThe one clock every loop shares: at most 30 redraws a second, stopped while the tab is hidden; plus the shop's minute, for times that move on their own (late orders, the pearl pot).
    • command-palette.tsxThe command palette (⌘K or Ctrl K): type to find a page or an action, then Enter.
    • csv.tsExport CSV: turns rows into a CSV file and hands it to the browser to save.
    • cup.tsxThe clay cup: a puffy tumbler with a dome lid and a fat straw, drawn from a recipe. The liquid mixes its color from the tea, the milk and the sugar, ice cubes push the level up, and toppings sit in layers at the bottom; live, a new topping drops in with a bouncy plop and the surface splashes.
    • 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-board.tsThe board's drag engine: mouse, pen and touch drags with a lift, a gap where the card will land, auto-scroll near the edges, and a drop or Escape that settles the card into place.
    • field.tsxA labeled form field (a text input or a select) with its error line under it, tied together for screen readers.
    • flip.tsFLIP: when cards change place, each one glides from where it was to where it is now instead of jumping.
    • 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.
    • icons.tsxThe logo (a little clay boba cup) and the line icons, drawn on a 24-unit grid with round ends.
    • keyboard-move.tsMoving a board card with the keyboard: Space picks it up, the arrow keys move it, Space or Enter drops it, Escape puts it back; each step is read out.
    • 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).
    • line-chart.tsxA line chart with a soft area under it, in the primary: the line draws itself in, the latest point marked, and new values roll the line to its new shape.
    • moments.tsThe animations the sidebar, the sign-in card, menus, dialogs, the phone sheet and toasts 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.
    • 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.
    • toasts.tsxThe toasts: short clay notes that pop in to confirm what just happened, at the bottom end (above the pearl bar on phones).
    • 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.
    • menu.tsThe pretend menu: base teas, milks, toppings and the drinks built from them. Colors here are the drinks' own (a taro tea is purple in every theme), drawn by sections/cup.tsx.
    • orders.tsThe pretend order queue: today's open and recent orders, with times in minutes of the day around the shop's clock (data/shop.ts).
    • reports.tsThe pretend sales history behind Reports and Overview: drinks per hour, per day for 30 days, toppings sold and what was thrown out.
    • shop.tsThe shop's clock and its settings: the demo day starts at 3:40 PM and runs in real time from the moment the app loads, so pickup times, late orders and pearl batches stay believable whenever it is opened.
    • staff.tsThe pretend team: eight people, their station and role, this week's shifts (Monday first, hours of the day) and the drinks each made.
    • stock.tsThe pretend stock room: teas, milks and toppings with their levels against par, what each costs, how fast it goes, its log, and today's pearl batches.
  • 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}).

boba-taro.tsx

The page: the sections in order.

جارٍ التحميل…
مناسب لـ
Bubble tea and coffee shops with a couple of counters, a small crew and online pickup orders.
كيف يعمل
Tickets move along a live queue, a clay cup fills as you set sweetness and ice, and toppings plop in with a bounce.
طريقة الاستخدام
Edit words in locales/ and colors in theme.ts, and swap the bodies in data/api.ts for calls to your backend.