Skip to content

About

VoxCesta: voice-ordering MVP for retail where mall shoppers order groceries by talking to a kiosk in Colombian Spanish. Kiosk, staff picking queue and admin dashboard share one live store. React, TypeScript, Vite, Zustand and the Web Speech API.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

VoxCesta

VoxCesta is a voice-ordering platform for retail: a shopper in a Colombian shopping mall orders their groceries by talking to a kiosk, the order is validated against the store's live inventory, a picking list is generated for store staff automatically, and the shopper is notified when it's ready to collect. This repo is a single-pilot-store MVP built to demo the concept to a retail chain — not a production, multi-tenant system.

It's one app with three connected surfaces, sharing one live data layer, so a reviewer can click between all three perspectives from the top navigation without leaving the page:

  • Kiosco de voz (/kiosco) — the customer-facing voice ordering experience. This is the centerpiece.
  • Picking (/picking) — a mobile-first work queue for store staff, with structured picking lists (product, quantity, shelf location).
  • Administración (/admin) — a manager's dashboard: orders in progress, average pick time, orders per hour, and today's activity.

Everything runs in Spanish (Colombian), since that's the real user base.

Running it

npm install
npm run dev

Then open the printed http://localhost:5173 URL. That's it — one install command, one start command, no environment variables or backend to stand up.

npm run build produces a static production build in dist/.

What's real vs. what's mocked

