# v-spnz/locallink-capstone architecture

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

- Interactive diagram: https://gitdiagram.com/v-spnz/locallink-capstone
- Repository: https://github.com/v-spnz/locallink-capstone

## Overview

LocalLink is a React portal for customers and businesses, backed by Supabase and using Geoapify for address search. Users enter through the routed app and register or sign in; customers can discover deals and loyalty programmes, post service jobs, and review account history, while businesses manage deals, loyalty programmes, and marketplace leads, quotes, and jobs. The graph highlights those product stages and the feature hooks that coordinate API operations. Several feature implementations were not sampled, so their internal links are included only where the SOURCE INDEX establishes them.

Main entry points: [`src/lib/supabase.js`](https://github.com/v-spnz/locallink-capstone/blob/main/src/lib/supabase.js) (Supabase client), [`src/app/App.jsx`](https://github.com/v-spnz/locallink-capstone/blob/main/src/app/App.jsx) (App routing), [`src/business/BusinessProvider.jsx`](https://github.com/v-spnz/locallink-capstone/blob/main/src/business/BusinessProvider.jsx) (Business identity), [`src/pages/customer/hooks/useAllHistory.js`](https://github.com/v-spnz/locallink-capstone/blob/main/src/pages/customer/hooks/useAllHistory.js) (Account history)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and identity"]
  node_entry["App routing<br/>[App.jsx]"]
  node_auth["Authentication<br/>[AuthProvider.jsx]"]
  node_registration["Registration<br/>[RegisterPage.jsx]"]
end

subgraph group_customer["Customer features"]
  node_customer_portal["Customer portal<br/>[CustomerPortal.jsx]"]
  node_customer_deals["Deal discovery<br/>[Deals.jsx]"]
  node_deal_history["Deal claims<br/>[customerDeals.js]"]
  node_loyalty_discovery["Loyalty discovery"]
  node_customer_history["Account history<br/>[useAllHistory.js]"]
end

subgraph group_business["Business features"]
  node_business_portal["Business portal<br/>[BusinessPortal.jsx]"]
  node_business_context["Business identity"]
  node_business_deals["Deal management"]
  node_redemption["Deal redemption"]
  node_business_loyalty["Loyalty management"]
  node_dashboard["Business dashboard"]
end

subgraph group_marketplace["Service marketplace"]
  node_marketplace_page["Marketplace workspace"]
  node_marketplace_flow["Lead and quote workflow"]
  node_customer_jobs["Customer job workflow<br/>[useCustomerJobs.js]"]
  node_job_api["Job requests API<br/>[customerJobs.js]"]
end

subgraph group_shared["Shared services"]
  node_location["Address and maps"]
  node_supabase_client["Supabase client<br/>[supabase.js]"]
end

node_visitor(("Customer or business"))
node_supabase_service[("Supabase")]
node_geoapify["Geoapify"]

node_visitor -->|"opens"| node_entry
node_entry -->|"wraps routes"| node_auth
node_entry -->|"routes to"| node_customer_portal
node_entry -->|"routes to"| node_business_portal
node_entry -->|"routes to"| node_registration
node_auth -->|"uses"| node_supabase_client
node_registration -->|"uses address search"| node_location
node_registration -->|"uses"| node_supabase_client
node_customer_portal -.->|"hosts"| node_customer_deals
node_customer_deals -.->|"loads claims"| node_deal_history
node_customer_history -->|"fetches claims"| node_deal_history
node_customer_history -->|"reads completed jobs"| node_job_api
node_customer_history -->|"queries jobs"| node_supabase_client
node_customer_history -->|"loads loyalty records"| node_supabase_client
node_customer_portal -.->|"hosts"| node_loyalty_discovery
node_business_portal -.->|"provides business context"| node_business_context
node_business_deals -->|"reads business"| node_business_context
node_business_loyalty -->|"reads business"| node_business_context
node_business_deals -.->|"manages deals"| node_deal_history
node_redemption -->|"reads business"| node_business_context
node_business_portal -.->|"hosts"| node_dashboard
node_marketplace_page -->|"uses workflow"| node_marketplace_flow
node_marketplace_flow -->|"reads business"| node_business_context
node_customer_jobs -->|"calls job operations"| node_job_api
node_job_api -->|"queries data"| node_supabase_client
node_location -.->|"searches addresses"| node_geoapify
node_supabase_client -->|"connects"| node_supabase_service

click node_entry "https://github.com/v-spnz/locallink-capstone/blob/main/src/app/App.jsx"
click node_auth "https://github.com/v-spnz/locallink-capstone/blob/main/src/auth/AuthProvider.jsx"
click node_registration "https://github.com/v-spnz/locallink-capstone/blob/main/src/pages/auth/RegisterPage.jsx"
click node_customer_portal "https://github.com/v-spnz/locallink-capstone/blob/main/src/pages/customer/CustomerPortal.jsx"
click node_customer_deals "https://github.com/v-spnz/locallink-capstone/blob/main/src/pages/customer/Deals.jsx"
click node_deal_history "https://github.com/v-spnz/locallink-capstone/blob/main/src/features/deals/api/customerDeals.js"
click node_loyalty_discovery "https://github.com/v-spnz/locallink-capstone/blob/main/src/features/loyalty/hooks/useLoyaltyDiscovery.js"
click node_customer_history "https://github.com/v-spnz/locallink-capstone/blob/main/src/pages/customer/hooks/useAllHistory.js"
click node_business_portal "https://github.com/v-spnz/locallink-capstone/blob/main/src/pages/business/BusinessPortal.jsx"
click node_business_context "https://github.com/v-spnz/locallink-capstone/blob/main/src/business/BusinessProvider.jsx"
click node_business_deals "https://github.com/v-spnz/locallink-capstone/blob/main/src/features/deals/hooks/useBusinessDeals.js"
click node_redemption "https://github.com/v-spnz/locallink-capstone/blob/main/src/features/deals/hooks/useBusinessDealRedemption.js"
click node_business_loyalty "https://github.com/v-spnz/locallink-capstone/blob/main/src/features/loyalty/hooks/useBusinessLoyaltyProgrammes.js"
click node_dashboard "https://github.com/v-spnz/locallink-capstone/blob/main/src/features/dashboard/api/businessDashboard.js"
click node_marketplace_page "https://github.com/v-spnz/locallink-capstone/blob/main/src/pages/business/ServiceMarketplacePage.jsx"
click node_marketplace_flow "https://github.com/v-spnz/locallink-capstone/blob/main/src/features/service-marketplace/hooks/useBusinessMarketplace.js"
click node_customer_jobs "https://github.com/v-spnz/locallink-capstone/blob/main/src/features/service-marketplace/hooks/useCustomerJobs.js"
click node_job_api "https://github.com/v-spnz/locallink-capstone/blob/main/src/features/service-marketplace/api/customerJobs.js"
click node_location "https://github.com/v-spnz/locallink-capstone/blob/main/src/features/location/components/AddressAutocomplete.jsx"
click node_supabase_client "https://github.com/v-spnz/locallink-capstone/blob/main/src/lib/supabase.js"

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_entry,node_auth,node_registration toneBlue
class node_customer_portal,node_customer_deals,node_deal_history,node_loyalty_discovery,node_customer_history,node_supabase_service toneAmber
class node_business_portal,node_business_context,node_business_deals,node_redemption,node_business_loyalty,node_dashboard,node_geoapify toneMint
class node_marketplace_page,node_marketplace_flow,node_customer_jobs,node_job_api toneRose
class node_location,node_supabase_client,node_visitor toneIndigo
```

## Components

### App and identity

- [App routing](https://github.com/v-spnz/locallink-capstone/blob/main/src/app/App.jsx): `src/app/App.jsx`
- [Authentication](https://github.com/v-spnz/locallink-capstone/blob/main/src/auth/AuthProvider.jsx): `src/auth/AuthProvider.jsx`
- [Registration](https://github.com/v-spnz/locallink-capstone/blob/main/src/pages/auth/RegisterPage.jsx): `src/pages/auth/RegisterPage.jsx`

### Customer features

- [Customer portal](https://github.com/v-spnz/locallink-capstone/blob/main/src/pages/customer/CustomerPortal.jsx): `src/pages/customer/CustomerPortal.jsx`
- [Deal discovery](https://github.com/v-spnz/locallink-capstone/blob/main/src/pages/customer/Deals.jsx): `src/pages/customer/Deals.jsx`
- [Deal claims](https://github.com/v-spnz/locallink-capstone/blob/main/src/features/deals/api/customerDeals.js): `src/features/deals/api/customerDeals.js`
- [Loyalty discovery](https://github.com/v-spnz/locallink-capstone/blob/main/src/features/loyalty/hooks/useLoyaltyDiscovery.js): `src/features/loyalty/hooks/useLoyaltyDiscovery.js`
- [Account history](https://github.com/v-spnz/locallink-capstone/blob/main/src/pages/customer/hooks/useAllHistory.js): `src/pages/customer/hooks/useAllHistory.js`

### Business features

- [Business portal](https://github.com/v-spnz/locallink-capstone/blob/main/src/pages/business/BusinessPortal.jsx): `src/pages/business/BusinessPortal.jsx`
- [Business identity](https://github.com/v-spnz/locallink-capstone/blob/main/src/business/BusinessProvider.jsx): `src/business/BusinessProvider.jsx`
- [Deal management](https://github.com/v-spnz/locallink-capstone/blob/main/src/features/deals/hooks/useBusinessDeals.js): `src/features/deals/hooks/useBusinessDeals.js`
- [Deal redemption](https://github.com/v-spnz/locallink-capstone/blob/main/src/features/deals/hooks/useBusinessDealRedemption.js): `src/features/deals/hooks/useBusinessDealRedemption.js`
- [Loyalty management](https://github.com/v-spnz/locallink-capstone/blob/main/src/features/loyalty/hooks/useBusinessLoyaltyProgrammes.js): `src/features/loyalty/hooks/useBusinessLoyaltyProgrammes.js`
- [Business dashboard](https://github.com/v-spnz/locallink-capstone/blob/main/src/features/dashboard/api/businessDashboard.js): `src/features/dashboard/api/businessDashboard.js`

### Service marketplace

- [Marketplace workspace](https://github.com/v-spnz/locallink-capstone/blob/main/src/pages/business/ServiceMarketplacePage.jsx): `src/pages/business/ServiceMarketplacePage.jsx`
- [Lead and quote workflow](https://github.com/v-spnz/locallink-capstone/blob/main/src/features/service-marketplace/hooks/useBusinessMarketplace.js): `src/features/service-marketplace/hooks/useBusinessMarketplace.js`
- [Customer job workflow](https://github.com/v-spnz/locallink-capstone/blob/main/src/features/service-marketplace/hooks/useCustomerJobs.js): `src/features/service-marketplace/hooks/useCustomerJobs.js`
- [Job requests API](https://github.com/v-spnz/locallink-capstone/blob/main/src/features/service-marketplace/api/customerJobs.js): `src/features/service-marketplace/api/customerJobs.js`

### Shared services

- [Address and maps](https://github.com/v-spnz/locallink-capstone/blob/main/src/features/location/components/AddressAutocomplete.jsx): `src/features/location/components/AddressAutocomplete.jsx`
- [Supabase client](https://github.com/v-spnz/locallink-capstone/blob/main/src/lib/supabase.js): `src/lib/supabase.js`

### Other components

- **Customer or business**
- **Supabase**
- **Geoapify**

## Connections

- Customer or business → App routing: opens
- App routing → Authentication: wraps routes (evidence: `src/main.jsx`)
- App routing → Customer portal: routes to (evidence: `src/app/App.jsx`)
- App routing → Business portal: routes to (evidence: `src/app/App.jsx`)
- App routing → Registration: routes to (evidence: `src/app/App.jsx`)
- Authentication → Supabase client: uses (evidence: `src/auth/AuthProvider.jsx`)
- Registration → Address and maps: uses address search (evidence: `src/pages/auth/RegisterPage.jsx`)
- Registration → Supabase client: uses (evidence: `src/pages/auth/RegisterPage.jsx`)
- Customer portal → Deal discovery: hosts
- Deal discovery → Deal claims: loads claims
- Account history → Deal claims: fetches claims (evidence: `src/pages/customer/hooks/useAllHistory.js`)
- Account history → Job requests API: reads completed jobs (evidence: `src/pages/customer/hooks/useAllHistory.js`)
- Account history → Supabase client: queries jobs (evidence: `src/pages/customer/hooks/useAllHistory.js`)
- Account history → Supabase client: loads loyalty records (evidence: `src/pages/customer/hooks/useAllHistory.js`)
- Customer portal → Loyalty discovery: hosts
- Business portal → Business identity: provides business context
- Deal management → Business identity: reads business (evidence: `src/features/deals/hooks/useBusinessDeals.js`)
- Loyalty management → Business identity: reads business (evidence: `src/features/loyalty/hooks/useBusinessLoyaltyProgrammes.js`)
- Deal management → Deal claims: manages deals
- Deal redemption → Business identity: reads business (evidence: `src/features/deals/hooks/useBusinessDealRedemption.js`)
- Business portal → Business dashboard: hosts
- Marketplace workspace → Lead and quote workflow: uses workflow (evidence: `src/pages/business/ServiceMarketplacePage.jsx`)
- Lead and quote workflow → Business identity: reads business (evidence: `src/features/service-marketplace/hooks/useBusinessMarketplace.js`)
- Customer job workflow → Job requests API: calls job operations (evidence: `src/features/service-marketplace/hooks/useCustomerJobs.js`)
- Job requests API → Supabase client: queries data (evidence: `src/features/service-marketplace/api/customerJobs.js`)
- Address and maps → Geoapify: searches addresses (evidence: `README.md`)
- Supabase client → Supabase: connects (evidence: `src/lib/supabase.js`)
