A campus food delivery application built with React, TypeScript, Clerk for authentication, and Supabase for backend services.
- React with TypeScript
- Tailwind CSS for styling
- Clerk for authentication
- ShadCN UI + Framer Motion for components and animations
- Supabase for database, real-time subscriptions
- Razorpay for payments
- User authentication with email/phone OTP
- Campus-restricted domains (@yourcollege.edu)
- Browse and order food from campus vendors
- Real-time order tracking
- Delivery partner system
- Admin dashboard for menu management
- Wallet system for delivery partners
- Node.js (v16+)
- npm or yarn
- Supabase account
- Clerk account
-
Clone this repository
git clone <repository-url> cd hungryaf-express-eats
-
Install dependencies
npm install # or yarn install -
Create a
.env.localfile based on the.env.local.examplecp .env.local.example .env.local
-
Update the environment variables in
.env.localwith your own keys -
Start the development server
npm run dev # or yarn dev
-
Create a new Supabase project
-
Run the following SQL migrations in the Supabase SQL Editor:
-- Enable UUID extension
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
-- users
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
clerk_user_id TEXT UNIQUE NOT NULL,
first_name TEXT NOT NULL,
last_name TEXT NOT NULL,
role TEXT CHECK (role IN ('eater','delivery','admin')) DEFAULT 'eater',
created_at TIMESTAMP DEFAULT NOW()
);
-- menu items
CREATE TABLE menu (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
name TEXT NOT NULL,
description TEXT,
price INT NOT NULL,
available BOOLEAN DEFAULT TRUE,
created_at TIMESTAMP DEFAULT NOW()
);
-- orders
CREATE TABLE orders (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
user_id UUID REFERENCES users(id),
items JSONB NOT NULL,
total_amount INT NOT NULL,
status TEXT CHECK (status IN ('placed','paid','delivered')) DEFAULT 'placed',
payment_status TEXT CHECK (payment_status IN ('pending','completed')) DEFAULT 'pending',
created_at TIMESTAMP DEFAULT NOW()
);
-- deliveries
CREATE TABLE deliveries (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
order_id UUID REFERENCES orders(id),
delivery_partner_id UUID REFERENCES users(id),
status TEXT CHECK (status IN ('pending','accepted','completed')) DEFAULT 'pending',
delivered_at TIMESTAMP,
created_at TIMESTAMP DEFAULT NOW()
);
-- wallets & earnings
CREATE TABLE wallets (
user_id UUID PRIMARY KEY REFERENCES users(id),
balance INT DEFAULT 0,
updated_at TIMESTAMP DEFAULT NOW()
);
CREATE TABLE delivery_earnings (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
delivery_partner_id UUID REFERENCES users(id),
order_id UUID REFERENCES orders(id),
earning INT NOT NULL,
created_at TIMESTAMP DEFAULT NOW()
);
-- Insert some sample menu items
INSERT INTO menu (name, description, price, available) VALUES
('Classic Burger', 'Juicy beef patty with lettuce, tomato, and special sauce', 29900, TRUE),
('Veggie Wrap', 'Fresh vegetables, hummus, and feta cheese in a warm tortilla', 19900, TRUE),
('Chicken Biryani', 'Aromatic rice dish with tender chicken pieces', 24900, TRUE),
('Masala Dosa', 'Crispy South Indian crepe filled with spiced potatoes', 14900, TRUE),
('Fries', 'Crispy golden fries with a dash of salt', 9900, TRUE),
('Cold Coffee', 'Refreshing cold coffee with ice cream', 12900, TRUE);-
Set up Clerk authentication
- Create a Clerk account at clerk.dev
- Add your domain to the allowed list
- Configure email/SMS providers
- Set email domain restrictions to @yourcollege.edu
-
Configure Supabase Auth policies
-
Deploy Edge Functions for API routes
The following API routes should be implemented as Supabase Edge Functions:
POST /api/checkout- Create Razorpay orderPOST /api/orders- Insert into orders tablePOST /api/deliveries- Assign deliveryPOST /api/deliveries/:id/complete- Complete delivery and update earnings
-
Build the application
npm run build # or yarn build -
Deploy to your preferred hosting platform (Vercel, Netlify, etc.)
This project is licensed under the MIT License - see the LICENSE file for details.