A modern restaurant management system built with Python FastAPI and React. A comprehensive restaurant management system built with FastAPI (backend) and React (frontend), featuring QR code-based table ordering, phone OTP authentication, real-time order management, and multi-database support for independent hotel operations.
- Phone OTP Authentication: Secure Firebase-based authentication
- Real-time Cart Management: Live cart updates with special offers
- Today's Specials: Dynamic special dish recommendations
- Payment Processing: Integrated payment with loyalty discounts
- Order History: Track past orders and preferences
- Real-time Order Management: Live order notifications and updates
- Kitchen Operations: Streamlined order acceptance and completion
- Order Status Updates: Instant status changes reflected across all interfaces
- Complete Restaurant Management: Full control over restaurant operations
- Dish Management: Add, edit, and manage menu items with images
- Offers & Specials: Create and manage promotional offers
- Table Management: Monitor table occupancy and status
- Order Tracking: Complete order lifecycle management
- Loyalty Program: Configurable visit-based discount system
- Selection Offers: Amount-based discount configuration
- Settings: Hotel information and configuration management
- Customer Analysis: Detailed customer behavior insights
- Dish Performance: Menu item popularity and sales metrics
- Chef Performance: Kitchen efficiency tracking
- Sales & Revenue: Comprehensive financial reporting
- Independent Hotel Operations: Each hotel operates with its own database
- Database Authentication: Secure database access with password protection
- Session-based Management: Consistent database context across all interfaces
- Data Isolation: Complete separation of hotel data for security and privacy
tabble/
βββ app/ # Backend FastAPI application
β βββ database.py # Database configuration and models
β βββ main.py # FastAPI application entry point
β βββ middleware/ # Custom middleware (CORS, session handling)
β βββ models/ # SQLAlchemy database models
β βββ routers/ # API route definitions
β β βββ admin.py # Admin panel endpoints
β β βββ chef.py # Chef dashboard endpoints
β β βββ customer.py # Customer interface endpoints
β β βββ analytics.py # Analytics and reporting endpoints
β βββ services/ # Business logic and external services
β β βββ firebase_service.py # Firebase authentication
β β βββ database_service.py # Database operations
β βββ static/ # Static file serving
β β βββ images/ # Dish and hotel logo images
β β βββ dishes/ # Organized by database name
β βββ utils/ # Utility functions and helpers
βββ frontend/ # React frontend application
β βββ src/
β β βββ components/ # Reusable React components
β β β βββ Layout.js # Main layout wrapper
β β β βββ AdminLayout.js # Admin panel layout
β β β βββ ChefLayout.js # Chef dashboard layout
β β βββ pages/ # Page components
β β β βββ admin/ # Admin interface pages
β β β βββ chef/ # Chef dashboard pages
β β β βββ customer/ # Customer interface pages
β β β βββ analysis/ # Analytics dashboard
β β βββ services/ # API communication services
β β β βββ api.js # Axios configuration and API calls
β β βββ App.js # Main React application
β β βββ index.js # React DOM entry point
β β βββ global.css # Global styling
β βββ public/ # Static assets
β β βββ index.html # HTML template
β β βββ favicon.ico # Application icon
β βββ package.json # Node.js dependencies
β βββ .env.example # Environment variables template
β βββ .env # Environment configuration
βββ templates/ # Report generation templates
β βββ analysis/ # Analytics report templates
βββ hotels.csv # Database registry and passwords
βββ init_db.py # Database initialization with sample data
βββ create_empty_db.py # Empty database creation utility
βββ requirements.txt # Python dependencies
βββ run.py # Backend server launcher
βββ README.md # Project documentation
- Python 3.8+: Download from python.org
- Node.js 16+: Download from nodejs.org
- Git: Download from git-scm.com
- Python 3.8+: Install via Homebrew:
brew install python3 - Node.js 16+: Install via Homebrew:
brew install node - Git: Install via Homebrew:
brew install git
git clone <repository-url>
cd tabble# Create virtual environment
python -m venv venv
# Activate virtual environment
venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt# Create virtual environment
python3 -m venv venv
# Activate virtual environment
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt# Navigate to frontend directory
cd frontend
# Copy environment template
cp .env.example .env
# Install Node.js dependencies
npm installSECRET_KEY=your_secret_key_here# Backend API Configuration
REACT_APP_API_BASE_URL=http://localhost:8000
# Development settings
NODE_ENV=development
# Firebase Configuration (optional)
# REACT_APP_FIREBASE_API_KEY=your_firebase_api_key
# REACT_APP_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
# REACT_APP_FIREBASE_PROJECT_ID=your_project_idTabble supports multiple independent hotel databases, allowing each hotel to operate with complete data isolation. Each database contains:
- Dishes: Menu items with pricing, categories, and images
- Orders: Customer orders and order items
- Persons: Customer information and visit history
- Tables: Table management and occupancy status
- Loyalty Program: Visit-based discount tiers
- Selection Offers: Amount-based promotional offers
- Settings: Hotel-specific configuration
- Feedback: Customer reviews and ratings
The hotels.csv file serves as the central registry for all hotel databases:
hotel_database,password
tabble_new.db,myhotel# Activate virtual environment
venv\Scripts\activate
# Run the database creation script
python create_empty_db.py# Activate virtual environment
source venv/bin/activate
# Run the database creation script
python create_empty_db.pyInteractive Process:
- The script will prompt you for a database name
- Enter the hotel name (without .db extension)
- The script creates an empty database with proper schema
- Manually add the database entry to
hotels.csv
Example:
Creating a new empty database with the proper schema
Enter name for the new database (without .db extension): newhotel
Success! Created empty database 'newhotel.db' with the proper schema
Then add to hotels.csv:
newhotel.db,newhotel123# Create database with sample data
python init_db.py# Create database with sample data
python init_db.pyNote: This creates tabble_new.db with sample dishes, users, and configuration.
The create_empty_db.py script creates the following tables:
- dishes: Menu items with pricing, categories, offers, and visibility
- persons: Customer profiles with visit tracking
- orders: Order management with status tracking
- order_items: Individual items within orders
- tables: Table management and occupancy status
- loyalty_program: Visit-based discount configuration
- selection_offers: Amount-based promotional offers
- settings: Hotel information and branding
- feedback: Customer reviews and ratings
# Activate virtual environment
venv\Scripts\activate
# Start the FastAPI server
python run.py# Activate virtual environment
source venv/bin/activate
# Start the FastAPI server
python run.pyThe backend will be available at http://localhost:8000
# Navigate to frontend directory
cd frontend
# Start React development server
npm startThe frontend will be available at http://localhost:3000
Once the backend is running, access the interactive API documentation:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
- QR Code Generation: Automatic QR code creation for each table
- Real-time Status Monitoring: Live table occupancy tracking
- Session-based Occupancy: Table status changes based on customer interaction
- Multi-database Support: Table management per hotel database
- Real-time Order Tracking: Live order status updates across all interfaces
- Kitchen Notifications: Instant order notifications to chef dashboard
- Status Synchronization: Order status changes reflect immediately
- Payment Integration: Secure payment processing with loyalty discounts
- Custom Report Templates: Configurable analytics reports
- PDF Generation: Automated report exports
- Performance Metrics: Comprehensive business intelligence
- Multi-dimensional Analysis: Customer, dish, and chef performance tracking
- Firebase Phone OTP: Secure customer authentication
- Database Password Protection: Hotel database access control
- Session Management: Secure session handling across interfaces
- Data Isolation: Complete separation of hotel data
# If you get "Module not found" errors
pip install -r requirements.txt
# If database connection fails
python create_empty_db.py
# If port 8000 is already in use
# Edit run.py and change the port number# If npm install fails
npm cache clean --force
npm install
# If environment variables aren't loading
# Check that .env file exists in frontend directory
cp .env.example .env
# If API calls fail
# Verify REACT_APP_API_BASE_URL in frontend/.env# If database schema is outdated
python init_db.py --force-reset
# If hotels.csv is missing entries
# Manually add your database to hotels.csv- Use
venv\Scripts\activateto activate virtual environment - Use
pythoncommand (notpython3) - Ensure Python is added to PATH during installation
- Use
source venv/bin/activateto activate virtual environment - Use
python3command for Python 3.x - Install Xcode Command Line Tools if needed:
xcode-select --install
- Create Empty Database:
python create_empty_db.py
2. **Add to Registry:**
Edit `hotels.csv` and add your database entry:
```csv
yourhotel.db,yourpassword123
-
Configure Hotel Settings:
- Access admin panel:
http://localhost:3000/admin - Navigate to Settings
- Configure hotel information
- Access admin panel:
-
Add Menu Items:
- Use admin panel to add dishes
- Upload dish images to
app/static/images/dishes/yourhotel/
# Backend
SECRET_KEY=your_production_secret_key
DATABASE_URL=your_production_database_url
# Frontend
REACT_APP_API_BASE_URL=https://your-domain.com/api
NODE_ENV=production- Images are stored in
app/static/images/dishes/{database_name}/ - Ensure proper directory permissions for image uploads
- Consider using cloud storage for production deployments
A comprehensive restaurant management system built with FastAPI (backend) and React (frontend), featuring QR code-based table ordering, phone OTP authentication, real-time order management, and multi-database support for independent hotel operations.
- Phone OTP Authentication: Secure Firebase-based authentication
- Real-time Cart Management: Live cart updates with special offers
- Today's Specials: Dynamic special dish recommendations
- Payment Processing: Integrated payment with loyalty discounts
- Order History: Track past orders and preferences
- Real-time Order Management: Live order notifications and updates
- Kitchen Operations: Streamlined order acceptance and completion
- Order Status Updates: Instant status changes reflected across all interfaces
- Complete Restaurant Management: Full control over restaurant operations
- Dish Management: Add, edit, and manage menu items with images
- Offers & Specials: Create and manage promotional offers
- Table Management: Monitor table occupancy and status
- Order Tracking: Complete order lifecycle management
- Loyalty Program: Configurable visit-based discount system
- Selection Offers: Amount-based discount configuration
- Settings: Hotel information and configuration management
- Customer Analysis: Detailed customer behavior insights
- Dish Performance: Menu item popularity and sales metrics
- Chef Performance: Kitchen efficiency tracking
- Sales & Revenue: Comprehensive financial reporting
- Independent Hotel Operations: Each hotel operates with its own database
- Database Authentication: Secure database access with password protection
- Session-based Management: Consistent database context across all interfaces
- Data Isolation: Complete separation of hotel data for security and privacy
tabble/
βββ app/ # Backend FastAPI application
β βββ database.py # Database configuration and models
β βββ main.py # FastAPI application entry point
β βββ middleware/ # Custom middleware (CORS, session handling)
β βββ models/ # SQLAlchemy database models
β βββ routers/ # API route definitions
β β βββ admin.py # Admin panel endpoints
β β βββ chef.py # Chef dashboard endpoints
β β βββ customer.py # Customer interface endpoints
β β βββ analytics.py # Analytics and reporting endpoints
β βββ services/ # Business logic and external services
β β βββ firebase_service.py # Firebase authentication
β β βββ database_service.py # Database operations
β βββ static/ # Static file serving
β β βββ images/ # Dish and hotel logo images
β β βββ dishes/ # Organized by database name
β βββ utils/ # Utility functions and helpers
βββ frontend/ # React frontend application
β βββ src/
β β βββ components/ # Reusable React components
β β β βββ Layout.js # Main layout wrapper
β β β βββ AdminLayout.js # Admin panel layout
β β β βββ ChefLayout.js # Chef dashboard layout
β β βββ pages/ # Page components
β β β βββ admin/ # Admin interface pages
β β β βββ chef/ # Chef dashboard pages
β β β βββ customer/ # Customer interface pages
β β β βββ analysis/ # Analytics dashboard
β β βββ services/ # API communication services
β β β βββ api.js # Axios configuration and API calls
β β βββ App.js # Main React application
β β βββ index.js # React DOM entry point
β β βββ global.css # Global styling
β βββ public/ # Static assets
β β βββ index.html # HTML template
β β βββ favicon.ico # Application icon
β βββ package.json # Node.js dependencies
β βββ .env.example # Environment variables template
β βββ .env # Environment configuration
βββ templates/ # Report generation templates
β βββ analysis/ # Analytics report templates
βββ hotels.csv # Database registry and passwords
βββ init_db.py # Database initialization with sample data
βββ create_empty_db.py # Empty database creation utility
βββ requirements.txt # Python dependencies
βββ run.py # Backend server launcher
βββ README.md # Project documentation
- Python 3.8+: Download from python.org
- Node.js 16+: Download from nodejs.org
- Git: Download from git-scm.com
- Python 3.8+: Install via Homebrew:
brew install python3 - Node.js 16+: Install via Homebrew:
brew install node - Git: Install via Homebrew:
brew install git
git clone <repository-url>
cd tabble# Create virtual environment
python -m venv venv
# Activate virtual environment
venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt# Create virtual environment
python3 -m venv venv
# Activate virtual environment
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt# Navigate to frontend directory
cd frontend
# Copy environment template
cp .env.example .env
# Install Node.js dependencies
npm installSECRET_KEY=your_secret_key_here# Backend API Configuration
REACT_APP_API_BASE_URL=http://localhost:8000
# Development settings
NODE_ENV=development
# Firebase Configuration (optional)
# REACT_APP_FIREBASE_API_KEY=your_firebase_api_key
# REACT_APP_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
# REACT_APP_FIREBASE_PROJECT_ID=your_project_idTabble supports multiple independent hotel databases, allowing each hotel to operate with complete data isolation. Each database contains:
- Dishes: Menu items with pricing, categories, and images
- Orders: Customer orders and order items
- Persons: Customer information and visit history
- Tables: Table management and occupancy status
- Loyalty Program: Visit-based discount tiers
- Selection Offers: Amount-based promotional offers
- Settings: Hotel-specific configuration
- Feedback: Customer reviews and ratings
The hotels.csv file serves as the central registry for all hotel databases:
hotel_database,password
tabble_new.db,myhotel
# Activate virtual environment
venv\Scripts\activate
# Run the database creation script
python create_empty_db.py# Activate virtual environment
source venv/bin/activate
# Run the database creation script
python create_empty_db.pyInteractive Process:
- The script will prompt you for a database name
- Enter the hotel name (without .db extension)
- The script creates an empty database with proper schema
- Manually add the database entry to
hotels.csv
Example:
Creating a new empty database with the proper schema
Enter name for the new database (without .db extension): newhotel
Success! Created empty database 'newhotel.db' with the proper schema
Then add to hotels.csv:
newhotel.db,newhotel123# Create database with sample data
python init_db.py# Create database with sample data
python init_db.pyNote: This creates tabble_new.db with sample dishes, users, and configuration.
The create_empty_db.py script creates the following tables:
- dishes: Menu items with pricing, categories, offers, and visibility
- persons: Customer profiles with visit tracking
- orders: Order management with status tracking
- order_items: Individual items within orders
- tables: Table management and occupancy status
- loyalty_program: Visit-based discount configuration
- selection_offers: Amount-based promotional offers
- settings: Hotel information and branding
- feedback: Customer reviews and ratings
# Activate virtual environment
venv\Scripts\activate
# Start the FastAPI server
python run.py# Activate virtual environment
source venv/bin/activate
# Start the FastAPI server
python run.pyThe backend will be available at http://localhost:8000
# Navigate to frontend directory
cd frontend
# Start React development server
npm startThe frontend will be available at http://localhost:3000
Once the backend is running, access the interactive API documentation:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
- QR Code Generation: Automatic QR code creation for each table
- Real-time Status Monitoring: Live table occupancy tracking
- Session-based Occupancy: Table status changes based on customer interaction
- Multi-database Support: Table management per hotel database
- Real-time Order Tracking: Live order status updates across all interfaces
- Kitchen Notifications: Instant order notifications to chef dashboard
- Status Synchronization: Order status changes reflect immediately
- Payment Integration: Secure payment processing with loyalty discounts
- Custom Report Templates: Configurable analytics reports
- PDF Generation: Automated report exports
- Performance Metrics: Comprehensive business intelligence
- Multi-dimensional Analysis: Customer, dish, and chef performance tracking
- Firebase Phone OTP: Secure customer authentication
- Database Password Protection: Hotel database access control
- Session Management: Secure session handling across interfaces
- Data Isolation: Complete separation of hotel data
# If you get "Module not found" errors
pip install -r requirements.txt
# If database connection fails
python create_empty_db.py
# If port 8000 is already in use
# Edit run.py and change the port number# If npm install fails
npm cache clean --force
npm install
# If environment variables aren't loading
# Check that .env file exists in frontend directory
cp .env.example .env
# If API calls fail
# Verify REACT_APP_API_BASE_URL in frontend/.env# If database schema is outdated
python init_db.py --force-reset
# If hotels.csv is missing entries
# Manually add your database to hotels.csv- Use
venv\Scripts\activateto activate virtual environment - Use
pythoncommand (notpython3) - Ensure Python is added to PATH during installation
- Use
source venv/bin/activateto activate virtual environment - Use
python3command for Python 3.x - Install Xcode Command Line Tools if needed:
xcode-select --install
-
Create Empty Database:
python create_empty_db.py
-
Add to Registry: Edit
hotels.csvand add your database entry:yourhotel.db,yourpassword123
-
Configure Hotel Settings:
- Access admin panel:
http://localhost:3000/admin - Navigate to Settings
- Configure hotel information
- Access admin panel:
-
Add Menu Items:
- Use admin panel to add dishes
- Upload dish images to
app/static/images/dishes/yourhotel/
# Backend
SECRET_KEY=your_production_secret_key
DATABASE_URL=your_production_database_url
# Frontend
REACT_APP_API_BASE_URL=https://your-domain.com/api
NODE_ENV=production- Images are stored in
app/static/images/dishes/{database_name}/ - Ensure proper directory permissions for image uploads
- Consider using cloud storage for production deployments