# afxs1114/lods-mobile architecture

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

- Interactive diagram: https://gitdiagram.com/afxs1114/lods-mobile
- Repository: https://github.com/afxs1114/lods-mobile

## Overview

LODS is a role-based delivery companion for clients, merchants, and riders. Users sign in or register, after which App routes them to a role-specific workspace. The client workflow covers creating an order and tracking/rating it; merchants manage menus and orders, while riders handle assigned deliveries. Screens share Supabase-backed authentication and data access, with push-notification support. The excerpts establish navigation, session handling, and selected screen capabilities; several screen implementations are indexed but not sampled, so uncertain calls between those features are omitted.

Main entry points: [`shared/supabase.js`](https://github.com/afxs1114/lods-mobile/blob/main/shared/supabase.js) (Supabase service), [`App.js`](https://github.com/afxs1114/lods-mobile/blob/main/App.js) (Role router), [`navigation/ClientStack.js`](https://github.com/afxs1114/lods-mobile/blob/main/navigation/ClientStack.js) (Client tabs), [`navigation/MerchantStack.js`](https://github.com/afxs1114/lods-mobile/blob/main/navigation/MerchantStack.js) (Merchant stack)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and navigation"]
  node_app["Role router<br/>[App.js]"]
  node_authnav["Auth navigation<br/>[AuthStack.js]"]
  node_clientnav["Client tabs<br/>[ClientStack.js]"]
  node_merchantnav["Merchant stack<br/>[MerchantStack.js]"]
  node_ridernav["Rider stack<br/>[RiderStack.js]"]
end

subgraph group_identity["Identity and shared services"]
  node_login["Sign in and signup<br/>[LoginScreen.js]"]
  node_auth["Session and profiles<br/>[AuthContext.js]"]
  node_backend["Supabase service<br/>[supabase.js]"]
  node_push["Push notifications"]
end

subgraph group_client["Client workflow"]
  node_clientorder["Place order"]
  node_clientprogress["Track and rate"]
  node_clientprofile["Client profile"]
end

subgraph group_merchant["Merchant operations"]
  node_merchantdash["Merchant dashboard"]
  node_merchantmenu["Menu management"]
  node_merchantprofile["Merchant profile"]
end

subgraph group_rider["Rider operations"]
  node_riderdash["Rider dashboard"]
  node_riderorders["Delivery orders"]
  node_riderprofile["Rider profile"]
end

node_user(("App user"))

node_user -->|"opens app"| node_app
node_app -->|"reads session"| node_auth
node_app -->|"routes signed-out"| node_authnav
node_app -->|"routes client"| node_clientnav
node_app -->|"routes merchant"| node_merchantnav
node_app -->|"routes rider"| node_ridernav
node_authnav -->|"shows login"| node_login
node_clientnav -->|"shows tab"| node_clientorder
node_clientnav -->|"shows tab"| node_clientprogress
node_clientnav -->|"shows tab"| node_clientprofile
node_login -->|"authenticates"| node_auth
node_login -->|"registers token"| node_push
node_auth -->|"reads auth and profiles"| node_backend
node_clientorder -->|"reads and writes"| node_backend
node_clientprogress -->|"loads orders"| node_backend
node_clientprofile -->|"updates profile"| node_backend
node_merchantnav -->|"shows screen"| node_merchantdash
node_merchantnav -->|"shows screen"| node_merchantmenu
node_merchantnav -->|"shows screen"| node_merchantprofile
node_merchantdash -->|"uses data service"| node_backend
node_merchantmenu -->|"manages menu"| node_backend
node_merchantprofile -->|"uses user context"| node_auth
node_ridernav -->|"shows screen"| node_riderdash
node_ridernav -->|"shows screen"| node_riderorders
node_ridernav -->|"shows screen"| node_riderprofile
node_riderdash -->|"uses data service"| node_backend
node_riderorders -->|"updates deliveries"| node_backend
node_riderorders -->|"uses notifications"| node_push
node_riderprofile -->|"uses data service"| node_backend
node_push -->|"saves push token"| node_backend

click node_app "https://github.com/afxs1114/lods-mobile/blob/main/App.js"
click node_authnav "https://github.com/afxs1114/lods-mobile/blob/main/navigation/AuthStack.js"
click node_clientnav "https://github.com/afxs1114/lods-mobile/blob/main/navigation/ClientStack.js"
click node_merchantnav "https://github.com/afxs1114/lods-mobile/blob/main/navigation/MerchantStack.js"
click node_ridernav "https://github.com/afxs1114/lods-mobile/blob/main/navigation/RiderStack.js"
click node_login "https://github.com/afxs1114/lods-mobile/blob/main/screens/LoginScreen.js"
click node_auth "https://github.com/afxs1114/lods-mobile/blob/main/shared/AuthContext.js"
click node_backend "https://github.com/afxs1114/lods-mobile/blob/main/shared/supabase.js"
click node_push "https://github.com/afxs1114/lods-mobile/blob/main/shared/notificationService.js"
click node_clientorder "https://github.com/afxs1114/lods-mobile/blob/main/screens/client/ClientOrderScreen.js"
click node_clientprogress "https://github.com/afxs1114/lods-mobile/blob/main/screens/client/ClientProgressScreen.js"
click node_clientprofile "https://github.com/afxs1114/lods-mobile/blob/main/screens/client/ClientProfileScreen.js"
click node_merchantdash "https://github.com/afxs1114/lods-mobile/blob/main/screens/merchant/MerchantDashboardScreen.js"
click node_merchantmenu "https://github.com/afxs1114/lods-mobile/blob/main/screens/merchant/MerchantMenuScreen.js"
click node_merchantprofile "https://github.com/afxs1114/lods-mobile/blob/main/screens/merchant/MerchantProfileScreen.js"
click node_riderdash "https://github.com/afxs1114/lods-mobile/blob/main/screens/rider/RiderDashboardScreen.js"
click node_riderorders "https://github.com/afxs1114/lods-mobile/blob/main/screens/rider/RiderOrdersScreen.js"
click node_riderprofile "https://github.com/afxs1114/lods-mobile/blob/main/screens/rider/RiderProfileScreen.js"

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_app,node_authnav,node_clientnav,node_merchantnav,node_ridernav,node_user toneBlue
class node_login,node_auth,node_backend,node_push toneAmber
class node_clientorder,node_clientprogress,node_clientprofile toneMint
class node_merchantdash,node_merchantmenu,node_merchantprofile toneRose
class node_riderdash,node_riderorders,node_riderprofile toneIndigo
```

## Components

### App and navigation

- [Role router](https://github.com/afxs1114/lods-mobile/blob/main/App.js): `App.js`
- [Auth navigation](https://github.com/afxs1114/lods-mobile/blob/main/navigation/AuthStack.js): `navigation/AuthStack.js`
- [Client tabs](https://github.com/afxs1114/lods-mobile/blob/main/navigation/ClientStack.js): `navigation/ClientStack.js`
- [Merchant stack](https://github.com/afxs1114/lods-mobile/blob/main/navigation/MerchantStack.js): `navigation/MerchantStack.js`
- [Rider stack](https://github.com/afxs1114/lods-mobile/blob/main/navigation/RiderStack.js): `navigation/RiderStack.js`

### Identity and shared services

- [Sign in and signup](https://github.com/afxs1114/lods-mobile/blob/main/screens/LoginScreen.js): `screens/LoginScreen.js`
- [Session and profiles](https://github.com/afxs1114/lods-mobile/blob/main/shared/AuthContext.js): `shared/AuthContext.js`
- [Supabase service](https://github.com/afxs1114/lods-mobile/blob/main/shared/supabase.js): `shared/supabase.js`
- [Push notifications](https://github.com/afxs1114/lods-mobile/blob/main/shared/notificationService.js): `shared/notificationService.js`

### Client workflow

- [Place order](https://github.com/afxs1114/lods-mobile/blob/main/screens/client/ClientOrderScreen.js): `screens/client/ClientOrderScreen.js`
- [Track and rate](https://github.com/afxs1114/lods-mobile/blob/main/screens/client/ClientProgressScreen.js): `screens/client/ClientProgressScreen.js`
- [Client profile](https://github.com/afxs1114/lods-mobile/blob/main/screens/client/ClientProfileScreen.js): `screens/client/ClientProfileScreen.js`

### Merchant operations

- [Merchant dashboard](https://github.com/afxs1114/lods-mobile/blob/main/screens/merchant/MerchantDashboardScreen.js): `screens/merchant/MerchantDashboardScreen.js`
- [Menu management](https://github.com/afxs1114/lods-mobile/blob/main/screens/merchant/MerchantMenuScreen.js): `screens/merchant/MerchantMenuScreen.js`
- [Merchant profile](https://github.com/afxs1114/lods-mobile/blob/main/screens/merchant/MerchantProfileScreen.js): `screens/merchant/MerchantProfileScreen.js`

### Rider operations

- [Rider dashboard](https://github.com/afxs1114/lods-mobile/blob/main/screens/rider/RiderDashboardScreen.js): `screens/rider/RiderDashboardScreen.js`
- [Delivery orders](https://github.com/afxs1114/lods-mobile/blob/main/screens/rider/RiderOrdersScreen.js): `screens/rider/RiderOrdersScreen.js`
- [Rider profile](https://github.com/afxs1114/lods-mobile/blob/main/screens/rider/RiderProfileScreen.js): `screens/rider/RiderProfileScreen.js`

### Other components

- **App user**

## Connections

- App user → Role router: opens app (evidence: `App.js`)
- Role router → Session and profiles: reads session (evidence: `App.js`)
- Role router → Auth navigation: routes signed-out (evidence: `App.js`)
- Role router → Client tabs: routes client (evidence: `App.js`)
- Role router → Merchant stack: routes merchant (evidence: `App.js`)
- Role router → Rider stack: routes rider (evidence: `App.js`)
- Auth navigation → Sign in and signup: shows login (evidence: `navigation/AuthStack.js`)
- Client tabs → Place order: shows tab (evidence: `navigation/ClientStack.js`)
- Client tabs → Track and rate: shows tab (evidence: `navigation/ClientStack.js`)
- Client tabs → Client profile: shows tab (evidence: `navigation/ClientStack.js`)
- Sign in and signup → Session and profiles: authenticates (evidence: `screens/LoginScreen.js`)
- Sign in and signup → Push notifications: registers token (evidence: `screens/LoginScreen.js`)
- Session and profiles → Supabase service: reads auth and profiles (evidence: `shared/AuthContext.js`)
- Place order → Supabase service: reads and writes (evidence: `screens/client/ClientOrderScreen.js`)
- Track and rate → Supabase service: loads orders (evidence: `screens/client/ClientProgressScreen.js`)
- Client profile → Supabase service: updates profile (evidence: `screens/client/ClientProfileScreen.js`)
- Merchant stack → Merchant dashboard: shows screen (evidence: `navigation/MerchantStack.js`)
- Merchant stack → Menu management: shows screen (evidence: `navigation/MerchantStack.js`)
- Merchant stack → Merchant profile: shows screen (evidence: `navigation/MerchantStack.js`)
- Merchant dashboard → Supabase service: uses data service (evidence: `screens/merchant/MerchantDashboardScreen.js`)
- Menu management → Supabase service: manages menu (evidence: `screens/merchant/MerchantMenuScreen.js`)
- Merchant profile → Session and profiles: uses user context (evidence: `screens/merchant/MerchantProfileScreen.js`)
- Rider stack → Rider dashboard: shows screen (evidence: `navigation/RiderStack.js`)
- Rider stack → Delivery orders: shows screen (evidence: `navigation/RiderStack.js`)
- Rider stack → Rider profile: shows screen (evidence: `navigation/RiderStack.js`)
- Rider dashboard → Supabase service: uses data service (evidence: `screens/rider/RiderDashboardScreen.js`)
- Delivery orders → Supabase service: updates deliveries (evidence: `screens/rider/RiderOrdersScreen.js`)
- Delivery orders → Push notifications: uses notifications (evidence: `screens/rider/RiderOrdersScreen.js`)
- Rider profile → Supabase service: uses data service (evidence: `screens/rider/RiderProfileScreen.js`)
- Push notifications → Supabase service: saves push token (evidence: `shared/notificationService.js`)
