# mielglitx/lokalex-complete-tool-kit architecture

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

- Interactive diagram: https://gitdiagram.com/mielglitx/lokalex-complete-tool-kit
- Repository: https://github.com/mielglitx/lokalex-complete-tool-kit

## Overview

Lokalex is a role-based delivery and store-operations web app. Its user journey begins with role/session routing, then leads customers to browse stores and place orders, merchants to manage store operations, and riders/admins to coordinate delivery and staffing. Shared real-time data, offline persistence, and communications support these workflows. The README is empty; the graph uses the source index and excerpts provided, so it includes documented feature areas but omits unverified internal call chains.

Main entry points: [`src/app/appBootstrap.js`](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/app/appBootstrap.js) (Bootstrap and routing), [`src/config/firebase.js`](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/config/firebase.js) (Firebase data proxy), [`src/features/roster/rosterAccounts.js`](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/roster/rosterAccounts.js) (Rider roster), [`src/store/state.js`](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/store/state.js) (Shared app state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App foundation"]
  node_bootstrap["Bootstrap and routing<br/>[appBootstrap.js]"]
  node_listeners["Realtime listeners<br/>[appListeners.js]"]
  node_monitors["App monitors<br/>[appMonitors.js]"]
  node_push["Push notifications<br/>[appPush.js]"]
  node_auth["Role authentication<br/>[authUtils.js]"]
  node_notifications["Notifications and modals<br/>[notifications.js]"]
  node_router["View router<br/>[router.js]"]
end

subgraph group_commerce["Customer commerce"]
  node_customer["Storefront and orders"]
  node_catalog["Customer menu catalog"]
  node_cart["Cart and checkout<br/>[cart.js]"]
  node_wizard["Order wizard<br/>[wizard.js]"]
end

subgraph group_operations["Store and rider operations"]
  node_directory["Store directory<br/>[directoryUi.js]"]
  node_storehub["Merchant store hub<br/>[storeMenu.js]"]
  node_roster["Rider roster<br/>[rosterAccounts.js]"]
  node_commission["Commissions<br/>[commissionUI.js]"]
  node_advanced["Advanced orders"]
end

subgraph group_coordination["Delivery coordination"]
  node_maps["Maps and tracking<br/>[maps.js]"]
  node_tracker["Live tracker<br/>[liveTracker.js]"]
  node_chat["Chat and team comms<br/>[index.js]"]
end

subgraph group_platform["Shared services"]
  node_state["Shared app state<br/>[state.js]"]
  node_firebase["Firebase data proxy<br/>[firebase.js]"]
  node_idb[("Offline storage<br/>[storageEngine.js]")]
end

node_user(("App users"))
node_firebase_service[("Firebase service")]

node_user -->|"opens app"| node_bootstrap
node_bootstrap -->|"routes views"| node_router
node_bootstrap -->|"loads public catalog"| node_catalog
node_bootstrap -->|"starts monitors"| node_monitors
node_bootstrap -->|"registers push"| node_push
node_bootstrap -->|"loads cached roster"| node_roster
node_bootstrap -->|"uses app state"| node_state
node_listeners -->|"subscribes to data"| node_firebase
node_listeners -->|"listens for swaps"| node_roster
node_listeners -->|"alerts blocked users"| node_notifications
node_firebase -->|"syncs data"| node_firebase_service
node_firebase -.->|"queues offline writes"| node_idb
node_directory -->|"persists directory cache"| node_idb
node_customer -->|"uses shared state"| node_state
node_chat -->|"uses shared state"| node_state
node_roster -->|"uses shared state"| node_state
node_storehub -->|"uses shared state"| node_state
node_auth -->|"authenticates users"| node_firebase
node_customer -->|"loads storefront data"| node_firebase
node_roster -->|"manages roster data"| node_firebase
node_chat -->|"checks booking limits"| node_roster
node_router -->|"shows access alerts"| node_notifications
node_storehub -->|"previews menu"| node_customer

click node_bootstrap "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/app/appBootstrap.js"
click node_listeners "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/app/appListeners.js"
click node_monitors "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/app/appMonitors.js"
click node_push "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/app/appPush.js"
click node_state "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/store/state.js"
click node_firebase "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/config/firebase.js"
click node_idb "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/utils/storageEngine.js"
click node_customer "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/customer/customerStorefront.js"
click node_catalog "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/customer/customerMenuCatalog.js"
click node_cart "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/cart.js"
click node_wizard "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/wizard.js"
click node_auth "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/auth/authUtils.js"
click node_directory "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/directory/directoryUi.js"
click node_storehub "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/storeHub/storeMenu.js"
click node_roster "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/roster/rosterAccounts.js"
click node_commission "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/commission/commissionUI.js"
click node_advanced "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/advancedOrders/advancedOrdersUI.js"
click node_maps "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/maps.js"
click node_tracker "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/liveTracker.js"
click node_chat "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/chat/index.js"
click node_notifications "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/ui/notifications.js"
click node_router "https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/ui/router.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_bootstrap,node_listeners,node_monitors,node_push,node_auth,node_notifications,node_router,node_user toneBlue
class node_customer,node_catalog,node_cart,node_wizard,node_firebase_service toneAmber
class node_directory,node_storehub,node_roster,node_commission,node_advanced toneMint
class node_maps,node_tracker,node_chat toneRose
class node_state,node_firebase,node_idb toneIndigo
```

## Components

### App foundation

- [Bootstrap and routing](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/app/appBootstrap.js): `src/app/appBootstrap.js`
- [Realtime listeners](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/app/appListeners.js): `src/app/appListeners.js`
- [App monitors](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/app/appMonitors.js): `src/app/appMonitors.js`
- [Push notifications](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/app/appPush.js): `src/app/appPush.js`
- [Role authentication](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/auth/authUtils.js): `src/features/auth/authUtils.js`
- [Notifications and modals](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/ui/notifications.js): `src/ui/notifications.js`
- [View router](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/ui/router.js): `src/ui/router.js`

### Customer commerce

- [Storefront and orders](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/customer/customerStorefront.js): `src/features/customer/customerStorefront.js`
- [Customer menu catalog](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/customer/customerMenuCatalog.js): `src/features/customer/customerMenuCatalog.js`
- [Cart and checkout](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/cart.js): `src/features/cart.js`
- [Order wizard](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/wizard.js): `src/features/wizard.js`

### Store and rider operations

- [Store directory](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/directory/directoryUi.js): `src/features/directory/directoryUi.js`
- [Merchant store hub](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/storeHub/storeMenu.js): `src/features/storeHub/storeMenu.js`
- [Rider roster](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/roster/rosterAccounts.js): `src/features/roster/rosterAccounts.js`
- [Commissions](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/commission/commissionUI.js): `src/features/commission/commissionUI.js`
- [Advanced orders](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/advancedOrders/advancedOrdersUI.js): `src/features/advancedOrders/advancedOrdersUI.js`

### Delivery coordination

- [Maps and tracking](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/maps.js): `src/features/maps.js`
- [Live tracker](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/liveTracker.js): `src/features/liveTracker.js`
- [Chat and team comms](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/features/chat/index.js): `src/features/chat/index.js`

### Shared services

- [Shared app state](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/store/state.js): `src/store/state.js`
- [Firebase data proxy](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/config/firebase.js): `src/config/firebase.js`
- [Offline storage](https://github.com/mielglitx/lokalex-complete-tool-kit/blob/main/src/utils/storageEngine.js): `src/utils/storageEngine.js`

### Other components

- **App users**
- **Firebase service**

## Connections

- App users → Bootstrap and routing: opens app (evidence: `src/app/appBootstrap.js`)
- Bootstrap and routing → View router: routes views (evidence: `src/app/appBootstrap.js`)
- Bootstrap and routing → Customer menu catalog: loads public catalog (evidence: `src/app/appBootstrap.js`)
- Bootstrap and routing → App monitors: starts monitors (evidence: `src/app/appBootstrap.js`)
- Bootstrap and routing → Push notifications: registers push (evidence: `src/app/appBootstrap.js`)
- Bootstrap and routing → Rider roster: loads cached roster (evidence: `src/app/appBootstrap.js`)
- Bootstrap and routing → Shared app state: uses app state (evidence: `src/app/appBootstrap.js`)
- Realtime listeners → Firebase data proxy: subscribes to data (evidence: `src/app/appListeners.js`)
- Realtime listeners → Rider roster: listens for swaps (evidence: `src/app/appListeners.js`)
- Realtime listeners → Notifications and modals: alerts blocked users (evidence: `src/app/appListeners.js`)
- Firebase data proxy → Firebase service: syncs data (evidence: `src/config/firebase.js`)
- Firebase data proxy → Offline storage: queues offline writes
- Store directory → Offline storage: persists directory cache
- Storefront and orders → Shared app state: uses shared state (evidence: `src/features/customer/customerStorefront.js`)
- Chat and team comms → Shared app state: uses shared state (evidence: `src/features/chat/index.js`)
- Rider roster → Shared app state: uses shared state (evidence: `src/features/roster/rosterAccounts.js`)
- Merchant store hub → Shared app state: uses shared state
- Role authentication → Firebase data proxy: authenticates users (evidence: `src/features/auth/authCustomer.js`)
- Storefront and orders → Firebase data proxy: loads storefront data (evidence: `src/features/customer/customerStorefront.js`)
- Rider roster → Firebase data proxy: manages roster data (evidence: `src/features/roster/rosterAccounts.js`)
- Chat and team comms → Rider roster: checks booking limits (evidence: `src/features/chat/index.js`)
- View router → Notifications and modals: shows access alerts (evidence: `src/ui/router.js`)
- Merchant store hub → Storefront and orders: previews menu
