# sabarees3578/inventory architecture

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

- Interactive diagram: https://gitdiagram.com/sabarees3578/inventory
- Repository: https://github.com/sabarees3578/inventory

## Overview

#### Purpose and Entry Points
This is an Expo/React Native inventory application focused on stock records, project-based inventory work, imports, barcode display, and item verification. The JavaScript bootstrap is `index.js`, which loads the root application component in `App.js`. Expo application metadata and build configuration live in `app.json` and `eas.json`.

#### Application Shell and Navigation
`App.js` establishes the top-level runtime composition, while `src/navigation/AppNavigator.js` defines the screen-level control flow. Navigation separates major workflows: authentication, inventory/database browsing, imports, projects, and verification. Shared visual primitives—including the application header and status presentation—are in `src/components/AppHeader.js` and `src/components/StatusBadge.js`.

#### Authentication and Session Boundary
Authentication begins at `src/screens/auth/LoginScreen.js`. Firebase configuration in `src/firebase/config.js` is the likely remote identity and database integration boundary; environment values are expected via `.env.example`. Authenticated navigation should gate access to the inventory and project workflows rather than embedding access logic in individual screens.

#### Inventory Data Domain
The central inventory browsing/detail flow is represented by `src/screens/database/InventoryScreen.js`, `src/screens/database/StockListScreen.js`, and `src/screens/database/ItemDetailScreen.js`. Firestore collection naming/contracts are centralized in `src/firebase/collections.js`, creating a boundary between UI screens and remote data layout. Item identification is surfaced through `src/components/BarcodeDisplay.js`.

#### Project Workflow
Projects provide a higher-level container for inventory operations. `src/screens/projects/ProjectListScreen.js` lists accessible projects, `src/screens/projects/CreateProjectScreen.js` creates them, and `src/screens/projects/ProjectDashboardScreen.js` acts as the project-specific operational hub. This flow likely scopes subsequent stock, import, and verification activity to a selected project.

#### Import, Verification, and Output Pipelines
External stock ingestion has separate spreadsheet sources: `src/screens/import/ExcelImportScreen.js` uses `src/utils/excelParser.js`, while `src/screens/import/GoogleSheetImportScreen.js` handles Google Sheets input. Verification supports barcode scanning through `src/screens/verification/ScanVerifyScreen.js` and manual fallback through `src/screens/verification/ManualVerifyScreen.js`. Processed inventory can be exported through `src/utils/excelExporter.js` and `src/utils/pdfExporter.js`.

#### Offline Persistence and Infrastructure
Firebase is the principal backend integration, configured under `src/firebase/`. Local/offline state is handled by `src/storage/localStore.js` and `src/utils/offlineCache.js`, forming a client persistence boundary that can support cached reads or deferred synchronization. Shared design tokens in `src/constants/theme.js` keep UI styling consistent across the native screens.

