ReservaHub
Unified Restaurant Booking & Management Solution
A production-ready, multi-tenant restaurant booking and management platform providing end-to-end capabilities β from GPS-based restaurant discovery and real-time table reservations to PayPal payment processing, business analytics, and a departmental support ticket system. Built with a modular architecture on Laravel 12 and Vue.js 3, designed for scalability and maintainability.
Contributors
Demo Video
Screenshots
A walkthrough of the platform's key interfaces β click any screenshot to expand.
Landing Page β GPS-Based Restaurant Discovery
The home screen uses the Haversine formula to surface nearby restaurants based on the user's location. Results can be filtered by cuisine type and sorted by rating. Each card shows the restaurant name, average rating, cuisine category, and distance.
Restaurant Profile β Branch Details & Reviews
A full restaurant profile page showing branch locations on a map, operating hours, cuisine categories, and the aggregated star rating. The review section displays individual 1β5 star ratings with text comments from verified diners.
Real-Time Table Reservation Interface
The reservation flow lets users pick a branch, date, and time slotβthen shows only available tables matching the party size. Status tracking follows the workflow: pending β confirmed β completed (or cancelled). QR codes can also be scanned at the table for instant booking.
Menu Management β Categories & Items
Restaurant owners and branch admins can create menu categories (e.g., Appetizers, Mains, Desserts) and add items with pricing and availability toggles. Each branch maintains its own independent menu, allowing different locations to offer different items.
Business Analytics Dashboard
The owner dashboard visualizes revenue over time, reservation counts grouped by status (pending, confirmed, completed, cancelled), customer growth trends, and rating distribution. Historical snapshots are stored in analytics_snapshots for trend comparison.
Platform Administration Panel
Platform admins can approve or suspend restaurants, manage user accounts and role assignments, and view system-wide analytics. The restaurant approval workflow moves new listings through pending β active β suspended states.
Department-Based Support Ticket System
Users submit tickets routed to specific departments (support, feedback, complaints). Each ticket has threaded conversations between the user and support agents. Status flows from open β pending β closed. Support agents see a filterable queue of their department's tickets.
PayPal Payment Processing
The PayPal integration handles the full payment lifecycle: order creation β customer approval redirect β payment capture β optional refund. Transactions are logged with status tracking. Supports both sandbox testing and live modes via environment configuration.
Key Features
GPS Restaurant Discovery
Users find nearby restaurants using Haversine-formula-based geolocation queries. Results are filterable by cuisine type and sortable by distance, rating, or name. The discovery engine runs directly in MySQL for performance β no external geo service required.
Real-Time Table Reservations
The reservation system checks table availability in real time against existing bookings for a given date and time slot. Party size is validated against table capacity. Each reservation follows a status workflow: pending β confirmed β completed (or cancelled). QR codes on tables allow walk-in customers to book instantly by scanning.
PayPal Payment Integration
Complete payment lifecycle via PayPal β order creation, customer redirect for approval, payment capture, and refund processing. Supports webhook notifications for asynchronous status updates. Both sandbox and live modes are configured through environment variables. All transactions are logged with full audit trails.
Reviews & Ratings
Diners leave 1β5 star ratings with text comments after completing a reservation. Average ratings are recalculated automatically per restaurant. Only users with a completed reservation at a restaurant can submit a review β preventing fake ratings.
Business Analytics
Restaurant owners get dashboards showing revenue tracking, reservation counts by status, customer growth trends, and rating analytics over time. Daily snapshots are stored in analytics_snapshots for historical trend analysis and period comparison.
Support Ticket System
Department-routed tickets (support, feedback, complaints) with threaded message conversations. Tickets follow a status workflow: open β pending β closed. Support agents see a filterable queue scoped to their department. Users can track their open tickets and receive responses in-app.
Multi-Tenant Architecture
Each restaurant owner operates independently with isolated data access enforced by Laravel Policies. The hierarchy is Restaurant β Branches β Tables. Owners can delegate branch management to branch admins without granting access to other branches or restaurants.
Menu Management
Per-branch menu system with categories and items. Each item has pricing and an availability toggle. Branch admins control their own menus independently β different locations of the same restaurant can offer different items and pricing.
Architecture
ReservaHub follows a modular, layered architecture organized into four tiers. Business logic is encapsulated in service classes (not controllers or models), making it reusable across GraphQL resolvers and Inertia controllers. Each feature domain lives in its own module under app/Modules/ β adding a new module requires zero core refactoring.
Vue.js 3 single-page application with Inertia.js pages, Pinia state management, and Tailwind CSS 4 for styling. Components are organized by feature domain under resources/js/Pages/.
Inertia.js connects Vue pages to Laravel controllers without building a separate REST API. Ziggy exposes named Laravel routes to JavaScript. GraphQL (Lighthouse) provides a typed API for complex queries like nearby restaurant search.
10 self-contained modules under app/Modules/, each with its own service provider. Authorization uses Laravel Policies and Gates. Form Requests handle validation. The Service Layer pattern keeps business logic out of controllers.
Eloquent ORM with MySQL 8. 27 migrations define the schema. Performance indexes on (latitude, longitude) for GPS queries, (table_id, date, time_slot) for availability checks, and (restaurant_id) for rating aggregation.
Architecture Principles
Modular Design
Each feature domain is encapsulated in its own module under app/Modules/. Modules are independently developed, tested, and can be enabled or disabled via service providers without affecting the rest of the system.
API-First Design
All business logic is exposed through GraphQL via Lighthouse, enabling multiple clients (web, mobile, third-party). The schema is self-documenting with strong typing and compile-time validation.
Service Layer Pattern
Business logic lives in dedicated service classes β not in controllers, models, or resolvers. This ensures reusability, testability, and single responsibility. Example: RestaurantService handles discovery queries used by both GraphQL resolvers and Inertia controllers.
Multi-Tenancy via Policies
Data isolation is enforced through Laravel Policies, not database-level filtering. Each policy checks ownership: RestaurantPolicy verifies the owner, BranchPolicy checks owner or branch admin status, and TicketPolicy scopes to ticket creator or assigned agent.
Tech Stack
| Layer | Technology | Purpose |
|---|---|---|
| Backend | Laravel 12 / PHP 8.2+ | Application framework, routing, middleware, Eloquent ORM |
| Frontend | Vue.js 3 | Reactive UI components with Composition API |
| Bridge | Inertia.js | Server-driven SPA β no separate REST API needed |
| API | GraphQL (Lighthouse) | Typed API for complex queries (GPS search, availability) |
| Styling | Tailwind CSS 4 | Utility-first CSS framework |
| Database | MySQL 8 | Relational data store with geospatial indexing |
| State | Pinia | Vue.js state management (Composition API pattern) |
| Auth | Laravel Sanctum | Session-based authentication (CSRF-protected) |
| Build | Vite 7 | Fast dev server and production bundling |
| Payments | PayPal SDK | Order creation, capture, refund, webhooks |
System Modules
10 self-contained modules under app/Modules/, each registered via its own service provider. Zero coupling between modules β adding a new feature domain requires creating a new module directory and registering its provider in bootstrap/providers.php.
Registration, login, session management, and role-based access control. Five roles (system_owner, platform_admin, restaurant_owner, restaurant_admin, customer) with Laravel Policies enforcing data isolation. Supports user suspension.
Restaurant profiles with GPS coordinates, cuisine types, and status workflow (pending β active β suspended). The withinRadius() scope uses the Haversine formula for proximity queries. Aggregate ratings are recalculated on review create/update/delete.
Multiple branches per restaurant, each with its own tables and admin delegation. Table capacity management and real-time availability checking against existing reservations for a given date and time slot.
Core booking engine with time-slot management and party-size validation. Status flow: pending β confirmed β completed (or cancelled). Links to the Payment module for PayPal transactions. Supports QR-code-initiated bookings.
PayPal-only integration handling the full lifecycle: order creation β customer approval redirect β capture β optional refund. Webhook endpoint for asynchronous payment status updates. All transactions logged with amount, status, and PayPal order ID.
1β5 star ratings with text comments. Reviews are tied to completed reservations to prevent fake submissions. Automatic average rating recalculation per restaurant on every create, update, or delete.
Business intelligence for restaurant owners: total reservations by status, revenue tracking, customer growth, and rating trends. Daily metric snapshots stored in analytics_snapshots for historical comparison.
Per-branch menu categories and items with pricing and availability toggles. Each branch maintains an independent menu β different locations can offer different items.
Support ticket system with department-based routing (support, feedback, complaints). Threaded conversations between users and agents. Status workflow: open β pending β closed.
Platform administration: user management (role changes, suspensions), restaurant approval workflow, system-wide analytics aggregation, and ticket oversight across all departments.
User Roles & Authorization
Authorization uses Laravel Policies for model-level access control and Gates for action-level checks. Each policy enforces ownership β e.g., RestaurantPolicy verifies the requesting user is the restaurant owner before allowing edits.
| Role | Key | Capabilities |
|---|---|---|
| System Owner | system_owner | Full unrestricted platform access β can manage all data, users, and system configuration. |
| Platform Admin | platform_admin | User management, restaurant approval workflow (pending β active β suspended), platform-wide analytics access. |
| Restaurant Owner | restaurant_owner | Manage own restaurants, create and control branches, menus, view business analytics, and handle support tickets. |
| Restaurant Admin | restaurant_admin | Manage assigned branch only β tables, reservations, branch-specific menu items, and daily operations. |
| Customer | customer | Discover restaurants via GPS, make reservations, process payments, leave reviews, and open support tickets. |
Database Design
27 migrations producing a comprehensive relational schema. Key performance indexes: (latitude, longitude) on restaurants for GPS queries, (table_id, date, time_slot) on reservations for availability, and (restaurant_id) on reviews for rating aggregation.
users
βββ restaurants (owner_id β users.id)
β βββ branches
β β βββ tables
β β βββ branch_admins (pivot)
β β βββ menu_categories
β β β βββ menu_items
β β βββ restaurant_team_members
β βββ reviews
βββ reservations (user_id, table_id)
β βββ reservation_items
β βββ payments
βββ favorites (user_id, restaurant_id)
βββ tickets (user_id)
β βββ ticket_messages
βββ notifications
βββ analytics_snapshots GraphQL API
All business logic is exposed through GraphQL via Lighthouse. The schema is split across 8 type definition files under graphql/types/. Session-based authentication with the @auth directive protects sensitive queries and mutations.
Nearby Restaurants Query
query NearbyRestaurants {
nearbyRestaurants(
latitude: 40.7128
longitude: -74.0060
radius: 10
) {
id
name
cuisine_type
average_rating
}
} Available Tables Query
query AvailableTables(
$branchId: ID!
$date: Date!
$time: String!
) {
availableTables(
branch_id: $branchId
date: $date
time: $time
) {
id
capacity
table_number
}
} Contributions
ReservaHub is open-source and welcomes contributions. The modular architecture makes it straightforward to add new feature domains without touching existing code.
Adding a New Module
Create a directory under app/Modules/NewModule/, add a NewModuleServiceProvider.php, implement models, services, and GraphQL resolvers, then register the provider in bootstrap/providers.php. Add GraphQL type definitions to graphql/types/.
Code Standards
PHP follows PSR-12. JavaScript/Vue uses ESLint + Prettier. Models are singular PascalCase (Restaurant), tables are plural snake_case (restaurants), services use the Service suffix (RestaurantService), and GraphQL fields are camelCase (averageRating).
Testing
Unit tests for service classes, feature tests for GraphQL endpoints, and Vue component tests using Vitest. Run with php artisan test for backend and npm run test for frontend.
Getting Started
Clone the repo, run composer install && npm install, copy .env.example to .env, generate app key, run migrations, then start both php artisan serve and npm run dev. Demo accounts are available via the seeder.
Project Structure
reservahub/
βββ app/
β βββ Models/ # Eloquent models
β βββ Modules/ # 10 domain modules
β β βββ Admin/ βββ Analytics/
β β βββ Auth/ βββ Branch/
β β βββ Department/ βββ Menu/
β β βββ Payment/ βββ Reservation/
β β βββ Restaurant/ βββ Review/
β βββ Policies/ # Authorization policies
β βββ Services/ # Shared services
βββ graphql/
β βββ schema.graphql # Root schema
β βββ types/ # 8 type definition files
βββ resources/js/
β βββ Pages/ # Inertia page components
β βββ Components/ # Reusable Vue components
β βββ stores/ # Pinia state stores
β βββ api/ # GraphQL HTTP client
βββ database/
β βββ migrations/ # 27 migration files
β βββ seeders/ # Demo data seeders
β βββ factories/ # Model factories
βββ tests/ # Feature & Unit tests