Skip to main content

Admin and Restaurant Owner App for Food Delivery

The food delivery package can show different navigation stacks depending on the signed-in user's role. Use this page to configure admin users and restaurant owner users for vendor management and order processing.

Quick Answer

Create users from the app, open their Firestore user documents, assign role: "admin" for administrators or role: "vendor" plus vendorID for restaurant owners, then sign in again and verify the correct management screens appear.

Role Model

RolePurpose
CustomerBrowses restaurants, places orders, tracks delivery.
AdminCreates and manages vendors/restaurants.
VendorManages one restaurant, products, and restaurant orders.
DriverAccepts deliveries and updates delivery status.

Exact field names can vary by package version. Search the source before changing navigation logic:

rg "role|vendorID|AdminDrawer|VendorDrawer|DriverDrawer" src

1. Create an Admin User

  1. Sign up from the app with the account that should become admin.
  2. Open Firebase Console > Firestore Database.
  3. Find the user document in the users collection.
  4. Add or update:
{
role: 'admin'
}
  1. Sign out and sign in again.
  2. Verify that admin screens are visible.

2. Create a Vendor

Sign in as an admin and create a vendor/restaurant from the admin flow, or create the vendor document manually if your package expects seed data.

Save the vendor document id. The restaurant owner user needs this id.

3. Assign a Restaurant Owner

  1. Sign up from the app with the restaurant owner account.
  2. Open the owner user document in Firestore.
  3. Add or update:
{
role: 'vendor',
vendorID: '<vendor-document-id>'
}
  1. Sign out and sign in again.
  2. Verify that the restaurant owner can manage products and restaurant orders.

4. Create Separate Branded Apps When Needed

Some teams publish separate customer, restaurant owner, and driver apps. If you do that, give each app its own:

  • app name;
  • app icon;
  • iOS bundle identifier;
  • Android application id;
  • Firebase iOS and Android app entries;
  • push notification credentials;
  • store listing.

They can still point to the same Firebase backend if the rules, roles, and app config support that setup.

Verification Checklist

  • Admin user has role: "admin".
  • Restaurant owner user has role: "vendor".
  • Restaurant owner user has a valid vendorID.
  • Vendor document exists in Firestore.
  • Admin can create or edit vendors.
  • Vendor can edit products and view restaurant orders.
  • Customer users do not see admin/vendor screens.

Troubleshooting

ProblemFix
Admin still sees customer screensSign out/in again and verify the role field on the correct user document.
Vendor cannot see a restaurantCheck vendorID and confirm the vendor document exists.
Vendor can edit the wrong restaurantFix the vendorID value and review Firestore rules.
Admin writes failCheck Firestore rules and role-based permissions.
Multiple apps overwrite each other on deviceUse different bundle identifiers and Android application ids.

Next Steps