# iegarcia/warehouse-software architecture

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

- Interactive diagram: https://gitdiagram.com/iegarcia/warehouse-software
- Repository: https://github.com/iegarcia/warehouse-software

## Overview

Warehouse Software is a React application for maintaining a warehouse directory and finding nearby warehouses on a map. The main workflow is to load the warehouse grid, then add, edit, or delete records; users can also enter an address to geocode it, compare distances, and view a route to the nearest result. Firebase provides authentication, Firestore, and file storage, while LocationIQ and OpenRouteService support mapping. The README also describes CSV import/export, but the sampled source does not show its implementation or wiring.

Main entry points: [`src/firebase.js`](https://github.com/iegarcia/warehouse-software/blob/main/src/firebase.js) (Firebase Adapters), [`src/components/Map/Marker.jsx`](https://github.com/iegarcia/warehouse-software/blob/main/src/components/Map/Marker.jsx) (Nearby Warehouses), [`src/context/AuthContext.js`](https://github.com/iegarcia/warehouse-software/blob/main/src/context/AuthContext.js) (Auth Context), [`src/App.jsx`](https://github.com/iegarcia/warehouse-software/blob/main/src/App.jsx) (Route Shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app["Route Shell<br/>[App.jsx]"]
  node_loading["Loading Dialog<br/>[LoadingModal.jsx]"]
end

subgraph group_identity["Identity"]
  node_authctx["Auth Context<br/>[AuthContext.js]"]
  node_login["Login Screen<br/>[Login.jsx]"]
  node_register["Registration Screen<br/>[Register.jsx]"]
  node_errors["Auth Error Messages<br/>[error-message.js]"]
  node_firebaseconfig["Firebase Services<br/>[firebaseConfig.js]"]
end

subgraph group_warehouse["Warehouse Data"]
  node_home["Warehouse Grid<br/>[Home.jsx]"]
  node_form["Warehouse Form<br/>[AddWarehouse.jsx]"]
  node_firebase["Firebase Adapters<br/>[firebase.js]"]
  node_firestore[("Firestore")]
  node_storage[("Firebase Storage")]
  node_csv["CSV Import / Export"]
end

subgraph group_mapping["Location and Routes"]
  node_mapinput["Address Input<br/>[MapContainer.jsx]"]
  node_map["Map Display<br/>[Map.jsx]"]
  node_markers["Nearby Warehouses<br/>[Marker.jsx]"]
  node_functions["Geospatial Helpers<br/>[functions.js]"]
  node_geocoder{{"LocationIQ"}}
  node_routing{{"OpenRouteService"}}
  node_route["Route Overlay<br/>[ClosestRoute.jsx]"]
  node_directions["Route Details"]
end

node_user(("User"))
node_csvactor["CSV Files"]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_form
node_app -->|"provides context"| node_authctx
node_authctx -->|"uses auth"| node_firebaseconfig
node_authctx -->|"stores signup"| node_firebase
node_login -->|"uses"| node_authctx
node_register -->|"uses"| node_authctx
node_login -->|"formats errors"| node_errors
node_register -->|"formats errors"| node_errors
node_firebaseconfig -->|"initializes"| node_firestore
node_firebaseconfig -->|"initializes"| node_storage
node_firebase -->|"reads and writes"| node_firestore
node_firebase -->|"uploads files"| node_storage
node_home -->|"loads and deletes"| node_firebase
node_form -->|"loads and saves"| node_firebase
node_home -->|"renders"| node_mapinput
node_mapinput -->|"renders on submit"| node_map
node_map -->|"renders"| node_markers
node_markers -->|"loads warehouses"| node_firebase
node_markers -->|"geocodes and ranks"| node_functions
node_functions -->|"requests coordinates"| node_geocoder
node_functions -->|"requests distance and route"| node_routing
node_markers -->|"renders nearest route"| node_route
node_route -->|"builds directions"| node_functions
node_route -->|"opens details"| node_directions
node_form -->|"shows progress"| node_loading
node_markers -->|"shows progress"| node_loading
node_csvactor -.->|"imports or exports"| node_csv

click node_app "https://github.com/iegarcia/warehouse-software/blob/main/src/App.jsx"
click node_home "https://github.com/iegarcia/warehouse-software/blob/main/src/views/Home.jsx"
click node_form "https://github.com/iegarcia/warehouse-software/blob/main/src/views/AddWarehouse.jsx"
click node_loading "https://github.com/iegarcia/warehouse-software/blob/main/src/components/LoadingModal.jsx"
click node_authctx "https://github.com/iegarcia/warehouse-software/blob/main/src/context/AuthContext.js"
click node_login "https://github.com/iegarcia/warehouse-software/blob/main/src/views/Login.jsx"
click node_register "https://github.com/iegarcia/warehouse-software/blob/main/src/views/Register.jsx"
click node_errors "https://github.com/iegarcia/warehouse-software/blob/main/src/errors/error-message.js"
click node_firebase "https://github.com/iegarcia/warehouse-software/blob/main/src/firebase.js"
click node_firebaseconfig "https://github.com/iegarcia/warehouse-software/blob/main/src/firebaseConfig.js"
click node_csv "https://github.com/iegarcia/warehouse-software/tree/main/src/views"
click node_mapinput "https://github.com/iegarcia/warehouse-software/blob/main/src/components/MapContainer.jsx"
click node_map "https://github.com/iegarcia/warehouse-software/blob/main/src/components/Map/Map.jsx"
click node_markers "https://github.com/iegarcia/warehouse-software/blob/main/src/components/Map/Marker.jsx"
click node_functions "https://github.com/iegarcia/warehouse-software/blob/main/src/functions.js"
click node_route "https://github.com/iegarcia/warehouse-software/blob/main/src/components/Map/ClosestRoute.jsx"
click node_directions "https://github.com/iegarcia/warehouse-software/blob/main/src/components/Map/DirectionsModal.jsx"

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_loading,node_user toneBlue
class node_authctx,node_login,node_register,node_errors,node_firebaseconfig toneAmber
class node_home,node_form,node_firebase,node_firestore,node_storage,node_csv toneMint
class node_mapinput,node_map,node_markers,node_functions,node_geocoder,node_routing,node_route,node_directions toneRose
class node_csvactor toneIndigo
```

## Components

### Application

- [Route Shell](https://github.com/iegarcia/warehouse-software/blob/main/src/App.jsx): `src/App.jsx`
- [Loading Dialog](https://github.com/iegarcia/warehouse-software/blob/main/src/components/LoadingModal.jsx): `src/components/LoadingModal.jsx`

### Identity

- [Auth Context](https://github.com/iegarcia/warehouse-software/blob/main/src/context/AuthContext.js): `src/context/AuthContext.js`
- [Login Screen](https://github.com/iegarcia/warehouse-software/blob/main/src/views/Login.jsx): `src/views/Login.jsx`
- [Registration Screen](https://github.com/iegarcia/warehouse-software/blob/main/src/views/Register.jsx): `src/views/Register.jsx`
- [Auth Error Messages](https://github.com/iegarcia/warehouse-software/blob/main/src/errors/error-message.js): `src/errors/error-message.js`
- [Firebase Services](https://github.com/iegarcia/warehouse-software/blob/main/src/firebaseConfig.js): `src/firebaseConfig.js`

### Warehouse Data

- [Warehouse Grid](https://github.com/iegarcia/warehouse-software/blob/main/src/views/Home.jsx): `src/views/Home.jsx`
- [Warehouse Form](https://github.com/iegarcia/warehouse-software/blob/main/src/views/AddWarehouse.jsx): `src/views/AddWarehouse.jsx`
- [Firebase Adapters](https://github.com/iegarcia/warehouse-software/blob/main/src/firebase.js): `src/firebase.js`
- **Firestore**
- **Firebase Storage**
- [CSV Import / Export](https://github.com/iegarcia/warehouse-software/tree/main/src/views): `src/views`

### Location and Routes

- [Address Input](https://github.com/iegarcia/warehouse-software/blob/main/src/components/MapContainer.jsx): `src/components/MapContainer.jsx`
- [Map Display](https://github.com/iegarcia/warehouse-software/blob/main/src/components/Map/Map.jsx): `src/components/Map/Map.jsx`
- [Nearby Warehouses](https://github.com/iegarcia/warehouse-software/blob/main/src/components/Map/Marker.jsx): `src/components/Map/Marker.jsx`
- [Geospatial Helpers](https://github.com/iegarcia/warehouse-software/blob/main/src/functions.js): `src/functions.js`
- **LocationIQ**
- **OpenRouteService**
- [Route Overlay](https://github.com/iegarcia/warehouse-software/blob/main/src/components/Map/ClosestRoute.jsx): `src/components/Map/ClosestRoute.jsx`
- [Route Details](https://github.com/iegarcia/warehouse-software/blob/main/src/components/Map/DirectionsModal.jsx): `src/components/Map/DirectionsModal.jsx`

### Other components

- **User**
- **CSV Files**

## Connections

- User → Route Shell: uses (evidence: `src/App.jsx`)
- Route Shell → Warehouse Grid: routes to (evidence: `src/App.jsx`)
- Route Shell → Warehouse Form: routes to (evidence: `src/App.jsx`)
- Route Shell → Auth Context: provides context (evidence: `src/App.jsx`)
- Auth Context → Firebase Services: uses auth (evidence: `src/context/AuthContext.js`)
- Auth Context → Firebase Adapters: stores signup (evidence: `src/context/AuthContext.js`)
- Login Screen → Auth Context: uses (evidence: `src/views/Login.jsx`)
- Registration Screen → Auth Context: uses (evidence: `src/views/Register.jsx`)
- Login Screen → Auth Error Messages: formats errors (evidence: `src/views/Login.jsx`)
- Registration Screen → Auth Error Messages: formats errors (evidence: `src/views/Register.jsx`)
- Firebase Services → Firestore: initializes (evidence: `src/firebaseConfig.js`)
- Firebase Services → Firebase Storage: initializes (evidence: `src/firebaseConfig.js`)
- Firebase Adapters → Firestore: reads and writes (evidence: `src/firebase.js`)
- Firebase Adapters → Firebase Storage: uploads files (evidence: `src/firebase.js`)
- Warehouse Grid → Firebase Adapters: loads and deletes (evidence: `src/views/Home.jsx`)
- Warehouse Form → Firebase Adapters: loads and saves (evidence: `src/views/AddWarehouse.jsx`)
- Warehouse Grid → Address Input: renders (evidence: `src/views/Home.jsx`)
- Address Input → Map Display: renders on submit (evidence: `src/components/MapContainer.jsx`)
- Map Display → Nearby Warehouses: renders (evidence: `src/components/Map/Map.jsx`)
- Nearby Warehouses → Firebase Adapters: loads warehouses (evidence: `src/components/Map/Marker.jsx`)
- Nearby Warehouses → Geospatial Helpers: geocodes and ranks (evidence: `src/components/Map/Marker.jsx`)
- Geospatial Helpers → LocationIQ: requests coordinates (evidence: `src/functions.js`)
- Geospatial Helpers → OpenRouteService: requests distance and route (evidence: `src/functions.js`)
- Nearby Warehouses → Route Overlay: renders nearest route (evidence: `src/components/Map/Marker.jsx`)
- Route Overlay → Geospatial Helpers: builds directions (evidence: `src/components/Map/ClosestRoute.jsx`)
- Route Overlay → Route Details: opens details (evidence: `src/components/Map/ClosestRoute.jsx`)
- Warehouse Form → Loading Dialog: shows progress (evidence: `src/views/AddWarehouse.jsx`)
- Nearby Warehouses → Loading Dialog: shows progress (evidence: `src/components/Map/Marker.jsx`)
- CSV Files → CSV Import / Export: imports or exports (evidence: `README.md`)
