Skip to content

masterabdullah95/quickbite-eats

Repository files navigation

QuickBite

A modern, full-stack food ordering web application built with React, TypeScript, Tailwind CSS, and Lovable Cloud (powered by Supabase). Browse a curated menu, add items to your cart, and place orders for delivery β€” all with real-time data, smooth animations, and a fully responsive design. Includes a secure Admin Dashboard for managing orders, menu items, customers, and analytics.

Frontend: https://quickbiteeats.lovable.app

Admin Panel: https://quickbiteeats.lovable.app/admin

Username: experthamza95@gmail.com

Password: a!2#c6


✨ Features

Customer-Facing

  • Browse Menu β€” Explore dishes across categories: Burgers, Pizza, Pasta, Drinks, and Desserts.
  • Item Detail Modal β€” Tap any dish to view details, adjust quantity, and add to cart.
  • Shopping Cart β€” Slide-out cart drawer with quantity controls and live subtotal.
  • Secure Checkout β€” Delivery details form with Cash on Delivery payment, order summary sidebar.
  • Order History β€” Track all your past orders with status badges (Pending β†’ Preparing β†’ Out for Delivery β†’ Delivered).
  • User Authentication β€” Email/password sign-up and sign-in, plus Google OAuth login.
  • Auto Profile β€” Profile created automatically on sign-up; delivery details pre-filled at checkout.
  • Responsive Design β€” Fully mobile-first, card-based layout that works beautifully on all devices.
  • Smooth Animations β€” Framer Motion powered page transitions, modals, and cart interactions.
  • Toast Notifications β€” Real-time feedback for cart actions and order placement via Sonner.

Admin Dashboard (/admin)

  • Role-Based Access Control β€” Only users with admin role in the user_roles table can access the admin panel.
  • Dashboard Overview β€” Live KPI cards (orders today, revenue today, pending orders, menu items, customers) plus a 7-day order volume bar chart.
  • Order Management β€” Full order list with search, status filtering, pagination, inline status updates, and detailed order modals.
  • Menu Management β€” Full CRUD for menu items (create, edit, delete, toggle availability).
  • Customer Management β€” Searchable customer list with individual order history detail views.
  • Analytics β€” Revenue trends (30-day line chart), top-selling items (bar chart), category distribution (pie chart), and peak ordering hours heatmap.
  • Real-time Updates β€” Orders appear instantly in the dashboard via Supabase Realtime subscriptions.

πŸ›  Tech Stack

Layer Technology
Framework TanStack Start (React 19, file-based routing, SSR/SSG)
Language TypeScript (strict mode)
Styling Tailwind CSS v4 with custom design tokens
UI Components shadcn/ui (Radix UI primitives + custom variants)
Animations Framer Motion
Charts Recharts
State Management Zustand (cart store)
Backend / Database Lovable Cloud (PostgreSQL + Auth + Row Level Security + Realtime)
Icons Lucide React
Build Tool Vite 7
Runtime Cloudflare Workers (edge)

🎨 Design System

QuickBite uses a warm, appetizing color palette defined in src/styles.css:

