# reyneilrodelas/our-system- architecture

> Architecture diagram of the GitHub repository reyneilrodelas/our-system-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/reyneilrodelas/our-system-
- Repository: https://github.com/reyneilrodelas/our-system-

## Overview

ScanWizard is a React Native product-locator app for shoppers and store operators. The shopper flow starts in the app’s navigation, scans or searches for a product, then views product results and nearby stores on a map; the README describes barcode/QR scanning, distance filtering, and live location updates. Store-owner and admin screens cover inventory, store management, approvals, and notifications. Supabase provides the app’s backend integration, with local caching used by several screens. Some screen behavior is only documented or listed in the source index, so uncertain links are omitted.

Main entry points: [`src/lib/supabase.ts`](https://github.com/reyneilrodelas/our-system-/blob/main/src/lib/supabase.ts) (Supabase client), [`App.tsx`](https://github.com/reyneilrodelas/our-system-/blob/main/App.tsx) (Navigation), [`src/screens/components/ResultScreen.tsx`](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/components/ResultScreen.tsx) (Product results), [`src/screens/shared/scanner.tsx`](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/shared/scanner.tsx) (Barcode scanner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App navigation"]
  node_navigation["Navigation<br/>[App.tsx]"]
  node_startup["Startup<br/>[Startup.tsx]"]
end

subgraph group_shopper["Product discovery"]
  node_scanner["Barcode scanner<br/>[scanner.tsx]"]
  node_camera["Camera overlay<br/>[CameraOverlay.tsx]"]
  node_search["Product search<br/>[SearchScreen.tsx]"]
  node_result["Product results<br/>[ResultScreen.tsx]"]
  node_map["Nearby map<br/>[Maps.tsx]"]
  node_product_details["Store product details"]
  node_home["Home<br/>[HomeScreen.tsx]"]
end

subgraph group_stores["Store operations"]
  node_owner_stores["My stores<br/>[MyStoresScreen.tsx]"]
  node_store_details["Store details"]
  node_add_store["Create store"]
  node_add_product["Add product"]
  node_assign_products["Assign products"]
  node_manage_products["Manage products"]
end

subgraph group_identity["Accounts and admin"]
  node_admin_stores["Store approvals<br/>[AllStoreScreen.tsx]"]
  node_admin_dashboard["Admin dashboard<br/>[AdminDashboard.tsx]"]
  node_approval_queue["Approval review"]
  node_login["Sign in<br/>[LoginScreen.tsx]"]
  node_signup["Registration<br/>[SignupScreen.tsx]"]
  node_profile["User profile<br/>[ProfileScreen.tsx]"]
end

subgraph group_backend["Backend and utilities"]
  node_auth_context["Session and role<br/>[AuthContext.tsx]"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
  node_cache[("Local cache<br/>[cacheUtils.ts]")]
  node_email["Email notifications<br/>[emailConfig.ts]"]
  node_alerts["Styled alerts<br/>[StyledAlert.tsx]"]
end

node_user(("App user"))
node_supabase[("Supabase service")]
node_resend["Resend email API"]

node_user -->|"uses"| node_navigation
node_navigation -->|"starts"| node_startup
node_navigation -->|"routes to"| node_scanner
node_navigation -->|"routes to"| node_search
node_navigation -->|"routes to"| node_result
node_navigation -->|"routes to"| node_map
node_navigation -->|"routes to"| node_home
node_navigation -->|"routes to"| node_owner_stores
node_navigation -->|"routes to"| node_admin_dashboard
node_navigation -->|"routes to"| node_login
node_navigation -->|"routes to"| node_signup
node_scanner -->|"renders"| node_camera
node_scanner -.->|"finds product"| node_result
node_search -.->|"opens result"| node_result
node_result -.->|"shows nearby stores"| node_map
node_map -.->|"opens details"| node_product_details
node_search -->|"caches searches"| node_cache
node_search -.->|"queries products"| node_supabase_client
node_scanner -.->|"looks up codes"| node_supabase_client
node_result -.->|"loads availability"| node_supabase_client
node_map -.->|"loads store data"| node_supabase_client
node_owner_stores -.->|"opens store"| node_store_details
node_store_details -.->|"updates store"| node_supabase_client
node_store_details -->|"updates cache"| node_cache
node_add_store -.->|"creates store"| node_supabase_client
node_add_store -.->|"requests notification"| node_email
node_add_product -.->|"saves product"| node_supabase_client
node_assign_products -.->|"assigns products"| node_supabase_client
node_manage_products -.->|"manages products"| node_supabase_client
node_admin_stores -.->|"reviews stores"| node_supabase_client
node_admin_stores -->|"notifies owner"| node_email
node_admin_dashboard -.->|"loads dashboard"| node_supabase_client
node_approval_queue -.->|"reviews applications"| node_supabase_client
node_login -.->|"authenticates"| node_supabase_client
node_signup -.->|"registers account"| node_supabase_client
node_profile -.->|"loads profile"| node_supabase_client
node_auth_context -->|"loads session"| node_supabase_client
node_auth_context -->|"fetches profile"| node_supabase_client
node_supabase_client -->|"connects to"| node_supabase
node_email -->|"sends email"| node_resend
node_auth_context -->|"displays errors"| node_alerts

click node_navigation "https://github.com/reyneilrodelas/our-system-/blob/main/App.tsx"
click node_startup "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/auth/Startup.tsx"
click node_scanner "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/shared/scanner.tsx"
click node_camera "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/components/CameraOverlay.tsx"
click node_search "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/shared/SearchScreen.tsx"
click node_result "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/components/ResultScreen.tsx"
click node_map "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/components/Maps.tsx"
click node_product_details "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/components/StoreProductDetailsScreen.tsx"
click node_home "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/shared/HomeScreen.tsx"
click node_owner_stores "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/storeowner/MyStoresScreen.tsx"
click node_store_details "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/storeowner/StoreDetailsScreen.tsx"
click node_add_store "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/storeowner/CreateStroreScreen.tsx"
click node_add_product "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/storeowner/AddProductScreen.tsx"
click node_assign_products "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/storeowner/AssignProductsScreen.tsx"
click node_manage_products "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/storeowner/ManageProductScreen.tsx"
click node_admin_stores "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/admin/AllStoreScreen.tsx"
click node_admin_dashboard "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/admin/AdminDashboard.tsx"
click node_approval_queue "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/admin/AdminApprovalScreen.tsx"
click node_login "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/auth/LoginScreen.tsx"
click node_signup "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/auth/SignupScreen.tsx"
click node_profile "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/shared/ProfileScreen.tsx"
click node_auth_context "https://github.com/reyneilrodelas/our-system-/blob/main/src/context/AuthContext.tsx"
click node_supabase_client "https://github.com/reyneilrodelas/our-system-/blob/main/src/lib/supabase.ts"
click node_cache "https://github.com/reyneilrodelas/our-system-/blob/main/src/utils/cacheUtils.ts"
click node_email "https://github.com/reyneilrodelas/our-system-/blob/main/src/config/emailConfig.ts"
click node_alerts "https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/components/StyledAlert.tsx"

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_navigation,node_startup,node_user toneBlue
class node_scanner,node_camera,node_search,node_result,node_map,node_product_details,node_home,node_supabase toneAmber
class node_owner_stores,node_store_details,node_add_store,node_add_product,node_assign_products,node_manage_products,node_resend toneMint
class node_admin_stores,node_admin_dashboard,node_approval_queue,node_login,node_signup,node_profile toneRose
class node_auth_context,node_supabase_client,node_cache,node_email,node_alerts toneIndigo
```

## Components

### App navigation

- [Navigation](https://github.com/reyneilrodelas/our-system-/blob/main/App.tsx): `App.tsx`
- [Startup](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/auth/Startup.tsx): `src/screens/auth/Startup.tsx`

### Product discovery

- [Barcode scanner](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/shared/scanner.tsx): `src/screens/shared/scanner.tsx`
- [Camera overlay](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/components/CameraOverlay.tsx): `src/screens/components/CameraOverlay.tsx`
- [Product search](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/shared/SearchScreen.tsx): `src/screens/shared/SearchScreen.tsx`
- [Product results](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/components/ResultScreen.tsx): `src/screens/components/ResultScreen.tsx`
- [Nearby map](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/components/Maps.tsx): `src/screens/components/Maps.tsx`
- [Store product details](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/components/StoreProductDetailsScreen.tsx): `src/screens/components/StoreProductDetailsScreen.tsx`
- [Home](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/shared/HomeScreen.tsx): `src/screens/shared/HomeScreen.tsx`

### Store operations

- [My stores](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/storeowner/MyStoresScreen.tsx): `src/screens/storeowner/MyStoresScreen.tsx`
- [Store details](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/storeowner/StoreDetailsScreen.tsx): `src/screens/storeowner/StoreDetailsScreen.tsx`
- [Create store](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/storeowner/CreateStroreScreen.tsx): `src/screens/storeowner/CreateStroreScreen.tsx`
- [Add product](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/storeowner/AddProductScreen.tsx): `src/screens/storeowner/AddProductScreen.tsx`
- [Assign products](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/storeowner/AssignProductsScreen.tsx): `src/screens/storeowner/AssignProductsScreen.tsx`
- [Manage products](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/storeowner/ManageProductScreen.tsx): `src/screens/storeowner/ManageProductScreen.tsx`

### Accounts and admin

- [Store approvals](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/admin/AllStoreScreen.tsx): `src/screens/admin/AllStoreScreen.tsx`
- [Admin dashboard](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/admin/AdminDashboard.tsx): `src/screens/admin/AdminDashboard.tsx`
- [Approval review](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/admin/AdminApprovalScreen.tsx): `src/screens/admin/AdminApprovalScreen.tsx`
- [Sign in](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/auth/LoginScreen.tsx): `src/screens/auth/LoginScreen.tsx`
- [Registration](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/auth/SignupScreen.tsx): `src/screens/auth/SignupScreen.tsx`
- [User profile](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/shared/ProfileScreen.tsx): `src/screens/shared/ProfileScreen.tsx`

### Backend and utilities

- [Session and role](https://github.com/reyneilrodelas/our-system-/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Supabase client](https://github.com/reyneilrodelas/our-system-/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Local cache](https://github.com/reyneilrodelas/our-system-/blob/main/src/utils/cacheUtils.ts): `src/utils/cacheUtils.ts`
- [Email notifications](https://github.com/reyneilrodelas/our-system-/blob/main/src/config/emailConfig.ts): `src/config/emailConfig.ts`
- [Styled alerts](https://github.com/reyneilrodelas/our-system-/blob/main/src/screens/components/StyledAlert.tsx): `src/screens/components/StyledAlert.tsx`

### Other components

- **App user**
- **Supabase service**
- **Resend email API**

## Connections

- App user → Navigation: uses
- Navigation → Startup: starts (evidence: `App.tsx`)
- Navigation → Barcode scanner: routes to (evidence: `App.tsx`)
- Navigation → Product search: routes to (evidence: `App.tsx`)
- Navigation → Product results: routes to (evidence: `App.tsx`)
- Navigation → Nearby map: routes to (evidence: `App.tsx`)
- Navigation → Home: routes to (evidence: `App.tsx`)
- Navigation → My stores: routes to (evidence: `App.tsx`)
- Navigation → Admin dashboard: routes to (evidence: `App.tsx`)
- Navigation → Sign in: routes to (evidence: `App.tsx`)
- Navigation → Registration: routes to (evidence: `App.tsx`)
- Barcode scanner → Camera overlay: renders (evidence: `src/screens/shared/scanner.tsx`)
- Barcode scanner → Product results: finds product
- Product search → Product results: opens result
- Product results → Nearby map: shows nearby stores
- Nearby map → Store product details: opens details
- Product search → Local cache: caches searches (evidence: `src/screens/shared/SearchScreen.tsx`)
- Product search → Supabase client: queries products (evidence: `src/screens/shared/SearchScreen.tsx`)
- Barcode scanner → Supabase client: looks up codes (evidence: `src/screens/shared/scanner.tsx`)
- Product results → Supabase client: loads availability (evidence: `src/screens/components/ResultScreen.tsx`)
- Nearby map → Supabase client: loads store data (evidence: `src/screens/components/Maps.tsx`)
- My stores → Store details: opens store
- Store details → Supabase client: updates store (evidence: `src/screens/storeowner/StoreDetailsScreen.tsx`)
- Store details → Local cache: updates cache (evidence: `src/screens/storeowner/StoreDetailsScreen.tsx`)
- Create store → Supabase client: creates store
- Create store → Email notifications: requests notification (evidence: `src/config/emailConfig.ts`)
- Add product → Supabase client: saves product (evidence: `src/screens/storeowner/AddProductScreen.tsx`)
- Assign products → Supabase client: assigns products (evidence: `src/screens/storeowner/AssignProductsScreen.tsx`)
- Manage products → Supabase client: manages products (evidence: `src/screens/storeowner/ManageProductScreen.tsx`)
- Store approvals → Supabase client: reviews stores (evidence: `src/screens/admin/AllStoreScreen.tsx`)
- Store approvals → Email notifications: notifies owner (evidence: `src/screens/admin/AllStoreScreen.tsx`)
- Admin dashboard → Supabase client: loads dashboard (evidence: `src/screens/admin/AdminDashboard.tsx`)
- Approval review → Supabase client: reviews applications (evidence: `src/screens/admin/AdminApprovalScreen.tsx`)
- Sign in → Supabase client: authenticates (evidence: `src/screens/auth/LoginScreen.tsx`)
- Registration → Supabase client: registers account (evidence: `src/screens/auth/SignupScreen.tsx`)
- User profile → Supabase client: loads profile (evidence: `src/screens/shared/ProfileScreen.tsx`)
- Session and role → Supabase client: loads session (evidence: `src/context/AuthContext.tsx`)
- Session and role → Supabase client: fetches profile (evidence: `src/context/AuthContext.tsx`)
- Supabase client → Supabase service: connects to (evidence: `src/lib/supabase.ts`)
- Email notifications → Resend email API: sends email (evidence: `src/config/emailConfig.ts`)
- Session and role → Styled alerts: displays errors (evidence: `src/context/AuthContext.tsx`)
