# el-hash97/tools-locator architecture

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

- Interactive diagram: https://gitdiagram.com/el-hash97/tools-locator
- Repository: https://github.com/el-hash97/tools-locator

## Overview

Tool Locator is a browser-based tool inventory and locating app. Workers search and filter tools, inspect their stored location and floor plan, then scan a QR label to reach the return flow. Admins sign in to manage tools, categories, locations, floor-plan zones, and printable QR labels. Data currently flows through a repository abstraction to browser localStorage; the source excerpts do not establish a remote backend or the detailed operations of every unsampled page.

Main entry points: [`src/data/DataProvider.tsx`](https://github.com/el-hash97/tools-locator/blob/main/src/data/DataProvider.tsx) (Data Context), [`src/App.tsx`](https://github.com/el-hash97/tools-locator/blob/main/src/App.tsx) (Route App), [`src/pages/Home.tsx`](https://github.com/el-hash97/tools-locator/blob/main/src/pages/Home.tsx) (Tool Search), [`src/pages/Return.tsx`](https://github.com/el-hash97/tools-locator/blob/main/src/pages/Return.tsx) (Return Flow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Find Tools"]
  node_home["Tool Search<br/>[Home.tsx]"]
  node_toolcard["Tool Results<br/>[ToolCard.tsx]"]
  node_denah["Floor Plan<br/>[Denah.tsx]"]
  node_detail["Tool Details<br/>[ToolDetail.tsx]"]
  node_fuzzy["Name Matching<br/>[fuzzy.ts]"]
  node_format["Location Formatting<br/>[format.ts]"]
end

subgraph group_return["QR Return"]
  node_scanner["QR Scan<br/>[Scan.tsx]"]
  node_qr["QR Parsing<br/>[qr.ts]"]
  node_returnpage["Return Flow<br/>[Return.tsx]"]
end

subgraph group_admin["Admin Management"]
  node_login["Admin Login<br/>[Login.tsx]"]
  node_adminlayout["Admin Navigation<br/>[AdminLayout.tsx]"]
  node_toolsadmin["Tool Management<br/>[Tools.tsx]"]
  node_categories["Category Management<br/>[Categories.tsx]"]
  node_locations["Location Management<br/>[Locations.tsx]"]
  node_zones["Zone Management<br/>[Zones.tsx]"]
  node_labels["QR Labels<br/>[Labels.tsx]"]
  node_photo["Photo Input<br/>[PhotoInput.tsx]"]
end

subgraph group_data["Data and Access"]
  node_app["Route App<br/>[App.tsx]"]
  node_auth["Session Auth<br/>[AuthProvider.tsx]"]
  node_guard["Route Guard<br/>[RequireAuth.tsx]"]
  node_dataprovider["Data Context<br/>[DataProvider.tsx]"]
  node_repository["Repository Contract<br/>[repository.ts]"]
  node_mockrepo["Local Repository<br/>[mockRepository.ts]"]
  node_localstorage[("Browser Storage<br/>[mockRepository.ts]")]
  node_seed["Seed Records<br/>[seed.ts]"]
  node_types["Domain Types<br/>[types.ts]"]
end

node_worker(("Worker"))
node_adminuser(("Administrator"))

node_worker -->|"opens"| node_app
node_adminuser -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_detail
node_app -->|"routes to"| node_scanner
node_app -->|"routes to"| node_returnpage
node_app -->|"routes to"| node_login
node_app -->|"protects routes"| node_guard
node_guard -->|"checks session"| node_auth
node_login -->|"signs in"| node_auth
node_app -->|"provides data"| node_dataprovider
node_home -->|"reads inventory"| node_dataprovider
node_home -->|"matches names"| node_fuzzy
node_home -->|"renders results"| node_toolcard
node_home -->|"renders plan"| node_denah
node_home -->|"formats locations"| node_format
node_detail -->|"reads tool data"| node_dataprovider
node_scanner -->|"parses scans"| node_qr
node_scanner -->|"navigates to"| node_returnpage
node_returnpage -->|"reads and updates"| node_dataprovider
node_returnpage -->|"renders location"| node_denah
node_returnpage -->|"formats locations"| node_format
node_adminlayout -->|"signs out"| node_auth
node_toolsadmin -->|"manages tools"| node_dataprovider
node_toolsadmin -->|"collects photos"| node_photo
node_categories -->|"manages categories"| node_dataprovider
node_locations -->|"manages locations"| node_dataprovider
node_locations -->|"uses floor plan"| node_denah
node_zones -->|"manages zones"| node_dataprovider
node_zones -->|"uses floor plan"| node_denah
node_labels -->|"reads tool data"| node_dataprovider
node_dataprovider -->|"implements contract"| node_repository
node_dataprovider -->|"selects repository"| node_mockrepo
node_mockrepo -->|"reads and writes"| node_localstorage
node_mockrepo -->|"initializes from"| node_seed
node_mockrepo -->|"uses domain types"| node_types
node_repository -->|"defines data shapes"| node_types
node_auth -->|"checks credentials"| node_seed
node_auth -->|"uses session type"| node_types
node_denah -->|"renders zones"| node_types
node_format -->|"formats location type"| node_types
node_labels -->|"builds label URLs"| node_qr
node_toolsadmin -->|"previews QR"| node_qr

click node_app "https://github.com/el-hash97/tools-locator/blob/main/src/App.tsx"
click node_home "https://github.com/el-hash97/tools-locator/blob/main/src/pages/Home.tsx"
click node_toolcard "https://github.com/el-hash97/tools-locator/blob/main/src/components/ToolCard.tsx"
click node_denah "https://github.com/el-hash97/tools-locator/blob/main/src/components/Denah.tsx"
click node_detail "https://github.com/el-hash97/tools-locator/blob/main/src/pages/ToolDetail.tsx"
click node_scanner "https://github.com/el-hash97/tools-locator/blob/main/src/pages/Scan.tsx"
click node_qr "https://github.com/el-hash97/tools-locator/blob/main/src/lib/qr.ts"
click node_returnpage "https://github.com/el-hash97/tools-locator/blob/main/src/pages/Return.tsx"
click node_login "https://github.com/el-hash97/tools-locator/blob/main/src/pages/admin/Login.tsx"
click node_auth "https://github.com/el-hash97/tools-locator/blob/main/src/auth/AuthProvider.tsx"
click node_guard "https://github.com/el-hash97/tools-locator/blob/main/src/auth/RequireAuth.tsx"
click node_adminlayout "https://github.com/el-hash97/tools-locator/blob/main/src/pages/admin/AdminLayout.tsx"
click node_toolsadmin "https://github.com/el-hash97/tools-locator/blob/main/src/pages/admin/Tools.tsx"
click node_categories "https://github.com/el-hash97/tools-locator/blob/main/src/pages/admin/Categories.tsx"
click node_locations "https://github.com/el-hash97/tools-locator/blob/main/src/pages/admin/Locations.tsx"
click node_zones "https://github.com/el-hash97/tools-locator/blob/main/src/pages/admin/Zones.tsx"
click node_labels "https://github.com/el-hash97/tools-locator/blob/main/src/pages/admin/Labels.tsx"
click node_dataprovider "https://github.com/el-hash97/tools-locator/blob/main/src/data/DataProvider.tsx"
click node_repository "https://github.com/el-hash97/tools-locator/blob/main/src/data/repository.ts"
click node_mockrepo "https://github.com/el-hash97/tools-locator/blob/main/src/data/mockRepository.ts"
click node_localstorage "https://github.com/el-hash97/tools-locator/blob/main/src/data/mockRepository.ts"
click node_seed "https://github.com/el-hash97/tools-locator/blob/main/src/data/seed.ts"
click node_types "https://github.com/el-hash97/tools-locator/blob/main/src/data/types.ts"
click node_fuzzy "https://github.com/el-hash97/tools-locator/blob/main/src/lib/fuzzy.ts"
click node_format "https://github.com/el-hash97/tools-locator/blob/main/src/lib/format.ts"
click node_photo "https://github.com/el-hash97/tools-locator/blob/main/src/components/PhotoInput.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_home,node_toolcard,node_denah,node_detail,node_fuzzy,node_format toneBlue
class node_scanner,node_qr,node_returnpage toneAmber
class node_login,node_adminlayout,node_toolsadmin,node_categories,node_locations,node_zones,node_labels,node_photo toneMint
class node_app,node_auth,node_guard,node_dataprovider,node_repository,node_mockrepo,node_localstorage,node_seed,node_types,node_worker toneRose
class node_adminuser toneIndigo
```

## Components

### Find Tools

- [Tool Search](https://github.com/el-hash97/tools-locator/blob/main/src/pages/Home.tsx): `src/pages/Home.tsx`
- [Tool Results](https://github.com/el-hash97/tools-locator/blob/main/src/components/ToolCard.tsx): `src/components/ToolCard.tsx`
- [Floor Plan](https://github.com/el-hash97/tools-locator/blob/main/src/components/Denah.tsx): `src/components/Denah.tsx`
- [Tool Details](https://github.com/el-hash97/tools-locator/blob/main/src/pages/ToolDetail.tsx): `src/pages/ToolDetail.tsx`
- [Name Matching](https://github.com/el-hash97/tools-locator/blob/main/src/lib/fuzzy.ts): `src/lib/fuzzy.ts`
- [Location Formatting](https://github.com/el-hash97/tools-locator/blob/main/src/lib/format.ts): `src/lib/format.ts`

### QR Return

- [QR Scan](https://github.com/el-hash97/tools-locator/blob/main/src/pages/Scan.tsx): `src/pages/Scan.tsx`
- [QR Parsing](https://github.com/el-hash97/tools-locator/blob/main/src/lib/qr.ts): `src/lib/qr.ts`
- [Return Flow](https://github.com/el-hash97/tools-locator/blob/main/src/pages/Return.tsx): `src/pages/Return.tsx`

### Admin Management

- [Admin Login](https://github.com/el-hash97/tools-locator/blob/main/src/pages/admin/Login.tsx): `src/pages/admin/Login.tsx`
- [Admin Navigation](https://github.com/el-hash97/tools-locator/blob/main/src/pages/admin/AdminLayout.tsx): `src/pages/admin/AdminLayout.tsx`
- [Tool Management](https://github.com/el-hash97/tools-locator/blob/main/src/pages/admin/Tools.tsx): `src/pages/admin/Tools.tsx`
- [Category Management](https://github.com/el-hash97/tools-locator/blob/main/src/pages/admin/Categories.tsx): `src/pages/admin/Categories.tsx`
- [Location Management](https://github.com/el-hash97/tools-locator/blob/main/src/pages/admin/Locations.tsx): `src/pages/admin/Locations.tsx`
- [Zone Management](https://github.com/el-hash97/tools-locator/blob/main/src/pages/admin/Zones.tsx): `src/pages/admin/Zones.tsx`
- [QR Labels](https://github.com/el-hash97/tools-locator/blob/main/src/pages/admin/Labels.tsx): `src/pages/admin/Labels.tsx`
- [Photo Input](https://github.com/el-hash97/tools-locator/blob/main/src/components/PhotoInput.tsx): `src/components/PhotoInput.tsx`

### Data and Access

- [Route App](https://github.com/el-hash97/tools-locator/blob/main/src/App.tsx): `src/App.tsx`
- [Session Auth](https://github.com/el-hash97/tools-locator/blob/main/src/auth/AuthProvider.tsx): `src/auth/AuthProvider.tsx`
- [Route Guard](https://github.com/el-hash97/tools-locator/blob/main/src/auth/RequireAuth.tsx): `src/auth/RequireAuth.tsx`
- [Data Context](https://github.com/el-hash97/tools-locator/blob/main/src/data/DataProvider.tsx): `src/data/DataProvider.tsx`
- [Repository Contract](https://github.com/el-hash97/tools-locator/blob/main/src/data/repository.ts): `src/data/repository.ts`
- [Local Repository](https://github.com/el-hash97/tools-locator/blob/main/src/data/mockRepository.ts): `src/data/mockRepository.ts`
- [Browser Storage](https://github.com/el-hash97/tools-locator/blob/main/src/data/mockRepository.ts): `src/data/mockRepository.ts`
- [Seed Records](https://github.com/el-hash97/tools-locator/blob/main/src/data/seed.ts): `src/data/seed.ts`
- [Domain Types](https://github.com/el-hash97/tools-locator/blob/main/src/data/types.ts): `src/data/types.ts`

### Other components

- **Worker**
- **Administrator**

## Connections

- Worker → Route App: opens (evidence: `src/App.tsx`)
- Administrator → Route App: opens (evidence: `src/App.tsx`)
- Route App → Tool Search: routes to (evidence: `src/App.tsx`)
- Route App → Tool Details: routes to (evidence: `src/App.tsx`)
- Route App → QR Scan: routes to (evidence: `src/App.tsx`)
- Route App → Return Flow: routes to (evidence: `src/App.tsx`)
- Route App → Admin Login: routes to (evidence: `src/App.tsx`)
- Route App → Route Guard: protects routes (evidence: `src/App.tsx`)
- Route Guard → Session Auth: checks session (evidence: `src/auth/RequireAuth.tsx`)
- Admin Login → Session Auth: signs in (evidence: `src/pages/admin/Login.tsx`)
- Route App → Data Context: provides data (evidence: `src/App.tsx`)
- Tool Search → Data Context: reads inventory (evidence: `src/pages/Home.tsx`)
- Tool Search → Name Matching: matches names (evidence: `src/pages/Home.tsx`)
- Tool Search → Tool Results: renders results (evidence: `src/pages/Home.tsx`)
- Tool Search → Floor Plan: renders plan (evidence: `src/pages/Home.tsx`)
- Tool Search → Location Formatting: formats locations (evidence: `src/pages/Home.tsx`)
- Tool Details → Data Context: reads tool data (evidence: `src/pages/ToolDetail.tsx`)
- QR Scan → QR Parsing: parses scans (evidence: `src/pages/Scan.tsx`)
- QR Scan → Return Flow: navigates to
- Return Flow → Data Context: reads and updates (evidence: `src/pages/Return.tsx`)
- Return Flow → Floor Plan: renders location (evidence: `src/pages/Return.tsx`)
- Return Flow → Location Formatting: formats locations (evidence: `src/pages/Return.tsx`)
- Admin Navigation → Session Auth: signs out (evidence: `src/pages/admin/AdminLayout.tsx`)
- Tool Management → Data Context: manages tools (evidence: `src/pages/admin/Tools.tsx`)
- Tool Management → Photo Input: collects photos (evidence: `src/pages/admin/Tools.tsx`)
- Category Management → Data Context: manages categories (evidence: `src/pages/admin/Categories.tsx`)
- Location Management → Data Context: manages locations (evidence: `src/pages/admin/Locations.tsx`)
- Location Management → Floor Plan: uses floor plan (evidence: `src/pages/admin/Locations.tsx`)
- Zone Management → Data Context: manages zones (evidence: `src/pages/admin/Zones.tsx`)
- Zone Management → Floor Plan: uses floor plan (evidence: `src/pages/admin/Zones.tsx`)
- QR Labels → Data Context: reads tool data (evidence: `src/pages/admin/Labels.tsx`)
- Data Context → Repository Contract: implements contract (evidence: `src/data/DataProvider.tsx`)
- Data Context → Local Repository: selects repository (evidence: `src/data/DataProvider.tsx`)
- Local Repository → Browser Storage: reads and writes (evidence: `src/data/mockRepository.ts`)
- Local Repository → Seed Records: initializes from (evidence: `src/data/mockRepository.ts`)
- Local Repository → Domain Types: uses domain types (evidence: `src/data/mockRepository.ts`)
- Repository Contract → Domain Types: defines data shapes (evidence: `src/data/repository.ts`)
- Session Auth → Seed Records: checks credentials (evidence: `src/auth/AuthProvider.tsx`)
- Session Auth → Domain Types: uses session type (evidence: `src/auth/AuthProvider.tsx`)
- Floor Plan → Domain Types: renders zones (evidence: `src/components/Denah.tsx`)
- Location Formatting → Domain Types: formats location type (evidence: `src/lib/format.ts`)
- QR Labels → QR Parsing: builds label URLs (evidence: `src/pages/admin/Labels.tsx`)
- Tool Management → QR Parsing: previews QR (evidence: `src/pages/admin/Tools.tsx`)