Token Value Usage
Primary #E8470A (Deep Orange) Buttons, accents, links, CTAs
Background #FFF8F0 (Cream White) Page background
Foreground #1A1A1A (Charcoal) Body text, headings
Card #FFFFFF Cards, modals, drawer
Muted #F5F0EB Secondary backgrounds
Accent #FFE8D6 Highlights, tags, badges
Border #E8E0D8 Dividers, input borders
Admin Sidebar #0F172A (Slate 900) Admin panel dark sidebar
  • Font: Poppins (display/headings) + Inter (body)
  • Border Radius: 0.75rem base, rounded cards and buttons
  • Shadows: Warm orange-tinted shadows for depth
  • Gradients: linear-gradient(135deg, #E8470A, #F28A4D) for primary buttons

πŸ“ Project Structure

β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/              # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ FoodCard.tsx         # Menu item card with add-to-cart
β”‚   β”‚   β”œβ”€β”€ CartDrawer.tsx       # Slide-out shopping cart
β”‚   β”‚   β”œβ”€β”€ Navbar.tsx           # Top navigation with auth state
β”‚   β”‚   β”œβ”€β”€ Footer.tsx           # Site footer
β”‚   β”‚   β”œβ”€β”€ admin/
β”‚   β”‚   β”‚   └── AdminLayout.tsx  # Admin sidebar + header + mobile drawer
β”‚   β”‚   └── ui/                  # shadcn/ui primitives (button, dialog, sheet, etc.)
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ use-auth.ts          # Auth session hook (Supabase)
β”‚   β”‚   └── use-admin.ts         # Admin role checker hook
β”‚   β”œβ”€β”€ integrations/
β”‚   β”‚   β”œβ”€β”€ lovable/             # Lovable Cloud Auth (OAuth broker)
β”‚   β”‚   └── supabase/            # Supabase clients (browser, server, middleware)
β”‚   β”œβ”€β”€ routes/                  # TanStack file-based routes
β”‚   β”‚   β”œβ”€β”€ __root.tsx           # Root layout (Navbar + Footer + Outlet)
β”‚   β”‚   β”œβ”€β”€ index.tsx            # Homepage (hero + popular items)
β”‚   β”‚   β”œβ”€β”€ menu.tsx             # Full menu with category filters
β”‚   β”‚   β”œβ”€β”€ checkout.tsx         # Checkout page (delivery + payment)
β”‚   β”‚   β”œβ”€β”€ orders.tsx           # Order history for logged-in users
β”‚   β”‚   β”œβ”€β”€ order-confirmation.tsx  # Post-order success page
β”‚   β”‚   β”œβ”€β”€ login.tsx            # Sign-in (email + Google OAuth)
β”‚   β”‚   β”œβ”€β”€ signup.tsx           # Sign-up (email)
β”‚   β”‚   β”œβ”€β”€ about.tsx            # About / contact page
β”‚   β”‚   β”œβ”€β”€ admin.tsx            # Admin route guard (redirects non-admins)
β”‚   β”‚   β”œβ”€β”€ admin.index.tsx      # Admin dashboard overview
β”‚   β”‚   β”œβ”€β”€ admin.orders.tsx     # Admin order management
β”‚   β”‚   β”œβ”€β”€ admin.menu.tsx       # Admin menu CRUD
β”‚   β”‚   β”œβ”€β”€ admin.customers.tsx  # Admin customer list + history
β”‚   β”‚   └── admin.analytics.tsx  # Admin analytics charts
β”‚   β”œβ”€β”€ server.ts                # Server entry point
β”‚   β”œβ”€β”€ start.ts                 # Start instance configuration
β”‚   β”œβ”€β”€ router.tsx               # Router setup
β”‚   β”œβ”€β”€ store/
β”‚   β”‚   └── cart.ts              # Zustand cart store (items, qty, open/close)
β”‚   └── styles.css               # Global styles + Tailwind theme tokens
β”œβ”€β”€ supabase/
β”‚   β”œβ”€β”€ config.toml              # Supabase CLI config
β”‚   └── migrations/              # Database migrations (tables, RLS, seed data, roles)
β”œβ”€β”€ package.json
β”œβ”€β”€ vite.config.ts
β”œβ”€β”€ tsconfig.json
└── wrangler.jsonc               # Cloudflare Workers config

πŸ—„ Database Schema

The app uses a PostgreSQL database with the following tables:

profiles

Stores extended user info linked to Supabase Auth.

Column Type Notes
id UUID FK β†’ auth.users, primary key
full_name TEXT User's display name
email TEXT Email address
phone TEXT Contact number
address TEXT Default delivery address
created_at TIMESTAMPTZ Auto-generated

user_roles

Role-based access control. One row per role assignment.

Column Type Notes
id UUID Auto-generated
user_id UUID FK β†’ auth.users
role app_role admin or customer

menu_items

The food menu catalog.

Column Type Notes
id UUID Auto-generated
name TEXT Item name
description TEXT Item description
price NUMERIC Price in USD
category TEXT Burgers, Pizza, Pasta, Drinks, Desserts
image_url TEXT Unsplash image URL
rating NUMERIC Default 4.5
is_available BOOLEAN Default true
created_at TIMESTAMPTZ Auto-generated

orders

Customer orders.

Column Type Notes
id UUID Auto-generated
user_id UUID FK β†’ auth.users
status TEXT Pending / Preparing / Out for Delivery / Delivered / Cancelled
total_amount NUMERIC Order total including delivery
delivery_address TEXT Delivery location
phone TEXT Contact number
full_name TEXT Recipient name
created_at TIMESTAMPTZ Auto-generated

order_items

Line items for each order.

Column Type Notes
id UUID Auto-generated
order_id UUID FK β†’ orders
menu_item_id UUID FK β†’ menu_items
quantity INTEGER Item count
unit_price NUMERIC Price at time of order
name TEXT Item name (snapshot)

Row Level Security (RLS)

  • Menu items: Public read for all visitors. Admins can create, update, and delete.
  • Profiles: Users can only read/insert/update their own profile. Admins can read all.
  • Orders: Users can only read/insert their own orders. Admins can read and update all.
  • Order items: Users can only access items belonging to their own orders. Admins can read all.
  • User roles: Managed via a security-definer has_role() function to prevent recursive RLS checks.

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ (or Bun)
  • A Lovable Cloud backend (Supabase project) β€” already configured via .env

Install Dependencies

bun install
# or
npm install

Run Development Server

bun dev
# or
npm run dev

The app will be available at http://localhost:3000.

Build for Production

bun run build
# or
npm run build

Preview Production Build

bun run preview
# or
npm run preview

πŸ” Authentication

QuickBite supports two authentication methods:

  1. Email + Password β€” Standard Supabase Auth with email confirmation.
  2. Google OAuth β€” Managed via Lovable's OAuth broker (@lovable.dev/cloud-auth-js). Users are redirected to Google's consent screen, and tokens are securely injected into Supabase Auth upon return.

The useAuth() hook (src/hooks/use-auth.ts) provides reactive session state across the app.


πŸ›’ Cart System

The cart is managed via a Zustand store (src/store/cart.ts) with the following features:

  • Add items β€” Click "Add to Cart" on any food card or from the item modal.
  • Quantity control β€” Increment/decrement in the cart drawer or item modal.
  • Remove items β€” One-tap removal from the cart drawer.
  • Live totals β€” Subtotal and item count update instantly.
  • Persistent during session β€” Cart state persists across page navigation within the session.
  • Slide-out drawer β€” Animated cart drawer accessible from the navbar.

Delivery fee is fixed at $2.99.


πŸ›‘οΈ Admin Dashboard

The admin panel lives at /admin and is completely separate from the customer-facing app.

Granting Admin Access

To make a user an admin, insert a row into the user_roles table:

INSERT INTO public.user_roles (user_id, role)
VALUES ('<USER_UUID>', 'admin');

Only users with role = 'admin' can access /admin and its sub-routes. Non-admins are redirected to the home page.

Admin Pages

Route Description
/admin Dashboard overview with live stats and 7-day order chart
/admin/orders Search, filter, paginate, and update order statuses
/admin/menu Full CRUD for menu items (add, edit, delete, toggle availability)
/admin/customers Customer directory with order history detail modal
/admin/analytics Revenue trends, top-selling items, category breakdown, peak hours

πŸ“ Scripts

Command Description
dev Start Vite dev server with HMR
build Build for production (SSR + client)
build:dev Build in development mode
preview Preview production build locally
lint Run ESLint across the project
format Format code with Prettier

πŸ“¦ Key Dependencies

  • React 19 + React DOM
  • TanStack Start β€” Full-stack React framework
  • TanStack Router β€” Type-safe file-based routing
  • TanStack Query β€” Server state management
  • Tailwind CSS v4 β€” Utility-first styling
  • Framer Motion β€” Declarative animations
  • Recharts β€” Data visualization for admin analytics
  • Zustand β€” Lightweight state management
  • Supabase JS Client β€” Database & auth SDK
  • Zod β€” Schema validation
  • Sonner β€” Toast notifications
  • Lucide React β€” Icon library
  • shadcn/ui primitives β€” Radix UI + Tailwind components

🌐 Deployment

This project is built for Cloudflare Workers edge runtime. It is optimized to run on the edge with minimal cold starts.

Deploy via your preferred platform that supports Vite + Cloudflare Workers (e.g., Lovable Cloud publishing).


πŸ“„ License

MIT β€” feel free to use, modify, and distribute.


Built with ❀️ using Lovable.

About

πŸ” A full-stack food ordering web app built with React and Supabase, featuring a customer-facing storefront and a full-featured admin dashboard. Customers can browse a categorized menu, manage a live shopping cart, place orders with delivery details, and track order history β€” all with Google OAuth and email authentication.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors