Skip to main content

Overview

The Restaurant Reservation System is a comprehensive Flutter mobile application that enables restaurants to manage table reservations efficiently. Built with clean architecture principles, this system provides both customer-facing features for making reservations and business owner tools for managing restaurant operations.

Key Features

For Customers

  • Real-time Table Availability: Check available tables for specific dates and times with instant feedback
  • Smart Reservation System: 1-hour time slots with automatic conflict detection
  • Email Verification: Secure booking confirmation via email codes
  • Reservation Management: View and cancel existing reservations
  • Multi-capacity Tables: Automatically matches party size to appropriate table capacity

For Restaurant Owners

  • Business Profile Management: Configure restaurant details, hours, and policies
  • Table Configuration: Set up tables with varying capacities
  • Operating Hours: Define opening hours for each day of the week
  • Reservation Dashboard: View all bookings with status tracking
  • Customer Communications: Automated email notifications for confirmations and cancellations

Architecture

The application follows Clean Architecture principles with clear separation of concerns:
lib/
├── dominio/              # Domain layer (entities & interfaces)
│   ├── entidades/        # Business entities
│   └── repositorios/     # Repository interfaces
├── aplicacion/           # Application layer (use cases)
├── adaptadores/          # Infrastructure layer (implementations)
└── presentacion/         # Presentation layer (UI)

Core Entities

  • Reserva (Reservation): Manages booking details, timestamps, and status
  • Mesa (Table): Represents restaurant tables with capacity constraints
  • Negocio (Business): Restaurant configuration and settings
  • HorarioApertura (Opening Hours): Operating schedule management

Technology Stack

Flutter

Cross-platform mobile framework (SDK ^3.7.2)

Firebase

Backend services (Auth, Firestore, Hosting)

BLoC Pattern

State management with flutter_bloc ^8.1.3

GetIt

Dependency injection container ^7.6.4

Reservation System Logic

The system implements 1-hour time slots with intelligent conflict detection:
// Example: Reservation overlap detection
Reserva 1: 12:00 - 13:00
Reserva 2: 12:30 - 13:30CONFLICT (overlaps)

Reserva 1: 12:00 - 13:00
Reserva 2: 13:00 - 14:00NO CONFLICT (sequential)

Availability Check Process

  1. Capacity Filtering: Find tables that can accommodate the party size
  2. Time Conflict Check: Verify no existing reservations overlap the requested time
  3. Business Hours Validation: Ensure restaurant is open during requested time
  4. Final Validation: Confirm availability before creating the reservation
The system only considers confirmed and pending reservations as conflicts. Cancelled reservations free up table availability.

State Management

Reservation states follow a clear lifecycle:
  • Pendiente (Pending): Initial state awaiting email verification
  • Confirmada (Confirmed): Verified and secured reservation
  • Cancelada (Cancelled): Cancelled by customer or owner

Firebase Integration

The application uses Firebase for:
  • Cloud Firestore: Real-time database for all business data
  • Firebase Authentication: Google Sign-In for restaurant owners
  • Firebase Hosting: Web deployment capabilities
  • Email Triggers: Automated customer notifications

Project Structure

Key files in the codebase:
  • lib/main.dart:9 - Application entry point with Firebase initialization
  • lib/service_locator.dart:33 - Dependency injection configuration
  • lib/router.dart - GoRouter navigation setup
  • lib/aplicacion/crear_reserva.dart:8 - Core reservation creation use case
  • lib/dominio/entidades/reserva.dart:7 - Reservation entity definition

Design Principles

Clean Architecture

  • Domain Layer: Business logic independent of frameworks
  • Application Layer: Use cases orchestrating business rules
  • Infrastructure Layer: External services and database adapters
  • Presentation Layer: UI components with BLoC state management

Dependency Injection

All dependencies are registered in the service locator:
void setupServiceLocator() {
  // Repositories
  getIt.registerLazySingleton<ReservaRepositorio>(
    () => ReservaRepositorioFirestore(),
  );
  
  // Use cases
  getIt.registerFactory(() => CrearReserva(
    getIt<ReservaRepositorio>(),
    mesaRepositorio: getIt<MesaRepositorio>(),
  ));
}

Getting Started

Ready to set up your own restaurant reservation system?

Quickstart Guide

Get your first reservation working in minutes

Installation

Complete setup instructions and requirements

What’s Next?

After setting up the system, explore:
  • Customizing the reservation duration (default: 60 minutes)
  • Configuring maximum advance booking days (default: 14 days)
  • Setting up restaurant-specific business hours
  • Customizing email notification templates
This system uses Firestore as the primary database. Make sure to configure proper security rules before deploying to production.

Build docs developers (and LLMs) love