A modern, serverless meal booking system for office cafeterias. Built with React, PatternFly, and Supabase.
- π Book meals one day in advance
- π₯ Choose between Veg and Non-Veg options
- π³ Pay via UPI QR code and upload payment proof
- π± View booking history and receipt numbers
- β Cancel pending bookings
- β Review and approve/reject meal bookings
- π View daily summaries and statistics
- π₯ Manage user roles (Employee, Admin, Vendor)
- π Real-time booking updates
- π View today's approved bookings with meal counts
- π¨οΈ Print organized lists for meal preparation
- π Check upcoming bookings for planning
- β Mark meals as served
- Frontend: React 18.3.1
- UI Framework: PatternFly 6.x (Enterprise-grade components)
- Backend: Supabase (PostgreSQL + Auth + Storage)
- Deployment: Vercel (recommended) / Netlify / GitHub Pages
- Build Tool: Vite
- State Management: React Context API
- Node.js 18 or higher
- npm or yarn package manager
- A Supabase account (free tier available)
- A Vercel account (for deployment, optional)
git clone <your-repo-url>
cd meal-booking-system
npm install- Create a new project on Supabase
- Go to SQL Editor and run the schema from
supabase-schema.sql - Create a storage bucket named
bookings(private) - Get your project URL and anon key from Settings > API
Copy .env.example to .env and fill in your values:
cp .env.example .envEdit .env:
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-key
VITE_APP_NAME=Meal Booking System
VITE_COMPANY_DOMAIN=yourcompany.comnpm run devVisit http://localhost:5173
Vercel offers the best experience with zero configuration for client-side routing.
git init
git add .
git commit -m "Initial commit: Meal booking system"
git branch -M main
git remote add origin https://github.com/yourusername/meal-booking-system.git
git push -u origin main- Go to vercel.com and sign in with GitHub
- Click "Add New..." β "Project"
- Import your
meal-booking-systemrepository - Vercel will auto-detect it's a Vite project β
In Vercel project settings (Settings > Environment Variables), add:
VITE_SUPABASE_URL: Your Supabase project URLVITE_SUPABASE_ANON_KEY: Your Supabase anon keyVITE_COMPANY_DOMAIN: Your company email domain
Click Deploy! π
Your app will be available at: https://meal-booking-system.vercel.app
Benefits:
- β Automatic deployments on every push to main
- β Preview deployments for pull requests
- β Perfect client-side routing support (no 404 issues)
- β Built-in CDN and SSL
- β Zero configuration needed
You'll need to add back GitHub Pages specific configuration:
- Add
base: '/meal-booking-system/'tovite.config.js - Add
basename="/meal-booking-system"to Router insrc/App.jsx - Create
public/404.htmlfor client-side routing support
Go to your GitHub repository: Settings > Secrets and variables > Actions
Add the following secrets:
VITE_SUPABASE_URL: Your Supabase project URLVITE_SUPABASE_ANON_KEY: Your Supabase anon keyVITE_COMPANY_DOMAIN: Your company email domain
Create .github/workflows/deploy.yml (or check DEPLOYMENT.md for details)
- Go to Settings > Pages
- Source: GitHub Actions
- Your app will be available at:
https://yourusername.github.io/meal-booking-system
- Push your code to GitHub
- Go to netlify.com
- Import your GitHub repository
- Build command:
npm run build - Publish directory:
dist - Add environment variables in Netlify dashboard
- Deploy! β¨
Netlify will automatically deploy on every push to main.
-
employees
- User profiles with roles (employee, admin, vendor)
- Links to Supabase Auth
-
bookings
- Meal bookings with payment info
- Receipt numbers and status tracking
-
settings
- Application configuration (future use)
All tables have RLS policies to ensure:
- Users can only view/edit their own data
- Admins have full access
- Vendors can view bookings but not user details
- User signs up with company email
- Email verification (optional)
- Auto-create employee profile with "employee" role
- Admin can upgrade roles via User Management
After signing up your first user, manually update their role in Supabase:
UPDATE employees
SET role = 'admin'
WHERE email = 'your-admin@company.com';- Book meals
- View own bookings
- Cancel pending bookings
- All employee permissions
- Approve/reject bookings
- View statistics
- Manage user roles
- View approved bookings
- Print meal lists
- Mark meals as served
Edit the logo in:
src/pages/LoginPage.jsx(line withbrandImgSrc)
Update the QR code image URL in:
src/components/booking/BookingForm.jsx
Edit validation in:
src/components/booking/BookingForm.jsx- Booking deadline, weekend restrictions, etc.
-
"Missing Supabase environment variables"
- Ensure
.envfile exists with correct values - Restart dev server after changing
.env
- Ensure
-
Authentication not working
- Check Supabase Auth is enabled
- Verify email domain restrictions if set
-
Storage upload fails
- Ensure
bookingsstorage bucket exists - Check storage policies are applied
- Ensure
-
GitLab Pages shows blank page
- Check GitLab CI/CD variables are set
- Verify
base: './'invite.config.js
meal-booking-system/
βββ src/
β βββ components/
β β βββ auth/ # Authentication components
β β βββ booking/ # Employee booking components
β β βββ admin/ # Admin dashboard components
β β βββ vendor/ # Vendor dashboard components
β β βββ common/ # Shared components
β βββ contexts/ # React contexts (Auth)
β βββ pages/ # Main page components
β βββ services/ # Supabase client & API
β βββ utils/ # Helper functions
βββ public/ # Static assets
βββ supabase-schema.sql # Database schema
βββ .gitlab-ci.yml # CI/CD configuration
βββ vite.config.js # Build configuration
This is an open-source project. Contributions are welcome!
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
Arpan Roy
- GitHub: @arpanroy41
MIT License - feel free to use this project for your organization.
Copyright (c) 2025 Arpan Roy
- Built with PatternFly - Enterprise-grade UI components
- Powered by Supabase - Open source Firebase alternative
- Icons from PatternFly Icons
For issues and questions:
- Check the troubleshooting section above
- Review Supabase documentation
- Check PatternFly documentation
- Open an issue on GitHub
NEVER commit your .env file to version control!
The .env file is already in .gitignore. Always use:
- Environment variables for local development
- Vercel Environment Variables for Vercel deployment
- GitHub Secrets for GitHub Actions CI/CD
- Netlify Environment Variables for Netlify
To update dependencies:
npm update
npm audit fixTo upgrade PatternFly:
npm install @patternfly/react-core@latestBuilt with β€οΈ by Arpan Roy for better workplace meal management
Star β this repo if you find it helpful!