Overview
TableFlow is a full-stack restaurant management platform built on Laravel 12 and PHP 8.2. It covers everything from the kitchen pass to the customer's table, with an optional AI layer powered by the Anthropic Claude API, and a versioned REST API ready for a companion Flutter mobile app.
Three interfaces ship in one codebase:
- Admin & Staff Panel — the full back-of-house dashboard (Blade + Bootstrap 5)
- Guest QR Ordering Page — a mobile-friendly public menu with an AI chat widget, linked from each table's printed QR code
- REST API (
/api/v1) — Sanctum-authenticated endpoints for the future Flutter app
Feature List
| Module | What it covers |
|---|---|
| Menu & Catalog | Categories, items, size variants, add-ons, availability toggles |
| Orders | Dine-in, takeaway, delivery — full pending → completed lifecycle |
| Kitchen Display | Live kanban board grouped by order status |
| Tables & QR | Table management with auto-generated QR ordering links |
| Reservations | Guest bookings with table assignment and status flow |
| Customers | Profiles, loyalty points, total spend, visit history |
| Inventory | Stock items, in/out movements, reorder alerts |
| Staff | Role-based accounts, attendance check-in/out |
| Coupons | Fixed or percentage discounts with usage limits and expiry |
| Reviews | Star ratings with AI sentiment tagging |
| Reports | Sales dashboards, date-range filters, Excel export |
| Invoices | One-click PDF invoice generation per order |
AI Features
All AI features are powered by a single service that wraps the Anthropic Claude Messages API. Each feature checks its own toggle before making a request, so disabling one never affects the others.
| Feature | Where it appears | What it does |
|---|---|---|
| Menu Description Writer | Admin → Menu Items | Generates appetizing marketing copy from a dish name and category |
| Upsell Recommendation Engine | Order creation, checkout | Suggests complementary items based on what's already in the order |
| Ordering Assistant (Chatbot) | QR ordering page, Flutter app | Conversational help picking dishes and answering menu questions |
| Sales Forecasting | Admin Dashboard | Plain-language forecast and recommendations from recent sales data |
| Demand Prediction | Admin → Reports → AI Demand Insights | Predicts which items trend up/down over the next 7 days |
| Review Sentiment Analysis | Admin → Reviews | Auto-tags each review positive/negative/neutral with a one-line summary |
Master Toggle
Admin → Settings → AI Features has one master switch and six individual feature switches. Turning the master switch off disables every AI feature instantly — across the admin panel, the guest ordering page, and the API — regardless of the individual toggle states. This is useful for pausing AI spend entirely without touching any code.
{"success": false, "message": "..."} when disabled. Handle this gracefully in client apps by hiding the related UI rather than treating it as a hard error.User Roles
| Role | Typical access |
|---|---|
admin | Everything, including Settings and AI configuration |
manager | Operations, staff management, reports (no system settings) |
chef | Kitchen Display System and order status updates |
waiter | Order taking, table status, reservations |
cashier | Payments, invoices, order status |
delivery | Delivery order status updates |
Role checks are enforced with a role middleware on route groups — e.g. Staff Management and Settings are restricted to admin/manager only.
Project Structure
app/
Http/Controllers/
Admin/ → Web dashboard controllers (staff-facing)
Api/ → REST API controllers (Flutter app-facing)
Public/ → QR ordering page + chatbot widget
Models/ → Eloquent models, one per table
Services/
AIService.php → All Claude API calls, one method per feature
database/
migrations/ → All table definitions
seeders/ → Admin user, settings, AI toggles, sample data
resources/views/
layouts/app.blade.php → Admin panel shell
admin/ → All admin panel pages
public/ → Guest QR ordering page
routes/
web.php → Admin panel + guest QR routes
api.php → Flutter app REST API (versioned /v1)
Database Schema Summary
Key tables and how they relate:
categories→menu_items→menu_item_variants,addonsrestaurant_tables→orders,reservationsorders→order_items,order_status_histories,invoicescustomers→orders,reservations,reviewsinventory_items→stock_movementsusers(staff) →staff_attendancessettings— key/value store for general config + AI master switchai_feature_toggles— one row per AI feature, each independently enable-able
API Reference
Base URL: https://yourdomain.com/api/v1
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/register | Register a customer |
| POST | /auth/login | Login → returns Sanctum token |
| GET | /menu/categories | List active categories |
| GET | /menu/items | List available menu items |
| POST | /chatbot/reply | AI ordering assistant reply |
| GET | /orders 🔒 | List my orders |
| POST | /orders 🔒 | Place an order |
| GET | /reservations 🔒 | My reservations |
| POST | /reservations 🔒 | Create a reservation |
| POST | /reviews 🔒 | Submit a review (auto-analyzed for sentiment) |
🔒 = requires Authorization: Bearer <token>
# Example: place an order
POST /api/v1/orders
Authorization: Bearer 1|abcxyz...
Content-Type: application/json
{
"type": "delivery",
"items": [{ "menu_item_id": 4, "quantity": 2 }]
}
# Response
{ "success": true, "data": { "order_number": "ORD-260707-X1", ... } }
Branding & Colors
Restaurant name, phone, address, currency symbol, and tax rate are all editable from Admin → Settings → General — no code changes needed.
The admin panel's color palette is defined as CSS variables at the top of resources/views/layouts/app.blade.php:
:root {
--brand: #ff5a1f;
--brand-dark: #e14a12;
--sidebar-bg: #16181d;
}
Change these three values to re-theme the entire dashboard consistently.