Main entry points: [`src/navigation/AppNavigator.js`](https://github.com/sabarees3578/inventory/blob/main/src/navigation/AppNavigator.js) (Screen navigation), [`src/screens/projects/ProjectDashboardScreen.js`](https://github.com/sabarees3578/inventory/blob/main/src/screens/projects/ProjectDashboardScreen.js) (Project dashboard), [`src/screens/database/InventoryScreen.js`](https://github.com/sabarees3578/inventory/blob/main/src/screens/database/InventoryScreen.js) (Inventory browser), [`src/screens/projects/ProjectListScreen.js`](https://github.com/sabarees3578/inventory/blob/main/src/screens/projects/ProjectListScreen.js) (Project management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["App Runtime"]
  node_bootstrap["JavaScript bootstrap<br/>Expo entry<br/>[index.js]"]
  node_app["Application shell<br/>React Native root<br/>[App.js]"]
  node_navigator["Screen navigation<br/>navigator<br/>[AppNavigator.js]"]
end

subgraph group_backend["Data &amp; Session"]
  node_auth["Login<br/>auth screen<br/>[LoginScreen.js]"]
  node_firebase{{"Firebase integration<br/>backend client<br/>[config.js]"}}
  node_collections["Firestore contracts<br/>collection definitions<br/>[collections.js]"]
end

subgraph group_workflows["Inventory Workflows"]
  node_projects["Project management<br/>project screens"]
  node_project_create["Create project<br/>project screen"]
  node_project_dashboard["Project dashboard<br/>project hub"]
  node_inventory["Inventory browser<br/>inventory screen<br/>[InventoryScreen.js]"]
  node_stock_list["Stock list<br/>inventory screen<br/>[StockListScreen.js]"]
  node_item_detail["Item detail<br/>inventory screen"]
  node_barcode["Barcode display<br/>shared component<br/>[BarcodeDisplay.js]"]
  node_excel_import["Excel import<br/>import screen"]
  node_excel_parser["Spreadsheet parser<br/>import utility<br/>[excelParser.js]"]
  node_sheets_import["Google Sheets import<br/>import screen"]
  node_verification["Barcode verification<br/>verification screen"]
  node_manual_verify["Manual verification<br/>verification screen"]
end

subgraph group_persistence["Offline &amp; Output"]
  node_offline_store[("Offline persistence<br/>local cache<br/>[localStore.js]")]
  node_offline_cache["Offline cache logic<br/>cache utility<br/>[offlineCache.js]"]
  node_exports["Inventory exports<br/>output utilities<br/>[excelExporter.js]"]
end

node_bootstrap -->|"loads"| node_app
node_app -->|"hosts"| node_navigator
node_navigator -->|"unauthenticated route"| node_auth
node_auth -->|"signs in through"| node_firebase
node_navigator -->|"project workflow"| node_projects
node_navigator -->|"inventory workflow"| node_inventory
node_navigator -->|"import workflow"| node_excel_import
node_navigator -->|"verification workflow"| node_verification
node_projects -->|"creates"| node_project_create
node_projects -->|"selects"| node_project_dashboard
node_project_dashboard -->|"scopes operations"| node_inventory
node_inventory -->|"browses stock"| node_stock_list
node_stock_list -->|"opens item"| node_item_detail
node_item_detail -->|"displays identifier"| node_barcode
node_excel_import -->|"parses"| node_excel_parser
node_project_dashboard -->|"imports stock"| node_sheets_import
node_project_dashboard -->|"verifies stock"| node_verification
node_verification -.->|"manual fallback"| node_manual_verify
node_inventory -->|"uses contracts"| node_collections
node_collections -->|"maps to"| node_firebase
node_firebase -.->|"syncs with"| node_offline_cache
node_offline_cache -->|"persists"| node_offline_store
node_project_dashboard -->|"exports processed inventory"| node_exports

click node_bootstrap "https://github.com/sabarees3578/inventory/blob/main/index.js"
click node_app "https://github.com/sabarees3578/inventory/blob/main/App.js"
click node_navigator "https://github.com/sabarees3578/inventory/blob/main/src/navigation/AppNavigator.js"
click node_auth "https://github.com/sabarees3578/inventory/blob/main/src/screens/auth/LoginScreen.js"
click node_firebase "https://github.com/sabarees3578/inventory/blob/main/src/firebase/config.js"
click node_collections "https://github.com/sabarees3578/inventory/blob/main/src/firebase/collections.js"
click node_projects "https://github.com/sabarees3578/inventory/blob/main/src/screens/projects/ProjectListScreen.js"
click node_project_create "https://github.com/sabarees3578/inventory/blob/main/src/screens/projects/CreateProjectScreen.js"
click node_project_dashboard "https://github.com/sabarees3578/inventory/blob/main/src/screens/projects/ProjectDashboardScreen.js"
click node_inventory "https://github.com/sabarees3578/inventory/blob/main/src/screens/database/InventoryScreen.js"
click node_stock_list "https://github.com/sabarees3578/inventory/blob/main/src/screens/database/StockListScreen.js"
click node_item_detail "https://github.com/sabarees3578/inventory/blob/main/src/screens/database/ItemDetailScreen.js"
click node_barcode "https://github.com/sabarees3578/inventory/blob/main/src/components/BarcodeDisplay.js"
click node_excel_import "https://github.com/sabarees3578/inventory/blob/main/src/screens/import/ExcelImportScreen.js"
click node_excel_parser "https://github.com/sabarees3578/inventory/blob/main/src/utils/excelParser.js"
click node_sheets_import "https://github.com/sabarees3578/inventory/blob/main/src/screens/import/GoogleSheetImportScreen.js"
click node_verification "https://github.com/sabarees3578/inventory/blob/main/src/screens/verification/ScanVerifyScreen.js"
click node_manual_verify "https://github.com/sabarees3578/inventory/blob/main/src/screens/verification/ManualVerifyScreen.js"
click node_offline_store "https://github.com/sabarees3578/inventory/blob/main/src/storage/localStore.js"
click node_offline_cache "https://github.com/sabarees3578/inventory/blob/main/src/utils/offlineCache.js"
click node_exports "https://github.com/sabarees3578/inventory/blob/main/src/utils/excelExporter.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_app,node_navigator toneBlue
class node_auth,node_firebase,node_collections toneAmber
class node_projects,node_project_create,node_project_dashboard,node_inventory,node_stock_list,node_item_detail,node_barcode,node_excel_import,node_excel_parser,node_sheets_import,node_verification,node_manual_verify toneMint
class node_offline_store,node_offline_cache,node_exports toneRose
```

## Components

### App Runtime

- [JavaScript bootstrap](https://github.com/sabarees3578/inventory/blob/main/index.js): Expo entry · `index.js`
- [Application shell](https://github.com/sabarees3578/inventory/blob/main/App.js): React Native root · `App.js`
- [Screen navigation](https://github.com/sabarees3578/inventory/blob/main/src/navigation/AppNavigator.js): navigator · Gates and routes major application workflows. · `src/navigation/AppNavigator.js`

### Data & Session

- [Login](https://github.com/sabarees3578/inventory/blob/main/src/screens/auth/LoginScreen.js): auth screen · `src/screens/auth/LoginScreen.js`
- [Firebase integration](https://github.com/sabarees3578/inventory/blob/main/src/firebase/config.js): backend client · Identity and Firestore integration boundary. · `src/firebase/config.js`
- [Firestore contracts](https://github.com/sabarees3578/inventory/blob/main/src/firebase/collections.js): collection definitions · `src/firebase/collections.js`

### Inventory Workflows

- [Project management](https://github.com/sabarees3578/inventory/blob/main/src/screens/projects/ProjectListScreen.js): project screens · Lists and creates accessible inventory projects. · `src/screens/projects/ProjectListScreen.js`
- [Create project](https://github.com/sabarees3578/inventory/blob/main/src/screens/projects/CreateProjectScreen.js): project screen · `src/screens/projects/CreateProjectScreen.js`
- [Project dashboard](https://github.com/sabarees3578/inventory/blob/main/src/screens/projects/ProjectDashboardScreen.js): project hub · Scopes operational inventory activity to a selected project. · `src/screens/projects/ProjectDashboardScreen.js`
- [Inventory browser](https://github.com/sabarees3578/inventory/blob/main/src/screens/database/InventoryScreen.js): inventory screen · `src/screens/database/InventoryScreen.js`
- [Stock list](https://github.com/sabarees3578/inventory/blob/main/src/screens/database/StockListScreen.js): inventory screen · `src/screens/database/StockListScreen.js`
- [Item detail](https://github.com/sabarees3578/inventory/blob/main/src/screens/database/ItemDetailScreen.js): inventory screen · `src/screens/database/ItemDetailScreen.js`
- [Barcode display](https://github.com/sabarees3578/inventory/blob/main/src/components/BarcodeDisplay.js): shared component · `src/components/BarcodeDisplay.js`
- [Excel import](https://github.com/sabarees3578/inventory/blob/main/src/screens/import/ExcelImportScreen.js): import screen · `src/screens/import/ExcelImportScreen.js`
- [Spreadsheet parser](https://github.com/sabarees3578/inventory/blob/main/src/utils/excelParser.js): import utility · `src/utils/excelParser.js`
- [Google Sheets import](https://github.com/sabarees3578/inventory/blob/main/src/screens/import/GoogleSheetImportScreen.js): import screen · `src/screens/import/GoogleSheetImportScreen.js`
- [Barcode verification](https://github.com/sabarees3578/inventory/blob/main/src/screens/verification/ScanVerifyScreen.js): verification screen · `src/screens/verification/ScanVerifyScreen.js`
- [Manual verification](https://github.com/sabarees3578/inventory/blob/main/src/screens/verification/ManualVerifyScreen.js): verification screen · `src/screens/verification/ManualVerifyScreen.js`

### Offline & Output

- [Offline persistence](https://github.com/sabarees3578/inventory/blob/main/src/storage/localStore.js): local cache · Supports cached reads or deferred synchronization. · `src/storage/localStore.js`
- [Offline cache logic](https://github.com/sabarees3578/inventory/blob/main/src/utils/offlineCache.js): cache utility · `src/utils/offlineCache.js`
- [Inventory exports](https://github.com/sabarees3578/inventory/blob/main/src/utils/excelExporter.js): output utilities · Generates spreadsheet and PDF output. · `src/utils/excelExporter.js`

## Connections

- JavaScript bootstrap → Application shell: loads
- Application shell → Screen navigation: hosts
- Screen navigation → Login: unauthenticated route
- Login → Firebase integration: signs in through
- Screen navigation → Project management: project workflow
- Screen navigation → Inventory browser: inventory workflow
- Screen navigation → Excel import: import workflow
- Screen navigation → Barcode verification: verification workflow
- Project management → Create project: creates
- Project management → Project dashboard: selects
- Project dashboard → Inventory browser: scopes operations
- Inventory browser → Stock list: browses stock
- Stock list → Item detail: opens item
- Item detail → Barcode display: displays identifier
- Excel import → Spreadsheet parser: parses
- Project dashboard → Google Sheets import: imports stock
- Project dashboard → Barcode verification: verifies stock
- Barcode verification → Manual verification: manual fallback
- Inventory browser → Firestore contracts: uses contracts
- Firestore contracts → Firebase integration: maps to
- Firebase integration → Offline cache logic: syncs with
- Offline cache logic → Offline persistence: persists
- Project dashboard → Inventory exports: exports processed inventory
