Skip to main content

Welcome!

This guide will walk you through setting up the Restaurant Reservation System and creating your first test reservation. By the end, you’ll have a fully functional reservation system running on your device.
1
Prerequisites
2
Before starting, ensure you have:
3

Flutter SDK

Version 3.7.2 or higher

Firebase Account

Free Google account for Firebase

Git

For cloning the repository

IDE

VS Code or Android Studio
4
Verify Flutter installation:
5
flutter --version
6
You should see Flutter 3.7.2 or higher. If not, follow the Flutter installation guide.
7
Clone the Repository
8
Clone the source code to your local machine:
9
git clone https://github.com/AgustinLuconi/Software_Restaurante.git
cd Software_Restaurante
10
Install Dependencies
11
Install all Flutter packages defined in pubspec.yaml:
12
flutter pub get
13
This will install essential packages:
14
  • firebase_core: ^3.3.0 - Firebase SDK
  • cloud_firestore: ^5.6.12 - Database
  • firebase_auth: ^5.1.0 - Authentication
  • flutter_bloc: ^8.1.3 - State management
  • get_it: ^7.6.4 - Dependency injection
  • go_router: ^13.0.0 - Navigation
  • 15
    Set Up Firebase Project
    16
    Create and configure your Firebase project:
    17
    Firebase Console
    1. Go to Firebase Console
    2. Click Add project
    3. Enter project name (e.g., “my-restaurant-app”)
    4. Disable Google Analytics (optional for testing)
    5. Click Create project
    Enable Firestore
    1. In Firebase Console, go to BuildFirestore Database
    2. Click Create database
    3. Select Start in test mode (for development)
    4. Choose a location closest to you
    5. Click Enable
    Enable Authentication
    1. Go to BuildAuthentication
    2. Click Get started
    3. Enable Email/Password provider
    4. Enable Google provider
    5. Add support email
    18
    Test mode security rules allow anyone to read/write your database. Update rules before production deployment.
    19
    Configure Firebase for Flutter
    20
    Install Firebase CLI and configure your app:
    21
    # Install Firebase CLI
    npm install -g firebase-tools
    
    # Login to Firebase
    firebase login
    
    # Install FlutterFire CLI
    dart pub global activate flutterfire_cli
    
    # Configure Firebase for your Flutter app
    flutterfire configure
    
    22
    During configuration:
    23
  • Select your Firebase project
  • Choose platforms (iOS, Android, Web, etc.)
  • Accept the generated configuration
  • 24
    This creates lib/firebase_options.dart with your project configuration.
    25
    Add Firebase Configuration Files
    26
    The project needs a .firebaserc file in the root directory:
    27
    {
      "projects": {
        "default": "your-project-id"
      }
    }
    
    28
    Replace your-project-id with your actual Firebase project ID from the Firebase Console.
    29
    Initialize Firestore Data
    30
    The app requires initial business data. You can either:
    31
    Option A: Use Firebase Console UI
    32
  • Go to Firestore Database in Firebase Console
  • Start collection: negocios
  • Add a document with auto-generated ID
  • Add fields:
    • nombre: “Mi Restaurante” (string)
    • email: “[email protected]” (string)
    • telefono: “+123456789” (string)
    • direccion: “123 Main St” (string)
    • maxDiasAnticipacionReserva: 14 (number)
    • duracionPromedioMinutos: 60 (number)
  • 33
    Option B: Use Firestore Rules to Allow Initialization
    34
    Update firestore.rules:
    35
    rules_version = '2';
    service cloud.firestore {
      match /databases/{database}/documents {
        // Allow read/write for development
        match /{document=**} {
          allow read, write: if true;
        }
      }
    }
    
    36
    Deploy rules:
    37
    firebase deploy --only firestore:rules
    
    38
    Run the Application
    39
    Now you’re ready to run the app!
    40
    Terminal
    # Start an emulator or connect a device
    flutter devices
    
    # Run the app in debug mode
    flutter run
    
    Build for specific platform
    # Android
    flutter run -d android
    
    # iOS (macOS only)
    flutter run -d ios
    
    # Web
    flutter run -d chrome
    
    Release build
    # Create APK (Android)
    flutter build apk
    
    # Create iOS build
    flutter build ios
    
    41
    The app will compile and launch on your device. You should see the main screen with navigation options.
    42
    Create Your First Business
    43
    Set up your restaurant profile:
    44
  • Open the app and navigate to the owner section
  • Sign in with Google (for owners)
  • Create business profile:
    • Name: “Test Restaurant”
    • Email: [email protected]
    • Phone: +1234567890
    • Address: “123 Test Street”
  • Configure settings:
    • Max advance booking: 14 days
    • Average duration: 60 minutes
  • Save your business profile
  • 45
    Add Tables
    46
    Create tables for your restaurant:
    47
  • Go to Table Management
  • Click Add Table
  • Enter table details:
    • Name: “Mesa 1” (Table 1)
    • Capacity: 2 persons
    • Status: Available
  • Repeat for more tables:
    • Mesa 2 (4 persons)
    • Mesa 3 (6 persons)
  • Click Save
  • 48
    Tables use smart capacity matching. A table can accommodate +3 persons above party size (e.g., a 6-person table can host 3-6 guests).
    49
    Set Operating Hours
    50
    Define when your restaurant is open:
    51
  • Navigate to Operating Hours
  • For each day of the week:
    • Toggle Open/Closed
    • Set Opening time: 11:00 AM
    • Set Closing time: 10:00 PM
  • Save the schedule
  • 52
    Make a Test Reservation
    53
    Time to create your first reservation!
    54
  • Navigate to Availability (customer view)
  • Select date: Choose tomorrow’s date
  • Select time: 2:00 PM (14:00)
  • Number of guests: 2 persons
  • Click Search Available Tables
  • 55
    You should see available tables matching your criteria!
    56
  • Select a table: Choose “Mesa 1”
  • Enter customer details:
    • Name: “Juan Pérez”
    • Email: “[email protected]
    • Phone: “+1234567890” (optional)
  • Click Create Reservation
  • 57
    Verify the Reservation
    58
    The system will send a verification code:
    59
    Email Verification
    1. Check the console output for verification code
    2. In production, this would be sent via email
    3. Enter the 6-digit code in the app
    4. Click Verify
    Confirmation
    Once verified, you’ll see:
    • Reservation Confirmed
    • Reservation ID
    • Table name
    • Date and time
    • Party size
    60
    View Your Reservations
    61
    Check the reservation dashboard:
    62
  • Go to My Reservations (customer view)
  • See your confirmed booking:
    • Date: Tomorrow
    • Time: 14:00 - 15:00
    • Table: Mesa 1
    • Status: Confirmed
  • 63
    As a business owner:
    64
  • Go to Owner Dashboard
  • View all reservations
  • See customer details
  • Option to cancel if needed
  • 65
    Test Conflict Detection
    66
    Verify the system prevents double-booking:
    67
  • Try to make another reservation for:
    • Same table: Mesa 1
    • Same date: Tomorrow
    • Same time: 14:00
  • Click Search Available Tables
  • 68
    Mesa 1 should NOT appear in available tables. The system detects the conflict!
    69
  • Try a different time slot: 15:00 (3:00 PM)
  • Mesa 1 should now be available ✅
  • Understanding Time Slots

    The system uses 1-hour fixed intervals:
    // Reservation structure
    Reservation {
      fechaHora: DateTime(2026, 03, 10, 14, 0),  // 2:00 PM
      duracionMinutos: 60,                       // 1 hour duration
      horaFin: DateTime(2026, 03, 10, 15, 0),   // Calculated: 3:00 PM
    }
    
    // Conflict detection logic
    Reserva 1: [14:00 - 15:00)
    Reserva 2: [14:30 - 15:30)  → CONFLICT
    Reserva 2: [15:00 - 16:00)  → NO CONFLICT
    
    The overlap algorithm uses half-open intervals [start, end). Two reservations conflict if startB < endA AND endB > startA.

    What You’ve Accomplished

    • Installed Flutter and dependencies
    • Configured Firebase project
    • Connected app to Firestore database
    • Created restaurant profile
    • Added tables with capacities
    • Set operating hours
    • Made your first reservation
    • Verified email confirmation flow
    • Tested conflict detection

    Next Steps

    Customize Settings

    Adjust reservation duration, advance booking limits, and email templates

    Deploy to Production

    Set up proper Firestore security rules and deploy to app stores

    Add Features

    Implement recurring reservations, waitlists, and advanced analytics

    Integration Guide

    Connect with payment systems, SMS notifications, and third-party APIs

    Troubleshooting

    Problem: App crashes with “Firebase not initialized”Solution: Run flutterfire configure again and ensure firebase_options.dart exists in lib/.
    Problem: Search returns no available tablesSolution:
    • Verify tables are created in Firestore (mesas collection)
    • Check table capacity matches or exceeds party size
    • Ensure operating hours include selected time
    • Confirm no conflicting reservations exist
    Problem: Email verification failsSolution: In development, verification codes are printed to console. Check Flutter logs for the 6-digit code.
    Problem: Compilation errors after installing dependenciesSolution:
    flutter clean
    flutter pub get
    flutter pub upgrade
    flutter run
    

    Need Help?

    If you encounter issues:
    1. Check the Installation Guide for detailed setup instructions
    2. Review Firebase Console for configuration errors
    3. Verify all dependencies are correctly installed
    4. Check Flutter and Firebase versions compatibility
    For detailed architecture information and code examples, see the Introduction page.

    Build docs developers (and LLMs) love