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
| Role | Purpose |
|---|---|
| Customer | Browses restaurants, places orders, tracks delivery. |
| Admin | Creates and manages vendors/restaurants. |
| Vendor | Manages one restaurant, products, and restaurant orders. |
| Driver | Accepts 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
- Sign up from the app with the account that should become admin.
- Open Firebase Console > Firestore Database.
- Find the user document in the users collection.
- Add or update:
{
role: 'admin'
}
- Sign out and sign in again.
- 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
- Sign up from the app with the restaurant owner account.
- Open the owner user document in Firestore.
- Add or update:
{
role: 'vendor',
vendorID: '<vendor-document-id>'
}
- Sign out and sign in again.
- 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
| Problem | Fix |
|---|---|
| Admin still sees customer screens | Sign out/in again and verify the role field on the correct user document. |
| Vendor cannot see a restaurant | Check vendorID and confirm the vendor document exists. |
| Vendor can edit the wrong restaurant | Fix the vendorID value and review Firestore rules. |
| Admin writes fail | Check Firestore rules and role-based permissions. |
| Multiple apps overwrite each other on device | Use different bundle identifiers and Android application ids. |