# joscar05-c/al-toque-delivery architecture

> Architecture diagram of the GitHub repository joscar05-c/al-toque-delivery, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/joscar05-c/al-toque-delivery
- Repository: https://github.com/joscar05-c/al-toque-delivery

## Overview

Al Toque is a food-delivery platform spanning a customer/driver mobile app and web operations consoles for administrators and restaurants. The main customer journey is browsing restaurants and menus, selecting options, checking out, then tracking and reviewing an order; drivers handle delivery, while restaurant and admin consoles manage fulfillment and platform operations. The tree also shows payment, address, application, and profile capabilities. Source excerpts establish selected calls and auth provisioning; links for unsampled workflows are omitted rather than inferred.

Main entry points: [`apps/web-panel/app/admin/page.tsx`](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/admin/page.tsx) (Admin console), [`apps/web-panel/app/restaurant/layout.tsx`](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/restaurant/layout.tsx) (Restaurant portal), [`apps/mobile/src/app/_layout.tsx`](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/app/_layout.tsx) (App routing), [`apps/mobile/src/app/(client)/(tabs)/index.tsx`](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/app/(client)/(tabs)/index.tsx) (Restaurant discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_mobile_entry["App routing<br/>[_layout.tsx]"]
  node_auth["Sign-in and profile<br/>[login.tsx]"]
  node_browse["Restaurant discovery<br/>[index.tsx]"]
  node_restaurant_menu["Restaurant menu<br/>[&#91;id&#93;.tsx]"]
  node_cart["Cart state<br/>[cartStore.ts]"]
  node_checkout["Checkout<br/>[checkout.tsx]"]
  node_addresses["Delivery addresses<br/>[addresses.ts]"]
  node_orders["Order lifecycle<br/>[orders.ts]"]
  node_tracking["Order tracking<br/>[&#91;id&#93;.tsx]"]
  node_driver_app["Driver workflow<br/>[&#91;id&#93;.tsx]"]
  node_driver_location["Driver location<br/>[driverLocations.ts]"]
  node_reviews["Order reviews<br/>[&#91;order_id&#93;.tsx]"]
  node_mobile_profile["Profiles and applications<br/>[ProfileScreen.tsx]"]
end

subgraph group_ops["Admin operations"]
  node_admin_portal["Admin console<br/>[page.tsx]"]
  node_admin_restaurants["Restaurant administration<br/>[actions.ts]"]
  node_admin_orders["Order administration<br/>[actions.ts]"]
  node_admin_payments["Payment review<br/>[actions.ts]"]
  node_admin_users["User administration<br/>[actions.ts]"]
  node_admin_drivers["Driver administration<br/>[actions.ts]"]
  node_applications["Partner applications<br/>[applications.ts]"]
end

subgraph group_restaurant["Restaurant operations"]
  node_restaurant_portal["Restaurant portal<br/>[layout.tsx]"]
  node_restaurant_menu_admin["Menu management<br/>[actions.ts]"]
  node_restaurant_orders["Order board<br/>[page.tsx]"]
end

subgraph group_identity["Identity and data"]
  node_web_auth["Web phone auth<br/>[auth-client.ts]"]
  node_provisioning["Profile provisioning<br/>[index.ts]"]
  node_firebase{{"Firebase identity"}}
  node_supabase[("Supabase data<br/>[server.ts]")]
  node_shared_types["Database schema types<br/>[database.types.ts]"]
end

node_customer(("Customer"))

node_customer -->|"opens app"| node_mobile_entry
node_mobile_entry -->|"routes"| node_auth
node_customer -->|"browses"| node_browse
node_browse -.->|"selects restaurant"| node_restaurant_menu
node_customer -.->|"places order"| node_checkout
node_checkout -->|"uses types"| node_shared_types
node_customer -.->|"tracks order"| node_tracking
node_driver_app -.->|"updates location"| node_driver_location
node_customer -.->|"manages profile"| node_mobile_profile
node_mobile_profile -.->|"submits applications"| node_applications
node_restaurant_portal -.->|"manages menu"| node_restaurant_menu_admin
node_restaurant_portal -.->|"handles orders"| node_restaurant_orders
node_admin_portal -.->|"administers restaurants"| node_admin_restaurants
node_admin_portal -.->|"manages orders"| node_admin_orders
node_admin_portal -.->|"reviews payments"| node_admin_payments
node_admin_portal -.->|"manages users"| node_admin_users
node_admin_portal -.->|"manages drivers"| node_admin_drivers
node_applications -->|"submits via RPC"| node_supabase
node_web_auth -->|"authenticates"| node_firebase
node_firebase -->|"triggers identity hooks"| node_provisioning
node_provisioning -->|"upserts profile"| node_supabase
node_admin_restaurants -->|"renders in"| node_admin_portal
node_admin_orders -.->|"renders in"| node_admin_portal
node_admin_payments -.->|"renders in"| node_admin_portal
node_admin_users -.->|"renders in"| node_admin_portal
node_admin_drivers -.->|"renders in"| node_admin_portal

click node_mobile_entry "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/app/_layout.tsx"
click node_auth "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/app/(auth)/login.tsx"
click node_browse "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/app/(client)/(tabs)/index.tsx"
click node_restaurant_menu "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/app/(client)/restaurant/%5Bid%5D.tsx"
click node_cart "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/store/cartStore.ts"
click node_checkout "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/app/(client)/checkout.tsx"
click node_addresses "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/lib/addresses.ts"
click node_orders "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/lib/orders.ts"
click node_tracking "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/app/(client)/order/%5Bid%5D.tsx"
click node_driver_app "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/app/(driver)/order/%5Bid%5D.tsx"
click node_driver_location "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/lib/driverLocations.ts"
click node_reviews "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/app/(client)/order/review/%5Border_id%5D.tsx"
click node_mobile_profile "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/components/ProfileScreen.tsx"
click node_restaurant_portal "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/restaurant/layout.tsx"
click node_restaurant_menu_admin "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/restaurant/menu/actions.ts"
click node_restaurant_orders "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/restaurant/orders/page.tsx"
click node_admin_portal "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/admin/page.tsx"
click node_admin_restaurants "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/admin/restaurants/actions.ts"
click node_admin_orders "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/admin/orders/actions.ts"
click node_admin_payments "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/admin/payments/actions.ts"
click node_admin_users "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/admin/users/actions.ts"
click node_admin_drivers "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/admin/drivers/actions.ts"
click node_applications "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/actions/applications.ts"
click node_web_auth "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/utils/firebase/auth-client.ts"
click node_provisioning "https://github.com/joscar05-c/al-toque-delivery/blob/main/functions/src/index.ts"
click node_supabase "https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/utils/supabase/server.ts"
click node_shared_types "https://github.com/joscar05-c/al-toque-delivery/blob/main/packages/shared/types/database.types.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mobile_entry,node_auth,node_browse,node_restaurant_menu,node_cart,node_checkout,node_addresses,node_orders,node_tracking,node_driver_app,node_driver_location,node_reviews,node_mobile_profile toneBlue
class node_admin_portal,node_admin_restaurants,node_admin_orders,node_admin_payments,node_admin_users,node_admin_drivers,node_applications toneAmber
class node_restaurant_portal,node_restaurant_menu_admin,node_restaurant_orders toneMint
class node_web_auth,node_provisioning,node_firebase,node_supabase,node_shared_types toneRose
class node_customer toneIndigo
```

## Components

### Mobile app

- [App routing](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/app/_layout.tsx): `apps/mobile/src/app/_layout.tsx`
- [Sign-in and profile](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/app/(auth)/login.tsx): `apps/mobile/src/app/(auth)/login.tsx`
- [Restaurant discovery](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/app/(client)/(tabs)/index.tsx): `apps/mobile/src/app/(client)/(tabs)/index.tsx`
- [Restaurant menu](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/app/(client)/restaurant/%5Bid%5D.tsx): `apps/mobile/src/app/(client)/restaurant/[id].tsx`
- [Cart state](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/store/cartStore.ts): `apps/mobile/src/store/cartStore.ts`
- [Checkout](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/app/(client)/checkout.tsx): `apps/mobile/src/app/(client)/checkout.tsx`
- [Delivery addresses](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/lib/addresses.ts): `apps/mobile/src/lib/addresses.ts`
- [Order lifecycle](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/lib/orders.ts): `apps/mobile/src/lib/orders.ts`
- [Order tracking](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/app/(client)/order/%5Bid%5D.tsx): `apps/mobile/src/app/(client)/order/[id].tsx`
- [Driver workflow](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/app/(driver)/order/%5Bid%5D.tsx): `apps/mobile/src/app/(driver)/order/[id].tsx`
- [Driver location](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/lib/driverLocations.ts): `apps/mobile/src/lib/driverLocations.ts`
- [Order reviews](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/app/(client)/order/review/%5Border_id%5D.tsx): `apps/mobile/src/app/(client)/order/review/[order_id].tsx`
- [Profiles and applications](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/mobile/src/components/ProfileScreen.tsx): `apps/mobile/src/components/ProfileScreen.tsx`

### Admin operations

- [Admin console](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/admin/page.tsx): `apps/web-panel/app/admin/page.tsx`
- [Restaurant administration](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/admin/restaurants/actions.ts): `apps/web-panel/app/admin/restaurants/actions.ts`
- [Order administration](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/admin/orders/actions.ts): `apps/web-panel/app/admin/orders/actions.ts`
- [Payment review](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/admin/payments/actions.ts): `apps/web-panel/app/admin/payments/actions.ts`
- [User administration](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/admin/users/actions.ts): `apps/web-panel/app/admin/users/actions.ts`
- [Driver administration](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/admin/drivers/actions.ts): `apps/web-panel/app/admin/drivers/actions.ts`
- [Partner applications](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/actions/applications.ts): `apps/web-panel/app/actions/applications.ts`

### Restaurant operations

- [Restaurant portal](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/restaurant/layout.tsx): `apps/web-panel/app/restaurant/layout.tsx`
- [Menu management](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/restaurant/menu/actions.ts): `apps/web-panel/app/restaurant/menu/actions.ts`
- [Order board](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/app/restaurant/orders/page.tsx): `apps/web-panel/app/restaurant/orders/page.tsx`

### Identity and data

- [Web phone auth](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/utils/firebase/auth-client.ts): `apps/web-panel/utils/firebase/auth-client.ts`
- [Profile provisioning](https://github.com/joscar05-c/al-toque-delivery/blob/main/functions/src/index.ts): `functions/src/index.ts`
- **Firebase identity**
- [Supabase data](https://github.com/joscar05-c/al-toque-delivery/blob/main/apps/web-panel/utils/supabase/server.ts): `apps/web-panel/utils/supabase/server.ts`
- [Database schema types](https://github.com/joscar05-c/al-toque-delivery/blob/main/packages/shared/types/database.types.ts): `packages/shared/types/database.types.ts`

### Other components

- **Customer**

## Connections

- Customer → App routing: opens app
- App routing → Sign-in and profile: routes
- Customer → Restaurant discovery: browses
- Restaurant discovery → Restaurant menu: selects restaurant
- Customer → Checkout: places order
- Checkout → Database schema types: uses types (evidence: `apps/mobile/src/app/(client)/checkout.tsx`)
- Customer → Order tracking: tracks order
- Driver workflow → Driver location: updates location
- Customer → Profiles and applications: manages profile
- Profiles and applications → Partner applications: submits applications
- Restaurant portal → Menu management: manages menu
- Restaurant portal → Order board: handles orders
- Admin console → Restaurant administration: administers restaurants
- Admin console → Order administration: manages orders
- Admin console → Payment review: reviews payments
- Admin console → User administration: manages users
- Admin console → Driver administration: manages drivers
- Partner applications → Supabase data: submits via RPC (evidence: `apps/web-panel/app/actions/applications.ts`)
- Web phone auth → Firebase identity: authenticates (evidence: `apps/web-panel/utils/firebase/auth-client.ts`)
- Firebase identity → Profile provisioning: triggers identity hooks (evidence: `functions/src/index.ts`)
- Profile provisioning → Supabase data: upserts profile (evidence: `functions/src/index.ts`)
- Restaurant administration → Admin console: renders in
- Order administration → Admin console: renders in
- Payment review → Admin console: renders in
- User administration → Admin console: renders in
- Driver administration → Admin console: renders in
