# karishmag83/repack-environment_sustainable_dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/karishmag83/repack-environment_sustainable_dashboard
- Repository: https://github.com/karishmag83/repack-environment_sustainable_dashboard

## Overview

Repack is a sustainable-packaging dashboard: users access order and return views, can choose a return method and follow a return flow, and can view sustainability metrics and manage account preferences. The sampled order hook calculates return counts, CO₂ savings and eco-points while persisting orders locally. The route setup and selected hooks/components are evidenced; page-level wiring for unsampled pages is not assumed.

Main entry points: [`src/App.tsx`](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/App.tsx) (Application routes), [`src/contexts/AuthContext.tsx`](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/contexts/AuthContext.tsx) (Authentication), [`src/hooks/useLocalStorage.ts`](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/hooks/useLocalStorage.ts) (Local persistence), [`src/hooks/useOrders.ts`](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/hooks/useOrders.ts) (Order state and stats)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_app["Application routes<br/>[App.tsx]"]
  node_auth["Authentication<br/>[AuthContext.tsx]"]
  node_index["Entry redirect<br/>[Index.tsx]"]
  node_login["Login page<br/>[Login.tsx]"]
end

subgraph group_returns["Orders and returns"]
  node_orders["Orders page<br/>[Orders.tsx]"]
  node_orderfilter["Order filters<br/>[OrderFilters.tsx]"]
  node_ordercard["Order card<br/>[OrderCard.tsx]"]
  node_returnflow["Return flow<br/>[ReturnFlow.tsx]"]
  node_tracking["Tracking modal<br/>[TrackingModal.tsx]"]
  node_orderlogic["Order state and stats<br/>[useOrders.ts]"]
  node_orderdata["Order records<br/>[mockOrders.ts]"]
  node_localstorage["Local persistence<br/>[useLocalStorage.ts]"]
end

subgraph group_impact["Impact dashboard"]
  node_dashboard["Dashboard page<br/>[Dashboard.tsx]"]
  node_impactchart["Eco impact chart<br/>[EcoImpactChart.tsx]"]
end

subgraph group_account["Account and support"]
  node_profile["Profile page<br/>[Profile.tsx]"]
  node_settings["User settings<br/>[useUserSettings.ts]"]
  node_notifications["Notification state"]
  node_notificationpanel["Notification panel"]
  node_help["Help page<br/>[Help.tsx]"]
end

node_customer(("Customer"))

node_customer -->|"opens"| node_app
node_app -->|"routes"| node_index
node_app -->|"routes"| node_login
node_app -->|"routes"| node_orders
node_app -->|"routes"| node_dashboard
node_app -->|"routes"| node_profile
node_app -->|"routes"| node_help
node_app -->|"provides auth"| node_auth
node_index -->|"checks session"| node_auth
node_auth -->|"stores session"| node_customer
node_orderlogic -->|"initializes from"| node_orderdata
node_orderlogic -->|"persists orders"| node_localstorage
node_notifications -->|"persists notices"| node_localstorage
node_settings -->|"persists settings"| node_localstorage

click node_app "https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/App.tsx"
click node_auth "https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/contexts/AuthContext.tsx"
click node_index "https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/pages/Index.tsx"
click node_login "https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/pages/Login.tsx"
click node_orders "https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/pages/Orders.tsx"
click node_orderfilter "https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/components/OrderFilters.tsx"
click node_ordercard "https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/components/OrderCard.tsx"
click node_returnflow "https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/components/ReturnFlow.tsx"
click node_tracking "https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/components/TrackingModal.tsx"
click node_orderlogic "https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/hooks/useOrders.ts"
click node_orderdata "https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/data/mockOrders.ts"
click node_localstorage "https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/hooks/useLocalStorage.ts"
click node_dashboard "https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/pages/Dashboard.tsx"
click node_impactchart "https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/components/EcoImpactChart.tsx"
click node_profile "https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/pages/Profile.tsx"
click node_settings "https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/hooks/useUserSettings.ts"
click node_notifications "https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/hooks/useNotifications.ts"
click node_notificationpanel "https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/components/NotificationPanel.tsx"
click node_help "https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/pages/Help.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_app,node_auth,node_index,node_login toneBlue
class node_orders,node_orderfilter,node_ordercard,node_returnflow,node_tracking,node_orderlogic,node_orderdata,node_localstorage toneAmber
class node_dashboard,node_impactchart toneMint
class node_profile,node_settings,node_notifications,node_notificationpanel,node_help toneRose
class node_customer toneIndigo
```

## Components

### Access and navigation

- [Application routes](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/App.tsx): `src/App.tsx`
- [Authentication](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/contexts/AuthContext.tsx): `src/contexts/AuthContext.tsx`
- [Entry redirect](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/pages/Index.tsx): `src/pages/Index.tsx`
- [Login page](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/pages/Login.tsx): `src/pages/Login.tsx`

### Orders and returns

- [Orders page](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/pages/Orders.tsx): `src/pages/Orders.tsx`
- [Order filters](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/components/OrderFilters.tsx): `src/components/OrderFilters.tsx`
- [Order card](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/components/OrderCard.tsx): `src/components/OrderCard.tsx`
- [Return flow](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/components/ReturnFlow.tsx): `src/components/ReturnFlow.tsx`
- [Tracking modal](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/components/TrackingModal.tsx): `src/components/TrackingModal.tsx`
- [Order state and stats](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/hooks/useOrders.ts): `src/hooks/useOrders.ts`
- [Order records](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/data/mockOrders.ts): `src/data/mockOrders.ts`
- [Local persistence](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/hooks/useLocalStorage.ts): `src/hooks/useLocalStorage.ts`

### Impact dashboard

- [Dashboard page](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [Eco impact chart](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/components/EcoImpactChart.tsx): `src/components/EcoImpactChart.tsx`

### Account and support

- [Profile page](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/pages/Profile.tsx): `src/pages/Profile.tsx`
- [User settings](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/hooks/useUserSettings.ts): `src/hooks/useUserSettings.ts`
- [Notification state](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/hooks/useNotifications.ts): `src/hooks/useNotifications.ts`
- [Notification panel](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/components/NotificationPanel.tsx): `src/components/NotificationPanel.tsx`
- [Help page](https://github.com/karishmag83/repack-environment_sustainable_dashboard/blob/main/src/pages/Help.tsx): `src/pages/Help.tsx`

### Other components

- **Customer**

## Connections

- Customer → Application routes: opens
- Application routes → Entry redirect: routes
- Application routes → Login page: routes
- Application routes → Orders page: routes
- Application routes → Dashboard page: routes
- Application routes → Profile page: routes
- Application routes → Help page: routes
- Application routes → Authentication: provides auth
- Entry redirect → Authentication: checks session
- Authentication → Customer: stores session
- Order state and stats → Order records: initializes from
- Order state and stats → Local persistence: persists orders
- Notification state → Local persistence: persists notices
- User settings → Local persistence: persists settings
