# tanto0366/inventory-os architecture

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

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

## Overview

InventoryOS is a browser-based inventory and logistics system whose main workflow manages assets, issues gate passes, tracks resulting shipments, and records activity. The React app coordinates these operational views and synchronizes data with Google Sheets, with Firebase-backed sign-in and role checks. The graph also captures campaign, administration, and spreadsheet-import capabilities documented in the README. App and integration code excerpts are partial, so uncertain component-to-handler wiring is omitted.

Main entry points: [`src/App.tsx`](https://github.com/tanto0366/inventory-os/blob/main/src/App.tsx) (Application coordinator), [`src/lib/googleSheets.ts`](https://github.com/tanto0366/inventory-os/blob/main/src/lib/googleSheets.ts) (Sheets integration), [`src/domain/transactions.ts`](https://github.com/tanto0366/inventory-os/blob/main/src/domain/transactions.ts) (Movement transactions), [`src/services/importTemplateService.ts`](https://github.com/tanto0366/inventory-os/blob/main/src/services/importTemplateService.ts) (Inventory import)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operations["Inventory operations"]
  node_app["Application coordinator<br/>[App.tsx]"]
  node_assets["Asset management<br/>[AssetsView.tsx]"]
  node_gatepasses["Gate pass issuance<br/>[GatePassesView.tsx]"]
  node_shipments["Shipment tracking<br/>[ShipmentsView.tsx]"]
  node_manifest["Pass manifests"]
  node_campaigns["Campaign deployment<br/>[CampaignsView.tsx]"]
  node_dashboard["Operations dashboard<br/>[DashboardView.tsx]"]
  node_import["Inventory import"]
end

subgraph group_access["Access and oversight"]
  node_auditview["Audit activity<br/>[AuditTrailView.tsx]"]
  node_adminview["Admin console"]
  node_auth["Role authorization<br/>[auth.ts]"]
  node_auditservice["Audit event creation<br/>[auditService.ts]"]
end

subgraph group_integration["Data integration"]
  node_syncstatus["Sync status<br/>[SyncStatus.tsx]"]
  node_sheets["Sheets integration<br/>[googleSheets.ts]"]
  node_firebase["Firebase authentication<br/>[firebase.ts]"]
end

subgraph group_domain["Domain services"]
  node_transactions["Movement transactions<br/>[transactions.ts]"]
  node_state["Shipment state rules<br/>[stateMachine.ts]"]
  node_validation["Input validation<br/>[validation.ts]"]
  node_identity["Identifier generation<br/>[identity.ts]"]
  node_assetutils["Asset utilities<br/>[assetUtils.ts]"]
  node_config["Runtime configuration<br/>[configService.ts]"]
end

node_user(("Staff user"))
node_google[("Google Sheets service")]
node_browser[("Browser local storage")]

node_user -->|"uses"| node_app
node_app -->|"renders"| node_assets
node_app -->|"renders"| node_gatepasses
node_app -->|"renders"| node_shipments
node_app -->|"renders"| node_campaigns
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_auditview
node_app -->|"renders"| node_adminview
node_app -->|"renders"| node_syncstatus
node_app -->|"persists state"| node_browser
node_app -->|"syncs collections"| node_sheets
node_app -->|"checks roles"| node_auth
node_app -->|"authenticates"| node_firebase
node_app -->|"creates movements"| node_transactions
node_transactions -->|"checks transitions"| node_state
node_transactions -->|"validates passes"| node_validation
node_transactions -->|"generates IDs"| node_identity
node_shipments -->|"checks transitions"| node_state
node_app -->|"imports inventory"| node_import
node_import -->|"allocates IDs"| node_identity
node_import -->|"expands quantities"| node_assetutils
node_sheets -->|"reads and writes"| node_google
node_sheets -->|"refreshes token"| node_firebase
node_sheets -->|"expands quantities"| node_assetutils
node_auth -->|"loads admin config"| node_config
node_auditservice -->|"generates event ID"| node_identity
node_app -->|"creates audit events"| node_auditservice
node_app -->|"shows manifest"| node_manifest
node_syncstatus -->|"displays sync state"| node_app
node_app -->|"resolves settings"| node_config

click node_app "https://github.com/tanto0366/inventory-os/blob/main/src/App.tsx"
click node_assets "https://github.com/tanto0366/inventory-os/blob/main/src/components/AssetsView.tsx"
click node_gatepasses "https://github.com/tanto0366/inventory-os/blob/main/src/components/GatePassesView.tsx"
click node_shipments "https://github.com/tanto0366/inventory-os/blob/main/src/components/ShipmentsView.tsx"
click node_manifest "https://github.com/tanto0366/inventory-os/blob/main/src/components/ShipmentManifestModal.tsx"
click node_campaigns "https://github.com/tanto0366/inventory-os/blob/main/src/components/CampaignsView.tsx"
click node_dashboard "https://github.com/tanto0366/inventory-os/blob/main/src/components/DashboardView.tsx"
click node_import "https://github.com/tanto0366/inventory-os/blob/main/src/services/importTemplateService.ts"
click node_auditview "https://github.com/tanto0366/inventory-os/blob/main/src/components/AuditTrailView.tsx"
click node_adminview "https://github.com/tanto0366/inventory-os/blob/main/src/components/EnterpriseAdminView.tsx"
click node_auth "https://github.com/tanto0366/inventory-os/blob/main/src/lib/auth.ts"
click node_auditservice "https://github.com/tanto0366/inventory-os/blob/main/src/services/auditService.ts"
click node_syncstatus "https://github.com/tanto0366/inventory-os/blob/main/src/components/SyncStatus.tsx"
click node_sheets "https://github.com/tanto0366/inventory-os/blob/main/src/lib/googleSheets.ts"
click node_firebase "https://github.com/tanto0366/inventory-os/blob/main/src/lib/firebase.ts"
click node_transactions "https://github.com/tanto0366/inventory-os/blob/main/src/domain/transactions.ts"
click node_state "https://github.com/tanto0366/inventory-os/blob/main/src/domain/stateMachine.ts"
click node_validation "https://github.com/tanto0366/inventory-os/blob/main/src/domain/validation.ts"
click node_identity "https://github.com/tanto0366/inventory-os/blob/main/src/domain/identity.ts"
click node_assetutils "https://github.com/tanto0366/inventory-os/blob/main/src/lib/assetUtils.ts"
click node_config "https://github.com/tanto0366/inventory-os/blob/main/src/services/configService.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_app,node_assets,node_gatepasses,node_shipments,node_manifest,node_campaigns,node_dashboard,node_import,node_user toneBlue
class node_auditview,node_adminview,node_auth,node_auditservice,node_google,node_browser toneAmber
class node_syncstatus,node_sheets,node_firebase toneMint
class node_transactions,node_state,node_validation,node_identity,node_assetutils,node_config toneRose
```

## Components

### Inventory operations

- [Application coordinator](https://github.com/tanto0366/inventory-os/blob/main/src/App.tsx): `src/App.tsx`
- [Asset management](https://github.com/tanto0366/inventory-os/blob/main/src/components/AssetsView.tsx): `src/components/AssetsView.tsx`
- [Gate pass issuance](https://github.com/tanto0366/inventory-os/blob/main/src/components/GatePassesView.tsx): `src/components/GatePassesView.tsx`
- [Shipment tracking](https://github.com/tanto0366/inventory-os/blob/main/src/components/ShipmentsView.tsx): `src/components/ShipmentsView.tsx`
- [Pass manifests](https://github.com/tanto0366/inventory-os/blob/main/src/components/ShipmentManifestModal.tsx): `src/components/ShipmentManifestModal.tsx`
- [Campaign deployment](https://github.com/tanto0366/inventory-os/blob/main/src/components/CampaignsView.tsx): `src/components/CampaignsView.tsx`
- [Operations dashboard](https://github.com/tanto0366/inventory-os/blob/main/src/components/DashboardView.tsx): `src/components/DashboardView.tsx`
- [Inventory import](https://github.com/tanto0366/inventory-os/blob/main/src/services/importTemplateService.ts): `src/services/importTemplateService.ts`

### Access and oversight

- [Audit activity](https://github.com/tanto0366/inventory-os/blob/main/src/components/AuditTrailView.tsx): `src/components/AuditTrailView.tsx`
- [Admin console](https://github.com/tanto0366/inventory-os/blob/main/src/components/EnterpriseAdminView.tsx): `src/components/EnterpriseAdminView.tsx`
- [Role authorization](https://github.com/tanto0366/inventory-os/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- [Audit event creation](https://github.com/tanto0366/inventory-os/blob/main/src/services/auditService.ts): `src/services/auditService.ts`

### Data integration

- [Sync status](https://github.com/tanto0366/inventory-os/blob/main/src/components/SyncStatus.tsx): `src/components/SyncStatus.tsx`
- [Sheets integration](https://github.com/tanto0366/inventory-os/blob/main/src/lib/googleSheets.ts): `src/lib/googleSheets.ts`
- [Firebase authentication](https://github.com/tanto0366/inventory-os/blob/main/src/lib/firebase.ts): `src/lib/firebase.ts`

### Domain services

- [Movement transactions](https://github.com/tanto0366/inventory-os/blob/main/src/domain/transactions.ts): `src/domain/transactions.ts`
- [Shipment state rules](https://github.com/tanto0366/inventory-os/blob/main/src/domain/stateMachine.ts): `src/domain/stateMachine.ts`
- [Input validation](https://github.com/tanto0366/inventory-os/blob/main/src/domain/validation.ts): `src/domain/validation.ts`
- [Identifier generation](https://github.com/tanto0366/inventory-os/blob/main/src/domain/identity.ts): `src/domain/identity.ts`
- [Asset utilities](https://github.com/tanto0366/inventory-os/blob/main/src/lib/assetUtils.ts): `src/lib/assetUtils.ts`
- [Runtime configuration](https://github.com/tanto0366/inventory-os/blob/main/src/services/configService.ts): `src/services/configService.ts`

### Other components

- **Staff user**
- **Google Sheets service**
- **Browser local storage**

## Connections

- Staff user → Application coordinator: uses
- Application coordinator → Asset management: renders
- Application coordinator → Gate pass issuance: renders
- Application coordinator → Shipment tracking: renders
- Application coordinator → Campaign deployment: renders
- Application coordinator → Operations dashboard: renders
- Application coordinator → Audit activity: renders
- Application coordinator → Admin console: renders
- Application coordinator → Sync status: renders
- Application coordinator → Browser local storage: persists state
- Application coordinator → Sheets integration: syncs collections
- Application coordinator → Role authorization: checks roles
- Application coordinator → Firebase authentication: authenticates
- Application coordinator → Movement transactions: creates movements
- Movement transactions → Shipment state rules: checks transitions
- Movement transactions → Input validation: validates passes
- Movement transactions → Identifier generation: generates IDs
- Shipment tracking → Shipment state rules: checks transitions
- Application coordinator → Inventory import: imports inventory
- Inventory import → Identifier generation: allocates IDs
- Inventory import → Asset utilities: expands quantities
- Sheets integration → Google Sheets service: reads and writes
- Sheets integration → Firebase authentication: refreshes token
- Sheets integration → Asset utilities: expands quantities
- Role authorization → Runtime configuration: loads admin config
- Audit event creation → Identifier generation: generates event ID
- Application coordinator → Audit event creation: creates audit events
- Application coordinator → Pass manifests: shows manifest
- Sync status → Application coordinator: displays sync state
- Application coordinator → Runtime configuration: resolves settings
