A comprehensive Next.js food delivery platform with three user roles: Customer, Admin, and Delivery Person. Built with Next.js 14, TypeScript, Tailwind CSS, and Supabase.
- Browse menu with categories and filtering
- Add items to cart with quantity selection
- Place orders with special instructions
- Track order status (Preparing, Out for Delivery, Delivered)
- View order history
- Responsive design for mobile and desktop
- Manage menu items (add, edit, delete, toggle availability)
- Upload dish photos
- Track orders in real-time
- Update order status from Preparing to Out for Delivery
- View detailed order information
- Manage restaurant settings
- View orders assigned for delivery
- Track order status (Out for Delivery, Delivered)
- Mark orders as delivered
- View customer information and order details
- Real-time order updates
- Frontend: Next.js 14, TypeScript, Tailwind CSS
- Backend: Supabase (PostgreSQL, Auth, Real-time)
- UI Components: Heroicons, Headless UI
- State Management: React Context API
- Notifications: React Hot Toast
cd /Users/noct.kun/Documents/igibfun/fooddelivery/website
npm install- Run the setup script to create the environment file:
npm run setup- Create a new project at supabase.com
- Go to Settings > API to get your project URL and anon key
- Update the
.env.localfile with your actual Supabase credentials:
NEXT_PUBLIC_SUPABASE_URL=your_actual_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_actual_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_actual_service_role_key- Go to your Supabase project dashboard
- Navigate to SQL Editor
- Copy and paste the contents of
database-schema.sql - Run the SQL script to create all tables, functions, and policies
npm run devOpen http://localhost:3000 in your browser.
The application uses the following main tables:
- profiles: User profiles with roles (customer, admin, delivery)
- restaurants: Restaurant information and settings
- categories: Menu categories
- menu_items: Individual menu items with pricing and availability
- orders: Order information with token numbers
- order_items: Individual items within orders
- delivery_times: Configurable delivery time slots
- Can browse menu and place orders
- Access:
/menu,/orders
- Can manage menu and track orders
- Access:
/admin,/admin/menu,/admin/orders
- Can view and update delivery orders
- Access:
/delivery
- Daily token number generation (resets at midnight)
- Real-time order status updates
- Automatic order cleanup after delivery
- Category-based organization
- Image upload support
- Availability toggling
- Price management
- Role-based access control
- Secure authentication with Supabase Auth
- Protected routes with middleware
- Automatic sign-in after registration (email confirmation disabled)
- Update restaurant name and logo in the database
- Modify colors in Tailwind CSS classes
- Customize the homepage content
- Add/remove categories
- Upload dish photos
- Set pricing and availability
- Configure delivery time slots
- Set delivery time estimates
- Manage restaurant hours
- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy
- Ensure environment variables are set
- Build command:
npm run build - Start command:
npm start
- Authentication not working: Check Supabase URL and keys
- Database errors: Ensure all tables are created from the SQL schema
- Image upload issues: Verify image URLs are accessible
- Order status not updating: Check RLS policies in Supabase
- Use Supabase dashboard to monitor database changes
- Check browser console for client-side errors
- Use Supabase logs for server-side debugging
- Test with different user roles
For issues or questions:
- Check the Supabase documentation
- Review the Next.js documentation
- Check the browser console for errors
- Verify environment variables are correct
This project is created for commercial use by restaurants. Customize as needed for your business requirements.