# yvonnegat/wastelink architecture

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

- Interactive diagram: https://gitdiagram.com/yvonnegat/wastelink
- Repository: https://github.com/yvonnegat/wastelink

## Overview

WasteLink is a React marketplace frontend connecting waste sellers with recyclers. Users authenticate, then enter role-based dashboards and can create a waste listing through type selection, image verification, and pricing; recyclers can discover listings and manage matches. Other major areas cover recycler locations, profiles, transactions, notifications, and administration. The app shell routes between these screens, while hooks and services handle authentication, listings, location data, pricing, and vision requests. Edges reflect the supplied source excerpts, SOURCE INDEX references, or README; unsampled features are included, but uncertain internal calls are omitted.

Main entry points: [`src/App.jsx`](https://github.com/yvonnegat/wastelink/blob/main/src/App.jsx) (App shell), [`src/components/listing/WasteListing.jsx`](https://github.com/yvonnegat/wastelink/blob/main/src/components/listing/WasteListing.jsx) (Waste listing wizard), [`src/services/apiClient.js`](https://github.com/yvonnegat/wastelink/blob/main/src/services/apiClient.js) (HTTP and tokens), [`src/components/auth/AuthPage.jsx`](https://github.com/yvonnegat/wastelink/blob/main/src/components/auth/AuthPage.jsx) (Sign in and register)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and access"]
  node_app_shell["App shell<br/>[App.jsx]"]
  node_auth_page["Sign in and register<br/>[AuthPage.jsx]"]
  node_auth_state["Session and user state<br/>[AuthContext.jsx]"]
  node_dashboard["Role dashboards<br/>[Dashboard.jsx]"]
  node_how_it_works["How it works<br/>[HowItWorks.jsx]"]
end

subgraph group_market["Marketplace workflow"]
  node_listing_wizard["Waste listing wizard<br/>[WasteListing.jsx]"]
  node_listing_feed["Listing feed<br/>[Listingfeed.jsx]"]
  node_vision_ui["AI verification UI<br/>[VisionModule.jsx]"]
  node_vision_hook["Vision analysis state<br/>[useVision.js]"]
  node_pricing_ui["Dynamic pricing<br/>[PricingModule.jsx]"]
  node_matches["Recycler matches<br/>[MatchesPage.jsx]"]
  node_transactions["Transactions<br/>[Transactions.jsx]"]
end

subgraph group_recycler["Recycler discovery"]
  node_map_ui["Recycler map<br/>[MapModule.jsx]"]
  node_map_locations["Location lookup<br/>[useMapLocations.js]"]
  node_profile["User profiles<br/>[ProfilePage.jsx]"]
  node_admin["Administration<br/>[AdminPanel.jsx]"]
  node_notifications["Notifications"]
end

subgraph group_platform["Shared services"]
  node_listing_service["Listing operations<br/>[ListingService.js]"]
  node_api_client["HTTP and tokens<br/>[apiClient.js]"]
  node_auth_service["Authentication API<br/>[authService.js]"]
  node_user_service["User API<br/>[userService.js]"]
  node_vision_service["Vision API<br/>[visionService.js]"]
  node_pricing_service["Pricing API<br/>[pricingService.js]"]
  node_location_service["Location data service<br/>[locationService.js]"]
  node_supabase["Supabase client<br/>[supabaseClient.js]"]
  node_common_icon["SVG icons<br/>[Icon.jsx]"]
  node_common_toast["Toast notices<br/>[Toast.jsx]"]
end

node_person(("Seller / recycler"))
node_backend{{"WasteLink API"}}
node_supabase_external[("Supabase")]

node_person -->|"uses"| node_app_shell
node_app_shell -->|"routes to"| node_auth_page
node_app_shell -->|"routes to"| node_dashboard
node_app_shell -->|"routes to"| node_listing_wizard
node_app_shell -->|"routes to"| node_listing_feed
node_app_shell -->|"routes to"| node_matches
node_app_shell -->|"routes to"| node_profile
node_app_shell -->|"routes to"| node_admin
node_app_shell -->|"routes to"| node_vision_ui
node_app_shell -->|"routes to"| node_pricing_ui
node_app_shell -->|"routes to"| node_map_ui
node_app_shell -->|"routes to"| node_transactions
node_app_shell -->|"opens"| node_how_it_works
node_auth_page -->|"authenticates via"| node_auth_state
node_auth_page -->|"requests reset"| node_auth_service
node_auth_state -->|"logs in via"| node_auth_service
node_auth_state -->|"loads user"| node_user_service
node_auth_service -->|"sends requests"| node_api_client
node_user_service -->|"sends requests"| node_api_client
node_api_client -->|"calls API"| node_backend
node_listing_wizard -->|"creates listing"| node_listing_service
node_listing_wizard -->|"analyses images"| node_vision_hook
node_vision_hook -->|"requests analysis"| node_vision_service
node_vision_ui -->|"uses analysis state"| node_vision_hook
node_vision_service -->|"calls API"| node_backend
node_listing_wizard -->|"gets estimate"| node_pricing_service
node_pricing_ui -->|"requests pricing"| node_backend
node_listing_service -->|"sends requests"| node_api_client
node_map_ui -->|"loads locations"| node_map_locations
node_map_locations -->|"queries locations"| node_location_service
node_location_service -->|"reads and writes"| node_supabase
node_supabase -->|"connects to"| node_supabase_external
node_matches -->|"manages matches"| node_backend
node_transactions -->|"loads history"| node_backend
node_person -->|"finds recyclers"| node_map_ui
node_person -->|"lists waste"| node_listing_wizard

click node_app_shell "https://github.com/yvonnegat/wastelink/blob/main/src/App.jsx"
click node_auth_page "https://github.com/yvonnegat/wastelink/blob/main/src/components/auth/AuthPage.jsx"
click node_auth_state "https://github.com/yvonnegat/wastelink/blob/main/src/context/AuthContext.jsx"
click node_dashboard "https://github.com/yvonnegat/wastelink/blob/main/src/components/dashboard/Dashboard.jsx"
click node_how_it_works "https://github.com/yvonnegat/wastelink/blob/main/src/components/HowItWorks.jsx"
click node_listing_wizard "https://github.com/yvonnegat/wastelink/blob/main/src/components/listing/WasteListing.jsx"
click node_listing_feed "https://github.com/yvonnegat/wastelink/blob/main/src/components/listings/Listingfeed.jsx"
click node_vision_ui "https://github.com/yvonnegat/wastelink/blob/main/src/components/vision/VisionModule.jsx"
click node_vision_hook "https://github.com/yvonnegat/wastelink/blob/main/src/hooks/useVision.js"
click node_pricing_ui "https://github.com/yvonnegat/wastelink/blob/main/src/components/pricing/PricingModule.jsx"
click node_matches "https://github.com/yvonnegat/wastelink/blob/main/src/components/matches/MatchesPage.jsx"
click node_transactions "https://github.com/yvonnegat/wastelink/blob/main/src/components/transactions/Transactions.jsx"
click node_map_ui "https://github.com/yvonnegat/wastelink/blob/main/src/components/map/MapModule.jsx"
click node_map_locations "https://github.com/yvonnegat/wastelink/blob/main/src/hooks/useMapLocations.js"
click node_profile "https://github.com/yvonnegat/wastelink/blob/main/src/components/profile/ProfilePage.jsx"
click node_admin "https://github.com/yvonnegat/wastelink/blob/main/src/components/admin/AdminPanel.jsx"
click node_notifications "https://github.com/yvonnegat/wastelink/blob/main/src/components/notifications/NotificationsPanel.jsx"
click node_listing_service "https://github.com/yvonnegat/wastelink/blob/main/src/services/ListingService.js"
click node_api_client "https://github.com/yvonnegat/wastelink/blob/main/src/services/apiClient.js"
click node_auth_service "https://github.com/yvonnegat/wastelink/blob/main/src/services/authService.js"
click node_user_service "https://github.com/yvonnegat/wastelink/blob/main/src/services/userService.js"
click node_vision_service "https://github.com/yvonnegat/wastelink/blob/main/src/services/visionService.js"
click node_pricing_service "https://github.com/yvonnegat/wastelink/blob/main/src/services/pricingService.js"
click node_location_service "https://github.com/yvonnegat/wastelink/blob/main/src/services/locationService.js"
click node_supabase "https://github.com/yvonnegat/wastelink/blob/main/src/services/supabaseClient.js"
click node_common_icon "https://github.com/yvonnegat/wastelink/blob/main/src/components/common/Icon.jsx"
click node_common_toast "https://github.com/yvonnegat/wastelink/blob/main/src/components/common/Toast.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_shell,node_auth_page,node_auth_state,node_dashboard,node_how_it_works toneBlue
class node_listing_wizard,node_listing_feed,node_vision_ui,node_vision_hook,node_pricing_ui,node_matches,node_transactions,node_supabase_external toneAmber
class node_map_ui,node_map_locations,node_profile,node_admin,node_notifications,node_backend toneMint
class node_listing_service,node_api_client,node_auth_service,node_user_service,node_vision_service,node_pricing_service,node_location_service,node_supabase,node_common_icon,node_common_toast toneRose
class node_person toneIndigo
```

## Components

### Application and access

- [App shell](https://github.com/yvonnegat/wastelink/blob/main/src/App.jsx): `src/App.jsx`
- [Sign in and register](https://github.com/yvonnegat/wastelink/blob/main/src/components/auth/AuthPage.jsx): `src/components/auth/AuthPage.jsx`
- [Session and user state](https://github.com/yvonnegat/wastelink/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Role dashboards](https://github.com/yvonnegat/wastelink/blob/main/src/components/dashboard/Dashboard.jsx): `src/components/dashboard/Dashboard.jsx`
- [How it works](https://github.com/yvonnegat/wastelink/blob/main/src/components/HowItWorks.jsx): `src/components/HowItWorks.jsx`

### Marketplace workflow

- [Waste listing wizard](https://github.com/yvonnegat/wastelink/blob/main/src/components/listing/WasteListing.jsx): `src/components/listing/WasteListing.jsx`
- [Listing feed](https://github.com/yvonnegat/wastelink/blob/main/src/components/listings/Listingfeed.jsx): `src/components/listings/Listingfeed.jsx`
- [AI verification UI](https://github.com/yvonnegat/wastelink/blob/main/src/components/vision/VisionModule.jsx): `src/components/vision/VisionModule.jsx`
- [Vision analysis state](https://github.com/yvonnegat/wastelink/blob/main/src/hooks/useVision.js): `src/hooks/useVision.js`
- [Dynamic pricing](https://github.com/yvonnegat/wastelink/blob/main/src/components/pricing/PricingModule.jsx): `src/components/pricing/PricingModule.jsx`
- [Recycler matches](https://github.com/yvonnegat/wastelink/blob/main/src/components/matches/MatchesPage.jsx): `src/components/matches/MatchesPage.jsx`
- [Transactions](https://github.com/yvonnegat/wastelink/blob/main/src/components/transactions/Transactions.jsx): `src/components/transactions/Transactions.jsx`

### Recycler discovery

- [Recycler map](https://github.com/yvonnegat/wastelink/blob/main/src/components/map/MapModule.jsx): `src/components/map/MapModule.jsx`
- [Location lookup](https://github.com/yvonnegat/wastelink/blob/main/src/hooks/useMapLocations.js): `src/hooks/useMapLocations.js`
- [User profiles](https://github.com/yvonnegat/wastelink/blob/main/src/components/profile/ProfilePage.jsx): `src/components/profile/ProfilePage.jsx`
- [Administration](https://github.com/yvonnegat/wastelink/blob/main/src/components/admin/AdminPanel.jsx): `src/components/admin/AdminPanel.jsx`
- [Notifications](https://github.com/yvonnegat/wastelink/blob/main/src/components/notifications/NotificationsPanel.jsx): `src/components/notifications/NotificationsPanel.jsx`

### Shared services

- [Listing operations](https://github.com/yvonnegat/wastelink/blob/main/src/services/ListingService.js): `src/services/ListingService.js`
- [HTTP and tokens](https://github.com/yvonnegat/wastelink/blob/main/src/services/apiClient.js): `src/services/apiClient.js`
- [Authentication API](https://github.com/yvonnegat/wastelink/blob/main/src/services/authService.js): `src/services/authService.js`
- [User API](https://github.com/yvonnegat/wastelink/blob/main/src/services/userService.js): `src/services/userService.js`
- [Vision API](https://github.com/yvonnegat/wastelink/blob/main/src/services/visionService.js): `src/services/visionService.js`
- [Pricing API](https://github.com/yvonnegat/wastelink/blob/main/src/services/pricingService.js): `src/services/pricingService.js`
- [Location data service](https://github.com/yvonnegat/wastelink/blob/main/src/services/locationService.js): `src/services/locationService.js`
- [Supabase client](https://github.com/yvonnegat/wastelink/blob/main/src/services/supabaseClient.js): `src/services/supabaseClient.js`
- [SVG icons](https://github.com/yvonnegat/wastelink/blob/main/src/components/common/Icon.jsx): `src/components/common/Icon.jsx`
- [Toast notices](https://github.com/yvonnegat/wastelink/blob/main/src/components/common/Toast.jsx): `src/components/common/Toast.jsx`

### Other components

- **Seller / recycler**
- **WasteLink API**
- **Supabase**

## Connections

- Seller / recycler → App shell: uses
- App shell → Sign in and register: routes to (evidence: `src/App.jsx`)
- App shell → Role dashboards: routes to (evidence: `src/App.jsx`)
- App shell → Waste listing wizard: routes to (evidence: `src/App.jsx`)
- App shell → Listing feed: routes to (evidence: `src/App.jsx`)
- App shell → Recycler matches: routes to (evidence: `src/App.jsx`)
- App shell → User profiles: routes to (evidence: `src/App.jsx`)
- App shell → Administration: routes to (evidence: `src/App.jsx`)
- App shell → AI verification UI: routes to (evidence: `src/App.jsx`)
- App shell → Dynamic pricing: routes to (evidence: `src/App.jsx`)
- App shell → Recycler map: routes to (evidence: `src/App.jsx`)
- App shell → Transactions: routes to (evidence: `src/App.jsx`)
- App shell → How it works: opens (evidence: `src/App.jsx`)
- Sign in and register → Session and user state: authenticates via (evidence: `src/components/auth/AuthPage.jsx`)
- Sign in and register → Authentication API: requests reset (evidence: `src/components/auth/AuthPage.jsx`)
- Session and user state → Authentication API: logs in via (evidence: `src/context/AuthContext.jsx`)
- Session and user state → User API: loads user (evidence: `src/context/AuthContext.jsx`)
- Authentication API → HTTP and tokens: sends requests (evidence: `src/services/authService.js`)
- User API → HTTP and tokens: sends requests (evidence: `src/services/userService.js`)
- HTTP and tokens → WasteLink API: calls API (evidence: `src/services/apiClient.js`)
- Waste listing wizard → Listing operations: creates listing (evidence: `src/components/listing/WasteListing.jsx`)
- Waste listing wizard → Vision analysis state: analyses images (evidence: `src/components/listing/WasteListing.jsx`)
- Vision analysis state → Vision API: requests analysis (evidence: `src/hooks/useVision.js`)
- AI verification UI → Vision analysis state: uses analysis state (evidence: `src/components/vision/VisionModule.jsx`)
- Vision API → WasteLink API: calls API
- Waste listing wizard → Pricing API: gets estimate (evidence: `src/components/listing/WasteListing.jsx`)
- Dynamic pricing → WasteLink API: requests pricing
- Listing operations → HTTP and tokens: sends requests (evidence: `src/services/ListingService.js`)
- Recycler map → Location lookup: loads locations (evidence: `src/components/map/MapModule.jsx`)
- Location lookup → Location data service: queries locations (evidence: `src/hooks/useMapLocations.js`)
- Location data service → Supabase client: reads and writes (evidence: `src/services/locationService.js`)
- Supabase client → Supabase: connects to
- Recycler matches → WasteLink API: manages matches
- Transactions → WasteLink API: loads history
- Seller / recycler → Recycler map: finds recyclers
- Seller / recycler → Waste listing wizard: lists waste
