A complete full-stack restaurant ordering system with QR code table identification, AI-driven chat recommendations, Google authentication, real-time cart management, order history, and secure payment processing via Midtrans.
- π± Mobile-First Design - Optimized for 390px mobile screens with dark theme
- π QR Code Scanning - Table identification with camera integration
- π Google OAuth Authentication - Secure login with JWT token protection
- π€ AI Chat Assistant - OpenAI GPT-4o powered food recommendations with Indonesian language support
- π Dynamic Shopping Cart - Real-time cart with persistent state across navigation
- π³ Secure Payments - Full Midtrans integration with webhook notifications and redirect handling
- π Order Management - Complete order history with edit/delete capabilities for pending orders
- π― Smart Session Management - 30-minute table sessions with QR code validation
- π Custom Notifications - Beautiful modal popups instead of browser alerts
- π Real-time Updates - Auto-refresh order status and payment notifications
- React 18 with Vite for fast development
- React Router for seamless navigation
- Bootstrap 5 for responsive mobile-first UI
- Custom Components for modals and notifications
- Camera API for QR code scanning
- Node.js with Express framework
- PostgreSQL with Sequelize ORM
- JWT Authentication with Google OAuth 2.0
- OpenAI GPT-4o API integration
- Midtrans Payment Gateway with webhook support
- Ngrok for public webhook endpoints
- Midtrans Snap for secure payment processing
- Google OAuth 2.0 for user authentication
- OpenAI API for intelligent recommendations
- Webhook Notifications for real-time payment updates
Scan QR Code β Validate Table β Create Session β Login with Google
Choice Page β AI Chat Assistant OR Browse Menu β Order History Access
Chat Interface β AI Recommendations β Add to Cart β Smart Filtering
Menu Categories β Product Details β Add to Cart β Quantity Management
Review Items β Modify Quantities β Proceed to Payment β Order Creation
Midtrans Snap β Multiple Payment Methods β Webhook Notifications β Status Updates
Order History β Pay Pending Orders β Edit Orders β Delete Orders
- Node.js (v18+ recommended)
- PostgreSQL database
- Ngrok for webhook tunneling
git clone <repository-url>
cd IP-HCK86-clonecd backend
npm install
cp .env.example .env
# Configure environment variables
npm startcd frontend
npm install
npm run dev# Create PostgreSQL database
# Configure connection in backend/.env
# Run migrations and seedersngrok http 3001
# Update BACKEND_URL in .env with ngrok URL# Database
DB_HOST=localhost
DB_PORT=5432
DB_NAME=restaurant_ordering
DB_USER=postgres
DB_PASS=yourpassword
# Authentication
JWT_SECRET=your_jwt_secret
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_CALLBACK_URL=http://localhost:3001/auth/google/callback
# Payment
MIDTRANS_SERVER_KEY=your_midtrans_server_key
MIDTRANS_CLIENT_KEY=your_midtrans_client_key
# AI
OPENAI_API_KEY=your_openai_api_key
# URLs
BACKEND_URL=https://your-ngrok-url.ngrok-free.app
FRONTEND_URL=http://localhost:5173
PORT=3001GET /auth/google- Initiate Google OAuth flowGET /auth/google/callback- Handle OAuth callback
GET /menu-items- Get all menu items with images
POST /sessions- Create session with QR code (Public)
GET /orders- Get orders by session/tablePOST /orders- Create new orderPUT /orders/:id- Update order (pending only)DELETE /orders/:id- Delete order (pending only)
POST /payments- Create Midtrans payment token (Protected)POST /payments/notification- Midtrans webhook (Public)GET /payment/finish- Payment success redirect (Public)GET /payment/unfinish- Payment cancelled redirect (Public)GET /payment/error- Payment error redirect (Public)
POST /ai/chat- Get AI food recommendationsRequest: { "messages": [{"role": "user", "content": "Saya ingin makan pedas"}] } Response: { "reply": [ { "name": "Ayam Geprek", "description": "Ayam crispy dengan sambal pedas", "price": "25000", "imageUrl": "..." } ] }
- LandingPage - Welcome screen with QR scanner
- SessionPage - Manual table code entry
- QRSessionPage - QR validation and session creation
- LoginPage - Google OAuth integration
- ChoicePage - AI Chat vs Menu selection
- MenuPage - Product catalog with categories
- ChatPage - AI assistant interface
- CartPage - Shopping cart with edit mode
- PaymentPage - Midtrans integration
- OrderHistoryPage - Order management
- PaymentSuccessPage - Payment confirmation
- PaymentFinishPage - Midtrans success redirect
- PaymentUnfinishPage - Payment cancellation
- PaymentErrorPage - Payment failure handling
- CustomModal - Beautiful notification popups
- QRScanner - Camera-based QR code reader
- Cart Management - Dynamic cart with persistence
- Persistent cart across navigation
- Real-time quantity updates
- Edit mode for existing orders
- Visual cart icon with item count
- Indonesian language support
- Context-aware recommendations
- Keyword filtering for menu items
- Anti-duplication logic
- Prompt engineering for restaurant context
- Multiple payment methods via Midtrans
- Real-time webhook notifications
- Order status auto-updates
- Payment retry for pending orders
- Redirect handling for all scenarios
- Order history with auto-refresh
- Edit pending orders
- Delete pending orders
- Pay pending orders
- Status tracking (pending β paid β failed)
cd backend
npm test- Comprehensive API endpoint testing
- JWT authentication testing
- Database integration testing
- Payment webhook testing
cd frontend
npm test- Component unit testing
- Integration testing
- User flow testing
# Run deployment script
./deploy.shFor detailed deployment instructions, see DEPLOYMENT.md
- Railway (Recommended - Free tier available)
- Render (Alternative - Free tier available)
- Heroku (Paid)
- VPS/DigitalOcean (Manual setup)
- Database: Use production PostgreSQL
- Environment: Set production environment variables
- Webhooks: Configure Midtrans with production URLs
- SSL: Enable HTTPS for secure payments
- Domain: Use custom domain instead of ngrok
- JWT token authentication
- Protected API endpoints
- Secure payment processing
- Input validation and sanitization
- Environment variable protection
- Complete QR scanning system
- Google OAuth authentication
- AI chat with OpenAI integration
- Dynamic shopping cart
- Full payment integration with Midtrans
- Order history and management
- Edit/delete pending orders
- Pay pending orders
- Custom modal notifications
- Mobile-first responsive design
- Real-time order updates
- Webhook notification handling
- Payment redirect flows
- Session management with expiry
- 100% Mobile Optimized - Perfect for restaurant tablet/phone use
- Production Ready - Full webhook integration and error handling
- User Friendly - Intuitive flow from QR scan to payment
- AI Powered - Smart recommendations in Indonesian
- Secure - JWT protection and secure payment processing
For issues, feature requests, or contributions, please create an issue in the repository.
MIT License