A comprehensive full-stack restaurant management platform built with React, TypeScript, Vite, Node.js, Express, Firebase, and Stripe integration. Features an intuitive ordering system, table booking management, and admin dashboard.
- π User authentication (Login/Register)
- π½οΈ Browse menu with categorized items
- π¨ View menu items with images, descriptions, and pricing
- π Shopping cart with quantity management
- π³ Stripe payment integration
- π¦ Order tracking and order history
- π« Table booking and reservations
- π² Real-time order status updates
- π§Ύ Digital receipts
- π Admin dashboard with analytics
- π² Menu management (add, edit, delete items)
- π·οΈ Category management
- π Order management and status updates
- ποΈ Booking management
- πΌοΈ Image upload for menu items
- β° Store open/close status control
- π Order and booking history
- π― Alphabetically sorted menu items
- π Real-time Firestore updates
- π Role-based access control
- π± Responsive design (Tailwind CSS)
- β Form validation (Yup + React Hook Form)
- π RESTful API
- π Firebase security rules
- πΎ Cloud storage integration
RoyalWings/
βββ client/ # React Frontend
β βββ src/
β β βββ components/ # Reusable React components (15 components)
β β β βββ AuthNavbar.tsx # Auth navigation bar
β β β βββ BookingForm.tsx # Booking reservation form
β β β βββ CartItem.tsx # Shopping cart item
β β β βββ CartPopup.tsx # Cart popup/sidebar
β β β βββ CategoryForm.tsx # Category management form
β β β βββ FlavorSelector.tsx # Item flavor selection modal
β β β βββ ImageUpload.tsx # Image upload handler
β β β βββ MenuCard.tsx # Individual menu item card
β β β βββ MenuCarousel.tsx # Featured items carousel
β β β βββ MenuGrid.tsx # Menu items grid with search/filter
β β β βββ MenuItemForm.tsx # Menu item creation/edit form
β β β βββ Navigation.tsx # Main navigation component
β β β βββ ProtectedRoute.tsx # Route authentication guard
β β β βββ Receipt.tsx # Order receipt display
β β β βββ StripeCheckout.tsx # Stripe payment form
β β βββ pages/ # Page components (12 pages)
β β β βββ AdminPage.tsx # Admin dashboard
β β β βββ AdminBookingsPage.tsx # Admin booking management
β β β βββ AdminOrdersPage.tsx # Admin order management
β β β βββ BookingPage.tsx # Customer booking page
β β β βββ CartPage.tsx # Shopping cart page
β β β βββ Login.tsx # Login page
β β β βββ MenuPage.tsx # Menu browsing page
β β β βββ OrderConfirmation.tsx # Order confirmation page
β β β βββ OrderHistory.tsx # Customer order history
β β β βββ OrderStatus.tsx # Real-time order status tracking
β β β βββ Register.tsx # User registration page
β β β βββ UserBookingsPage.tsx # Customer bookings page
β β βββ services/ # Firebase & API services
β β β βββ bookingService.ts # Booking CRUD operations
β β β βββ menuService.ts # Menu item management
β β β βββ orderService.ts # Order processing & tracking
β β β βββ stripeService.ts # Stripe payment processing
β β βββ contexts/ # React Context providers
β β β βββ AuthContext.tsx # Authentication state management
β β β βββ CartContext.tsx # Shopping cart state management
β β βββ types/ # TypeScript type definitions
β β β βββ booking.ts # Booking interfaces
β β β βββ cart.ts # Cart interfaces
β β β βββ index.ts # Common type exports
β β β βββ menu.ts # Menu item interfaces
β β β βββ order.ts # Order interfaces
β β βββ utils/ # Utility functions
β β β βββ formatters.ts # Price formatting utilities
β β βββ config/ # Configuration
β β β βββ firebase.ts # Firebase initialization
β β βββ App.tsx # Main app component with routing
β β βββ index.css # Global styles
β β βββ main.tsx # React entry point
β βββ public/ # Static assets
β βββ index.html # HTML template
β βββ package.json # Frontend dependencies
β βββ vite.config.ts # Vite configuration
β βββ tsconfig.json # TypeScript configuration
β βββ tailwind.config.js # Tailwind CSS configuration
β βββ postcss.config.js # PostCSS configuration
β βββ eslint.config.js # ESLint configuration
β
βββ server/ # Express Backend
β βββ src/
β β βββ index.js # Server entry point
β β βββ config/
β β β βββ firebase.js # Firebase Admin SDK configuration
β β β βββ serviceAccountKey.json # Firebase service account
β β βββ routes/
β β β βββ stripeRoutes.js # Stripe payment routes
β β β βββ uploadRoutes.js # File upload routes
β β βββ scripts/
β β βββ createAdmin.js # Admin user creation script
β βββ package.json # Backend dependencies
β βββ .env # Backend environment variables
β
βββ firebase/ # Firebase configuration
β βββ firestore.rules # Firestore security rules
β βββ storage.rules # Cloud Storage security rules
β
βββ firebase.json # Firebase project configuration
βββ firestore.indexes.json # Firestore index configuration
βββ README.md # Project documentation
- Node.js v14 or higher
- npm v6 or higher
- Firebase account with a project created
- Stripe account (for payment processing)
- Git for version control
-
Clone the repository
git clone <repository-url> cd RoyalWings
-
Setup Frontend
cd client npm install -
Setup Backend
cd server npm install
VITE_FIREBASE_API_KEY=your-api-key
VITE_FIREBASE_AUTH_DOMAIN=your-auth-domain
VITE_FIREBASE_PROJECT_ID=your-project-id
VITE_FIREBASE_STORAGE_BUCKET=your-storage-bucket
VITE_FIREBASE_MESSAGING_SENDER_ID=your-messaging-sender-id
VITE_FIREBASE_APP_ID=your-app-id
VITE_STRIPE_PUBLIC_KEY=your-stripe-public-key
VITE_API_URL=http://localhost:5000PORT=5000
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_PRIVATE_KEY=your-firebase-private-key
FIREBASE_CLIENT_EMAIL=your-firebase-client-email
STRIPE_SECRET_KEY=your-stripe-secret-key
STRIPE_WEBHOOK_SECRET=your-webhook-secret
NODE_ENV=developmentTerminal 1 - Frontend:
cd client
npm run devTerminal 2 - Backend:
cd server
npm run devThe application will be available at http://localhost:5173 (Vite default)
After setting up the project, you need to create an admin account to access the admin dashboard.
-
Navigate to the server scripts directory
cd server -
Run the admin creation script
node scripts/createAdmin.js admin@example.com password123
Parameters:
- First argument: Admin email address
- Second argument: Admin password
-
Example:
node scripts/createAdmin.js admin@royalwings.com SecurePassword123
-
Success Output
Successfully created admin user: Email: admin@royalwings.com User UID: [generated-uid] Role: admin
- The script uses your Firebase service account key (
serviceAccountKey.json) - Make sure the service account key is in
server/config/serviceAccountKey.json - Use a strong password for the admin account
- Store the admin credentials securely
- You can create multiple admin accounts by running the script multiple times with different emails
- Go to
http://localhost:5173/login - Enter your admin email and password
- You'll be redirected to the admin dashboard at
/admin
Once logged in as admin, you can:
- View all orders and update their status
- Manage menu items (add, edit, delete)
- Manage menu categories
- View and manage table bookings
- Control store open/close status
- View order and booking history
For production deployment:
# Set environment variables for production Firebase
export FIREBASE_PROJECT_ID=your-prod-project-id
export FIREBASE_PRIVATE_KEY=your-prod-private-key
export FIREBASE_CLIENT_EMAIL=your-prod-client-email
# Run the admin creation script
node scripts/createAdmin.js admin@yourdomain.com ProductionPassword123Frontend:
cd client
npm run build
npm run previewBackend:
cd server
npm run start- React 18.2.0 - UI library
- TypeScript - Type-safe JavaScript
- Vite - Lightning-fast build tool
- Tailwind CSS - Utility-first CSS framework
- Firebase 10.5.2 - Backend services (Auth, Firestore, Storage)
- Stripe - Payment processing
- React Router v6 - Client-side routing
- React Hook Form - Efficient form handling
- Yup - Schema validation
- React Hot Toast - Toast notifications
- ESLint - Code linting
- Express 5.1.0 - Web framework
- Firebase Admin SDK 13.5.0 - Server-side Firebase
- Stripe 20.0.0 - Payment API
- CORS - Cross-origin resource sharing
- Multer - File upload middleware
- Dotenv - Environment variable management
- Nodemon - Development auto-reload
- Firebase Authentication (Email/Password)
- Role-based access control (Admin/Customer)
- Protected routes for authenticated users only
- Firestore security rules for database access
- Cloud Storage security rules for file uploads
- Stripe webhook verification for payments
- Password Reset via Email - Secure password recovery using Firebase
RoyalWings includes a complete password recovery system using Firebase's built-in email authentication:
- Request Password Reset - User navigates to
/forgot-password - Enter Email - User enters their registered email address
- Firebase Sends Email - Firebase automatically sends a password reset link via Gmail
- Click Reset Link - User clicks the link in their email (valid for 1 hour)
- New Password Page - Reset link redirects to
/reset-password - Set New Password - User enters and confirms their new password
- Password Updated - Automatic redirect to login page
| Route | Purpose | Public |
|---|---|---|
/forgot-password |
Request password reset email | β Yes |
/reset-password?oobCode=... |
Reset password with verification code | β Yes |
/login |
Sign in (includes "Forgot password?" link) | β Yes |
- β Email validation before sending reset email
- β One-click password reset from email
- β Automatic code verification
- β Strong password requirements (8+ chars, uppercase, lowercase, number)
- β Password confirmation matching
- β 1-hour reset link expiration
- β User-friendly error messages
- β Toast notifications for all actions
- β Responsive design on all devices
To customize the password reset email template:
- Go to Firebase Console β Authentication β Templates
- Click on "Password reset" email template
- Customize:
- Email subject
- Email content
- Add your logo/branding
- Change button text and colors
- Save changes
Default Email Variables:
%LINK%- Password reset link%EMAIL%- User's email address%APP_NAME%- Application name (RoyalWings)
- Create a test account in the application
- Go to
/forgot-password - Enter your email
- Check your email inbox (may take a few seconds)
- Click the reset link
- Enter a new password meeting the requirements
- Confirm the password change
| Issue | Solution |
|---|---|
| Email not received | Check spam folder, verify email is correct |
| Reset link expired | Request a new reset link (links valid for 1 hour) |
| "User not found" | Verify email is registered with the system |
| "Invalid reset code" | Link may be expired, request new reset |
| Password too weak | Must include 8+ chars, uppercase, lowercase, number |
- users - User profiles and roles
- menuItems - Menu item catalog with images and pricing
- categories - Menu categories
- orders - Customer orders with items and status
- bookings - Table reservations
- storeStatus - Store open/close status
- Tailwind CSS for utility-first styling
- PostCSS for CSS processing
- Responsive design - Mobile, tablet, and desktop optimized
- Gradient colors - Modern gradient UI elements
- Animation - Smooth transitions and hover effects
| Tool | Purpose | Version |
|---|---|---|
| Vite | Build tool and dev server | 4.4.5 |
| TypeScript | Type-safe JavaScript | 5.0.2 |
| ESLint | Code quality and linting | 8.45.0 |
| Tailwind CSS | Utility-first CSS framework | 3.3.5 |
| PostCSS | CSS processing | 8.4.31 |
| React Hot Toast | Toast notifications | 2.6.0 |
| Tool | Purpose | Version |
|---|---|---|
| Express.js | Web framework | 5.1.0 |
| Nodemon | Auto-reload during development | 3.1.10 |
| Multer | File upload handling | 2.0.2 |
| Firebase Admin SDK | Server-side Firebase operations | 13.5.0 |
| CORS | Cross-origin resource sharing | 2.8.5 |
| Stripe | Payment processing | 20.0.0 |
| Service | Purpose | Integration |
|---|---|---|
| Firebase Authentication | User login & registration | Email/Password auth |
| Firestore | Cloud database | Real-time data sync |
| Cloud Storage | Image & file storage | Menu item images |
| Stripe | Payment processing | Card payments |
- Node.js - JavaScript runtime
- npm - Package manager
- Git - Version control
- VS Code (Recommended) - Code editor
/ β Login page
/register β User registration
/menu β Browse menu (sorted alphabetically)
/cart β Shopping cart
/checkout β Stripe payment checkout
/order-confirmation β Order confirmation
/order-status/:id β Track order in real-time
/order-history β View past orders
/booking β Make table reservations
/user-bookings β View user's bookings
/admin β Admin dashboard
/admin/orders β Manage orders
/admin/bookings β Manage bookings
npm run dev # Start Vite development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLintnpm run dev # Start with nodemon (hot reload)
npm run start # Start production server
npm run test # Run tests- Alphabetically sorted menu items
- Category filtering
- Search functionality
- Featured items carousel
- Item availability toggle
- Image upload support
- Flavor selection for customizable items
- Add items to cart with quantity management
- Real-time cart updates
- Stripe payment integration
- Order confirmation with receipt
- Order status tracking
- Order history view
- Pickup code generation
- Date and time selection
- Party size management
- Special requests field
- Booking confirmation
- Booking history
- Availability management
- Dashboard with key metrics
- Menu item CRUD operations
- Category management
- Order management with status updates
- Booking management
- Store status control
- Customer viewing
-
Firebase connection errors
- Verify all environment variables are set correctly
- Check Firebase project configuration
-
Stripe payment failures
- Ensure Stripe keys are correct
- Check webhook configuration in Stripe dashboard
-
Image upload issues
- Verify Cloud Storage security rules
- Check file size limits in Multer configuration
For issues, feature requests, or contributions, please email me at galapon.luismiguel.paterno@gmail.com