# sanjaykolapkar02-sys/gigworker architecture

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

- Interactive diagram: https://gitdiagram.com/sanjaykolapkar02-sys/gigworker
- Repository: https://github.com/sanjaykolapkar02-sys/gigworker

## Overview

GigShield is a React financial-identity app for gig workers. The main journey is phone/OTP sign-in, asset onboarding, then viewing a GigScore and income outlook; users can also access their GigID and transaction history or participate in fundraisers. Admins review workers and submit selected users to a B2B mediation endpoint. The frontend currently uses a mock-enabled API client. Edges reflect explicit README contracts or shown imports/calls; unexcerpted feature implementations are represented by their exact tree paths, without assuming internal links.

Main entry points: [`src/App.js`](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/App.js) (Route application), [`src/pages/DashboardPage.jsx`](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/pages/DashboardPage.jsx) (Dashboard page), [`src/services/api.js`](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/services/api.js) (API client), [`src/components/admin/MediationPipelineTable.jsx`](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/admin/MediationPipelineTable.jsx) (Mediation pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access &amp; onboarding"]
  node_login["Phone login<br/>[PhoneLogin.jsx]"]
  node_otp["OTP verification<br/>[OtpVerify.jsx]"]
  node_onboarding["Asset wizard<br/>[AssetWizard.jsx]"]
  node_authhook["Authentication state<br/>[useAuth.js]"]
end

subgraph group_identity["Score &amp; identity"]
  node_dashboard["Dashboard page<br/>[DashboardPage.jsx]"]
  node_dashboardhook["Dashboard data<br/>[useDashboard.js]"]
  node_score["GigScore display<br/>[GigScoreRing.jsx]"]
  node_income["Income forecast"]
  node_actions["Quick actions<br/>[QuickActions.jsx]"]
  node_profile["Profile page<br/>[ProfilePage.jsx]"]
  node_gigid["GigID card<br/>[GigIDCard.jsx]"]
  node_transactions["Transaction history"]
end

subgraph group_community["Community support"]
  node_communitypage["Community page<br/>[CommunityPage.jsx]"]
  node_fundraiserfeed["Fundraiser feed<br/>[FundraiserFeed.jsx]"]
  node_donation["Donation card<br/>[DonationCard.jsx]"]
  node_fundraiserhook["Fundraiser data<br/>[useFundraisers.js]"]
end

subgraph group_operations["Partner operations"]
  node_adminpage["Admin panel<br/>[AdminPanelPage.jsx]"]
  node_mediation["Mediation pipeline"]
  node_b2b{{"B2B partner API"}}
end

subgraph group_foundation["App foundation"]
  node_app["Route application<br/>[App.js]"]
  node_api["API client<br/>[api.js]"]
  node_authlayout["Protected layout<br/>[AuthLayout.jsx]"]
  node_nav["Bottom navigation<br/>[BottomNav.jsx]"]
  node_topbar["Top bar<br/>[TopBar.jsx]"]
  node_empty["Empty state<br/>[EmptyState.jsx]"]
  node_spinner["Loading spinner<br/>[LoadingSpinner.jsx]"]
  node_currency["INR formatting<br/>[formatCurrency.js]"]
end

node_worker(("Gig worker"))
node_admin(("Admin"))

node_worker -->|"opens"| node_app
node_admin -->|"opens"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_otp
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_communitypage
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_onboarding
node_app -->|"routes to"| node_adminpage
node_login -->|"requests OTP"| node_api
node_otp -->|"verifies OTP"| node_api
node_onboarding -->|"uploads assets"| node_api
node_dashboard -->|"loads data"| node_dashboardhook
node_dashboard -->|"renders"| node_score
node_dashboard -->|"renders"| node_income
node_dashboard -->|"renders"| node_actions
node_dashboardhook -->|"fetches and refreshes"| node_api
node_profile -->|"renders"| node_gigid
node_profile -->|"renders"| node_transactions
node_transactions -->|"loads history"| node_api
node_communitypage -->|"renders"| node_fundraiserfeed
node_fundraiserfeed -->|"renders"| node_donation
node_fundraiserfeed -->|"uses data"| node_fundraiserhook
node_fundraiserhook -->|"loads and donates"| node_api
node_adminpage -->|"renders"| node_mediation
node_mediation -->|"loads users"| node_api
node_mediation -->|"sends selected users"| node_b2b
node_login -->|"uses"| node_topbar
node_onboarding -->|"uses"| node_topbar
node_dashboard -->|"renders"| node_topbar
node_dashboard -->|"renders error state"| node_empty
node_dashboard -->|"renders loading state"| node_spinner
node_mediation -->|"renders empty state"| node_empty
node_mediation -->|"renders loading state"| node_spinner
node_mediation -->|"formats amounts"| node_currency
node_income -->|"formats amounts"| node_currency
node_gigid -->|"formats amounts"| node_currency
node_authlayout -->|"renders"| node_nav
node_app -->|"wraps protected pages"| node_authlayout
node_authhook -->|"uses"| node_api

click node_app "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/App.js"
click node_login "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/auth/PhoneLogin.jsx"
click node_otp "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/auth/OtpVerify.jsx"
click node_onboarding "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/onboarding/AssetWizard.jsx"
click node_dashboard "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/pages/DashboardPage.jsx"
click node_dashboardhook "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/hooks/useDashboard.js"
click node_score "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/dashboard/GigScoreRing.jsx"
click node_income "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/dashboard/IncomePredictorChart.jsx"
click node_actions "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/dashboard/QuickActions.jsx"
click node_profile "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/pages/ProfilePage.jsx"
click node_gigid "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/profile/GigIDCard.jsx"
click node_transactions "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/profile/TransactionTimeline.jsx"
click node_communitypage "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/pages/CommunityPage.jsx"
click node_fundraiserfeed "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/community/FundraiserFeed.jsx"
click node_donation "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/community/DonationCard.jsx"
click node_fundraiserhook "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/hooks/useFundraisers.js"
click node_adminpage "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/pages/AdminPanelPage.jsx"
click node_mediation "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/admin/MediationPipelineTable.jsx"
click node_api "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/services/api.js"
click node_authhook "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/hooks/useAuth.js"
click node_authlayout "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/shared/AuthLayout.jsx"
click node_nav "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/shared/BottomNav.jsx"
click node_topbar "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/shared/TopBar.jsx"
click node_empty "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/shared/EmptyState.jsx"
click node_spinner "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/shared/LoadingSpinner.jsx"
click node_currency "https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/utils/formatCurrency.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_login,node_otp,node_onboarding,node_authhook toneBlue
class node_dashboard,node_dashboardhook,node_score,node_income,node_actions,node_profile,node_gigid,node_transactions toneAmber
class node_communitypage,node_fundraiserfeed,node_donation,node_fundraiserhook toneMint
class node_adminpage,node_mediation,node_b2b,node_worker toneRose
class node_app,node_api,node_authlayout,node_nav,node_topbar,node_empty,node_spinner,node_currency,node_admin toneIndigo
```

## Components

### Access & onboarding

- [Phone login](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/auth/PhoneLogin.jsx): `src/components/auth/PhoneLogin.jsx`
- [OTP verification](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/auth/OtpVerify.jsx): `src/components/auth/OtpVerify.jsx`
- [Asset wizard](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/onboarding/AssetWizard.jsx): `src/components/onboarding/AssetWizard.jsx`
- [Authentication state](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/hooks/useAuth.js): `src/hooks/useAuth.js`

### Score & identity

- [Dashboard page](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/pages/DashboardPage.jsx): `src/pages/DashboardPage.jsx`
- [Dashboard data](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/hooks/useDashboard.js): `src/hooks/useDashboard.js`
- [GigScore display](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/dashboard/GigScoreRing.jsx): `src/components/dashboard/GigScoreRing.jsx`
- [Income forecast](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/dashboard/IncomePredictorChart.jsx): `src/components/dashboard/IncomePredictorChart.jsx`
- [Quick actions](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/dashboard/QuickActions.jsx): `src/components/dashboard/QuickActions.jsx`
- [Profile page](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/pages/ProfilePage.jsx): `src/pages/ProfilePage.jsx`
- [GigID card](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/profile/GigIDCard.jsx): `src/components/profile/GigIDCard.jsx`
- [Transaction history](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/profile/TransactionTimeline.jsx): `src/components/profile/TransactionTimeline.jsx`

### Community support

- [Community page](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/pages/CommunityPage.jsx): `src/pages/CommunityPage.jsx`
- [Fundraiser feed](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/community/FundraiserFeed.jsx): `src/components/community/FundraiserFeed.jsx`
- [Donation card](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/community/DonationCard.jsx): `src/components/community/DonationCard.jsx`
- [Fundraiser data](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/hooks/useFundraisers.js): `src/hooks/useFundraisers.js`

### Partner operations

- [Admin panel](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/pages/AdminPanelPage.jsx): `src/pages/AdminPanelPage.jsx`
- [Mediation pipeline](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/admin/MediationPipelineTable.jsx): `src/components/admin/MediationPipelineTable.jsx`
- **B2B partner API**

### App foundation

- [Route application](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/App.js): `src/App.js`
- [API client](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/services/api.js): `src/services/api.js`
- [Protected layout](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/shared/AuthLayout.jsx): `src/components/shared/AuthLayout.jsx`
- [Bottom navigation](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/shared/BottomNav.jsx): `src/components/shared/BottomNav.jsx`
- [Top bar](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/shared/TopBar.jsx): `src/components/shared/TopBar.jsx`
- [Empty state](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/shared/EmptyState.jsx): `src/components/shared/EmptyState.jsx`
- [Loading spinner](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/components/shared/LoadingSpinner.jsx): `src/components/shared/LoadingSpinner.jsx`
- [INR formatting](https://github.com/sanjaykolapkar02-sys/gigworker/blob/main/src/utils/formatCurrency.js): `src/utils/formatCurrency.js`

### Other components

- **Gig worker**
- **Admin**

## Connections

- Gig worker → Route application: opens (evidence: `README.md`)
- Admin → Route application: opens (evidence: `README.md`)
- Route application → Phone login: routes to (evidence: `src/App.js`)
- Route application → OTP verification: routes to (evidence: `src/App.js`)
- Route application → Dashboard page: routes to (evidence: `src/App.js`)
- Route application → Community page: routes to (evidence: `src/App.js`)
- Route application → Profile page: routes to (evidence: `src/App.js`)
- Route application → Asset wizard: routes to (evidence: `src/App.js`)
- Route application → Admin panel: routes to (evidence: `src/App.js`)
- Phone login → API client: requests OTP (evidence: `src/components/auth/PhoneLogin.jsx`)
- OTP verification → API client: verifies OTP (evidence: `src/components/auth/OtpVerify.jsx`)
- Asset wizard → API client: uploads assets (evidence: `README.md`)
- Dashboard page → Dashboard data: loads data (evidence: `src/pages/DashboardPage.jsx`)
- Dashboard page → GigScore display: renders (evidence: `src/pages/DashboardPage.jsx`)
- Dashboard page → Income forecast: renders (evidence: `src/pages/DashboardPage.jsx`)
- Dashboard page → Quick actions: renders (evidence: `src/pages/DashboardPage.jsx`)
- Dashboard data → API client: fetches and refreshes (evidence: `src/hooks/useDashboard.js`)
- Profile page → GigID card: renders (evidence: `src/pages/ProfilePage.jsx`)
- Profile page → Transaction history: renders (evidence: `src/pages/ProfilePage.jsx`)
- Transaction history → API client: loads history (evidence: `README.md`)
- Community page → Fundraiser feed: renders (evidence: `src/pages/CommunityPage.jsx`)
- Fundraiser feed → Donation card: renders (evidence: `src/components/community/FundraiserFeed.jsx`)
- Fundraiser feed → Fundraiser data: uses data (evidence: `src/components/community/FundraiserFeed.jsx`)
- Fundraiser data → API client: loads and donates (evidence: `src/hooks/useFundraisers.js`)
- Admin panel → Mediation pipeline: renders (evidence: `src/pages/AdminPanelPage.jsx`)
- Mediation pipeline → API client: loads users (evidence: `src/components/admin/MediationPipelineTable.jsx`)
- Mediation pipeline → B2B partner API: sends selected users (evidence: `src/components/admin/MediationPipelineTable.jsx`)
- Phone login → Top bar: uses (evidence: `src/components/auth/PhoneLogin.jsx`)
- Asset wizard → Top bar: uses (evidence: `src/components/onboarding/AssetWizard.jsx`)
- Dashboard page → Top bar: renders (evidence: `src/pages/DashboardPage.jsx`)
- Dashboard page → Empty state: renders error state (evidence: `src/pages/DashboardPage.jsx`)
- Dashboard page → Loading spinner: renders loading state (evidence: `src/pages/DashboardPage.jsx`)
- Mediation pipeline → Empty state: renders empty state (evidence: `src/components/admin/MediationPipelineTable.jsx`)
- Mediation pipeline → Loading spinner: renders loading state (evidence: `src/components/admin/MediationPipelineTable.jsx`)
- Mediation pipeline → INR formatting: formats amounts (evidence: `src/components/admin/MediationPipelineTable.jsx`)
- Income forecast → INR formatting: formats amounts (evidence: `src/pages/DashboardPage.jsx`)
- GigID card → INR formatting: formats amounts (evidence: `src/components/profile/GigIDCard.jsx`)
- Protected layout → Bottom navigation: renders (evidence: `src/components/shared/AuthLayout.jsx`)
- Route application → Protected layout: wraps protected pages (evidence: `src/App.js`)
- Authentication state → API client: uses (evidence: `src/hooks/useAuth.js`)