Real and working:

  • The full voice loop — Web Speech API SpeechRecognition for input and SpeechSynthesis for output — runs genuinely in the browser, in Spanish. There's a live transcript, a real-time microphone waveform (sampled from the actual mic via the Web Audio API, with a synthetic fallback if mic access fails), and a text-input fallback for when the mic is unavailable or denied.
  • Natural-language intent parsing (add/remove/change quantity/ask total/confirm/cancel, plus corrections like "quita eso" and "mejor dos", and compound requests like "quiero leche y pan") runs against the mock catalog with real stock-aware validation.
  • The full order lifecycle — confirmed → picking → ready → completed — is real application state shared live across all three views via a single Zustand store. Placing an order in the kiosk immediately creates a picking list in the Picking app and updates the Admin dashboard.
  • Stock is live: adding an item to the cart checks and caps against real catalog stock, checkout decrements it, and a handful of products start at zero stock or low stock specifically so the out-of-stock and substitution flows are demonstrable out of the box.
  • Admin metrics (average pick time, orders per hour, today's activity, unit mix by category) are computed live from actual order timestamps, not hardcoded.
  • The "ready for pickup" customer notification is a real in-app toast, fired the moment staff marks an order ready.

Mocked, by design, for the MVP:

  • No backend / no real database. The "backend" is a well-structured in-memory Zustand store (src/store/useStore.ts) rather than a Node/Express API with SQLite. For a single-pilot-store demo where all three surfaces live in one browser tab, this gets to a convincing, fully-working end-to-end flow fastest, without a server process to run alongside the dev server. The data model itself (products, orders, order items, picking status, event flow) is deliberately shaped like it could sit behind a real API later — see "Architecture" below. The tradeoff: state lives in memory and resets on a full page reload (client-side navigation via the top nav does not reset it — see the note below).
  • No real payment processor. Confirming an order shows a ~1.2s simulated "processing payment" step against a fake stored card, then completes.
  • No real voice API billing/integration. Speech is handled entirely by the free, built-in browser Web Speech API — see "Swapping in a real voice API" below for how this was kept swappable.
  • No real inventory/POS integration. The catalog (src/data/catalog.ts) is a hand-seeded set of ~32 realistic Colombian supermarket products across aseo, granos, lácteos, and panadería, with COP prices and shelf locations.
  • No authentication. The top nav is a simple, undisguised role switcher (customer / staff / admin) rather than a login flow, as scoped.
  • A day of seed history. The store starts with 13 seeded orders spread across the last ~2 hours (various statuses, including a substitution and an unavailable item already in their history) so the Picking queue and Admin dashboard have believable data to show immediately, before a reviewer places their first live order.

A note on state and navigation

Because there's no backend, all order/stock state lives in memory in the browser tab. Use the top navigation bar to switch between Kiosco / Picking / Administración — that's client-side routing and preserves everything you just did. A hard refresh or typing a new URL reloads the whole app and resets state back to the seed data.

Architecture

  • Vite + React 19 + TypeScript, styled with Tailwind CSS v4.
  • React Router for the three routes plus a landing/persona picker at /.
  • Zustand (src/store/useStore.ts) as the shared, in-memory "backend." It owns the catalog, orders, the customer's draft cart, and toast notifications, and exposes actions (confirmOrder, startPicking, setItemStatus, markOrderReady, completeOrder, …) that mutate state the same way real API calls would — each one is a plausible drop-in point for a future fetch()/POST if this becomes a real backend.
  • Data model (src/types/domain.ts): Product, Order, OrderItem (with its own pending / collected / unavailable / substituted status), and a simple confirmed → picking → ready → completed order status pipeline — the spine connecting all three surfaces.
  • Voice layer (src/voice/) is deliberately decoupled from the UI:
    • useSpeechRecognition.ts / useSpeechSynthesis.ts — thin wrappers around the browser APIs.
    • intent.ts — parseIntent(transcript, catalog, lastMentionedProductId) → Intent, a pure function with no browser or UI dependency.
    • respond.ts — respond(event) → string, turns an outcome into spoken Colombian Spanish.
    • matchProduct.ts — alias/name matching against the catalog, with basic Spanish plural handling.
    • features/kiosk/useVoiceKiosk.ts is the only place that wires these together with the store and the speech hooks into a conversation state machine (idle → listening → thinking → speaking).

Swapping in a real voice API later

The whole point of the parseIntent / respond split above is that neither function knows anything about the Web Speech API. To move to a real function-calling voice model (OpenAI Realtime API or similar):

  1. Replace useSpeechRecognition with a hook that streams audio to the realtime API and yields transcripts the same shape (a final string per turn) — useVoiceKiosk doesn't care where onFinalResult comes from.
  2. The realtime model would typically call structured tools directly instead of free text going through parseIntent. In that case, parseIntent's Intent union is effectively your tool-call schema already — map the model's function calls onto the same Intent shape (or expose add_item / remove_item / set_quantity / etc. as literal tool definitions) and feed the result into the same switch in useVoiceKiosk, unchanged.
  3. Replace useSpeechSynthesis.speak() with playback of the model's audio stream instead of the browser's SpeechSynthesisUtterance — or keep respond()'s generated text as the source of truth and just change how it's spoken.

Nothing in the store, the order lifecycle, or the Picking/Admin views needs to change.

Seeded catalog

~32 products across four categories (aseo, granos y abarrotes, lácteos y huevos, panadería) with realistic Colombian brand names, COP pricing, and shelf locations. A few products are seeded at zero or very low stock specifically so you can immediately try:

  • "Quiero pandebono" → out of stock, Voxi offers to suggest a replacement.
  • "Quiero cuatro cafés" → only 2 in stock, Voxi caps the quantity and says so.

Try it

On the kiosk, tap the orb (grants mic access) or use the quick-phrase chips / text field:

  • "Agrega dos libras de arroz"
  • "Quiero leche y pan"
  • "Mejor tres" (corrects the last item's quantity)
  • "Quita eso" (removes the last item)
  • "¿Cuánto llevo?"
  • "Confirmar pedido"

Then switch to Picking via the top nav to see the order appear instantly, work through it (mark items collected, flag one unavailable and substitute it), and mark it ready — then switch to Administración to see the dashboard update live, or back to Kiosco to see the "ready for pickup" toast.

About

VoxCesta: voice-ordering MVP for retail where mall shoppers order groceries by talking to a kiosk in Colombian Spanish. Kiosk, staff picking queue and admin dashboard share one live store. React, TypeScript, Vite, Zustand and the Web Speech API.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages