Set Up Firebase Collections for the Food Delivery App
The food delivery app uses Firestore for vendors, products, orders, deliveries, reviews, reservations, users, and role-based management screens. Configure these collections before testing customer, restaurant owner, admin, and driver flows.
Quick Answer
Enable Firestore, deploy rules and indexes, import the included seed data if the package ships it, verify the collection names in the app config, then create admin, vendor, driver, and customer test users.
Core Collections
The app configuration usually defines collection names for:
| Data | Common collection |
|---|---|
| Vendors/restaurants | vendors |
| Vendor products | vendor_products |
| Vendor categories | vendor_categories |
| Vendor filters | vendor_filters |
| Vendor reviews | vendor_reviews |
| Restaurant orders | restaurant_orders |
| Restaurant deliveries | restaurant_deliveries |
| Reservations | reservations |
| Users | users |
Do not rename collections unless you update every app, admin, driver, function, rule, index, and seed reference that uses the old name.
1. Enable Firebase Services
Start with the Firebase setup flow:
- Configure a Firebase Project
- Enable Firebase Auth
- Enable Firebase Firestore
- Enable Firebase Storage
- Deploy Firebase Functions
The delivery app normally needs Auth, Firestore, Storage, and Functions for a complete production-like test.
2. Import Seed Data
If the package includes seed JSON files, import them into your Firebase project:
After import, verify that vendor, product, category, and filter collections exist in Firebase Console.
3. Review Collection Names in Source
Search the app config for table names:
rg "vendor|restaurant|orders|deliveries|reservations|tables" src
Common config files live under src/config or app-specific configuration
folders. Keep customer, vendor, driver, and admin apps aligned if they share the
same backend.
4. Create Test Roles
Create test users from the app, then set roles in Firestore for management testing:
| Role | Required purpose |
|---|---|
| Customer | Places orders and tracks deliveries. |
| Admin | Creates and manages vendors. |
| Vendor | Manages restaurant products and restaurant orders. |
| Driver | Receives dispatches and updates delivery status. |
Use the role guides for exact fields:
Verification Checklist
- Firestore is enabled.
- Rules and indexes are deployed.
- Seed data exists in the expected collections.
- Customer app lists restaurants and products.
- Admin can manage vendors.
- Vendor can manage products and restaurant orders.
- Driver can receive or view delivery jobs after dispatch.
- Storage displays restaurant and product images.
Troubleshooting
| Problem | Fix |
|---|---|
| Restaurant list is empty | Import vendor seed data and verify collection names. |
| Products do not show under a vendor | Check vendor id references and vendor_products fields. |
| Orders fail to create | Check Auth, Firestore rules, customer cart data, and order collection names. |
| Driver never receives dispatch | Deploy delivery Functions and verify driver role/location fields. |
| Admin/vendor screens show customer UI | Check role and vendorID fields on the user document. |