You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A production-grade, real-time food ordering and delivery platform built as a TypeScript monorepo. Three role-based interfaces -- Customer, Restaurant Owner, and Driver -- synchronized via WebSockets, secured with session-based authentication, and designed with a cinematic dark luxury UI.
Browse the home page, explore restaurant menus, add items to cart. Cart persists across sessions. Checkout redirects to login. After signing in, the cart is preserved and checkout continues.
Customer
Register with "Customer" role. Browse the cinematic home page with auto-play hero carousel, search restaurants, filter by cuisine. Open a restaurant to see the scroll-to-expand hero that reveals the menu. Add items, checkout via Card (Stripe) or Cash on Delivery. Track orders live with a 5-step animated progress bar. View order history with search, filters, and one-tap reorder.
Restaurant Owner
Register with "Restaurant" role. Add a restaurant via the 4-step onboarding wizard (Info, Menu Items, Preview, Launch). Manage orders on the Kitchen Cockpit dashboard with revenue chart, activity timeline, and order pipeline (Accept, Cook, Ready). Edit restaurant details (name, description, cuisine, image, delivery time) or delete restaurants from the "My Restaurants" section. Manage menu items per restaurant -- add, edit, delete items and toggle visibility.
Driver
Register with "Driver" role. View earnings, delivery count, and active stats. Accept available pickups (race-safe with 409 on conflict). Mark orders as delivered once picked up.
Architecture
Browser
+--------------+ +--------------+ +--------------+
| Customer | | Restaurant | | Driver |
+--------------+ +--------------+ +--------------+
| | |
v v v
+-----------------------------------------------+
| React 19 + Vite 7 Frontend |
| Zustand . React Query . Framer Motion |
| Wouter . Tailwind CSS 4 . Radix UI |
+------------------------+----------------------+
| Vite proxy
v
+-----------------------------------------------+
| Express 5 API Server |
| better-auth . Drizzle ORM . Zod . Pino |
| Socket.io . Stripe |
+------------------------+----------------------+
|
v
+----------------+
| PostgreSQL |
+----------------+
Tech Stack
Frontend
Technology
Purpose
React 19
UI framework
Vite 7
Build tool and dev server
Tailwind CSS 4
Utility-first styling
Radix UI
Accessible component primitives
Framer Motion
Carousel, 3D tilt, drag gestures, scroll animations
Driver accept uses optimistic locking: UPDATE ... WHERE driver_id IS NULL. Second driver receives 409 Conflict.
Real-Time Events
Event
When
Toast
order:created
New order placed
Restaurant: "New order received"
order:status_changed
Status updated
Customer: status label
order:accepted
Driver accepts
Driver: "Order assigned"
Authentication
Register via /api/auth/sign-up/email with name, email, password, role
better-auth creates user and account records, sets httpOnly session cookie
All API requests include the cookie via credentials: "include"
requireAuth validates session; requireRole checks role
Frontend useAuth() hydrates on mount via GET /api/auth/get-session
Cart clears on new account creation; persists across login sessions
Payment Flow
Card (Stripe): Order created, checkout session created, order enters pending_payment, browser redirects to Stripe, webhook confirms payment, order moves to placed, socket broadcasts.
Cash on Delivery: Order created, simulated session, order placed immediately, socket broadcasts.
Demo Mode: No Stripe keys set. All payments simulated. Order placed immediately.
Seeded Data
Run pnpm --filter @workspace/db run seed (idempotent).
Restaurant
Cuisine
Rating
Items
Ember and Co.
American
4.7
6
Sakura Ramen House
Japanese
4.8
7
Verde Pizza Kitchen
Italian
4.6
8
Fuego Cantina
Mexican
4.7
6
Lemongrass and Co.
Thai
4.9
7
Aegean Table
Mediterranean
4.8
6
3 driver profiles: Marcus Rivera, Priya Sharma, Jake Thompson.