Skip to main content

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:

DataCommon collection
Vendors/restaurantsvendors
Vendor productsvendor_products
Vendor categoriesvendor_categories
Vendor filtersvendor_filters
Vendor reviewsvendor_reviews
Restaurant ordersrestaurant_orders
Restaurant deliveriesrestaurant_deliveries
Reservationsreservations
Usersusers

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:

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:

RoleRequired purpose
CustomerPlaces orders and tracks deliveries.
AdminCreates and manages vendors.
VendorManages restaurant products and restaurant orders.
DriverReceives 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

ProblemFix
Restaurant list is emptyImport vendor seed data and verify collection names.
Products do not show under a vendorCheck vendor id references and vendor_products fields.
Orders fail to createCheck Auth, Firestore rules, customer cart data, and order collection names.
Driver never receives dispatchDeploy delivery Functions and verify driver role/location fields.
Admin/vendor screens show customer UICheck role and vendorID fields on the user document.

Next Steps