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.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
You should see Flutter 3.7.2 or higher. If not, follow the Flutter installation guide.
firebase_core: ^3.3.0 - Firebase SDKcloud_firestore: ^5.6.12 - Databasefirebase_auth: ^5.1.0 - Authenticationflutter_bloc: ^8.1.3 - State managementget_it: ^7.6.4 - Dependency injectiongo_router: ^13.0.0 - Navigation Firebase Console
- Go to Firebase Console
- Click Add project
- Enter project name (e.g., “my-restaurant-app”)
- Disable Google Analytics (optional for testing)
- Click Create project
Enable Firestore
- In Firebase Console, go to Build → Firestore Database
- Click Create database
- Select Start in test mode (for development)
- Choose a location closest to you
- Click Enable
Enable Authentication
- Go to Build → Authentication
- Click Get started
- Enable Email/Password provider
- Enable Google provider
- Add support email
Test mode security rules allow anyone to read/write your database. Update rules before production deployment.
# 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
negociosnombre: “Mi Restaurante” (string)email: “[email protected]” (string)telefono: “+123456789” (string)direccion: “123 Main St” (string)maxDiasAnticipacionReserva: 14 (number)duracionPromedioMinutos: 60 (number)
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Allow read/write for development
match /{document=**} {
allow read, write: if true;
}
}
}
The app will compile and launch on your device. You should see the main screen with navigation options.
- Name: “Test Restaurant”
- Email: [email protected]
- Phone: +1234567890
- Address: “123 Test Street”
- Max advance booking: 14 days
- Average duration: 60 minutes
- Name: “Mesa 1” (Table 1)
- Capacity: 2 persons
- Status: Available
- Mesa 2 (4 persons)
- Mesa 3 (6 persons)
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).
- Toggle Open/Closed
- Set Opening time: 11:00 AM
- Set Closing time: 10:00 PM
- Name: “Juan Pérez”
- Email: “[email protected]”
- Phone: “+1234567890” (optional)
Email Verification
- Check the console output for verification code
- In production, this would be sent via email
- Enter the 6-digit code in the app
- Click Verify
Confirmation
Once verified, you’ll see:
- ✅ Reservation Confirmed
- Reservation ID
- Table name
- Date and time
- Party size
- Date: Tomorrow
- Time: 14:00 - 15:00
- Table: Mesa 1
- Status: Confirmed
- Same table: Mesa 1
- Same date: Tomorrow
- Same time: 14:00
Understanding Time Slots
The system uses 1-hour fixed intervals:The overlap algorithm uses half-open intervals [start, end). Two reservations conflict if
startB < endA AND endB > startA.What You’ve Accomplished
✅ Application Setup
✅ Application Setup
- Installed Flutter and dependencies
- Configured Firebase project
- Connected app to Firestore database
✅ Business Configuration
✅ Business Configuration
- Created restaurant profile
- Added tables with capacities
- Set operating hours
✅ Reservation System
✅ Reservation System
- 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
Firebase not initialized error
Firebase not initialized error
Problem: App crashes with “Firebase not initialized”Solution: Run
flutterfire configure again and ensure firebase_options.dart exists in lib/.No tables available
No tables available
Problem: Search returns no available tablesSolution:
- Verify tables are created in Firestore (
mesascollection) - Check table capacity matches or exceeds party size
- Ensure operating hours include selected time
- Confirm no conflicting reservations exist
Verification code not working
Verification code not working
Problem: Email verification failsSolution: In development, verification codes are printed to console. Check Flutter logs for the 6-digit code.
Build errors after pub get
Build errors after pub get
Problem: Compilation errors after installing dependenciesSolution:
Need Help?
If you encounter issues:- Check the Installation Guide for detailed setup instructions
- Review Firebase Console for configuration errors
- Verify all dependencies are correctly installed
- Check Flutter and Firebase versions compatibility
For detailed architecture information and code examples, see the Introduction page.