# amarnath2007/project-zipbi architecture

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

- Interactive diagram: https://gitdiagram.com/amarnath2007/project-zipbi
- Repository: https://github.com/amarnath2007/project-zipbi

## Overview

ZipBi is a cafe-discovery and business-management platform with public, owner-admin, and super-admin portals. Visitors explore approved listings; owners create and update listings, menus, and operating details, then submit them for review; super admins review submissions, manage businesses and admins, and monitor activity. The React routes lead to feature pages, which use a shared Supabase client for data operations. The README documents the wider Supabase/PostgreSQL and Google Maps/Drive capabilities; source excerpts show selected client calls and utility usage, not every feature’s implementation or database operation.

Main entry points: [`src/lib/supabase/client.ts`](https://github.com/amarnath2007/project-zipbi/blob/main/src/lib/supabase/client.ts) (Supabase Client), [`src/routes/index.tsx`](https://github.com/amarnath2007/project-zipbi/blob/main/src/routes/index.tsx) (Role-based Routes), [`src/features/normal-admin/wizard/NormalAdminWizardPage.tsx`](https://github.com/amarnath2007/project-zipbi/blob/main/src/features/normal-admin/wizard/NormalAdminWizardPage.tsx) (Listing Wizard), [`src/features/auth/AuthContext.tsx`](https://github.com/amarnath2007/project-zipbi/blob/main/src/features/auth/AuthContext.tsx) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and Access"]
  node_app["Application Root<br/>[App.tsx]"]
  node_routes["Role-based Routes<br/>[index.tsx]"]
  node_auth["Authentication<br/>[AuthContext.tsx]"]
end

subgraph group_discovery["Public Discovery"]
  node_directory["Public Directory"]
end

subgraph group_owner["Owner Administration"]
  node_normal_admin["Owner Portal"]
  node_owner_wizard["Listing Wizard"]
  node_location_picker["Location Picker"]
end

subgraph group_control["Super Admin"]
  node_super_overview["Admin Overview<br/>[OverviewPage.tsx]"]
  node_business_admin["Business Registry"]
  node_review_queue["Review Queue"]
  node_review_detail["Review Detail"]
  node_team_admin["Team Management<br/>[AdminTeamPage.tsx]"]
  node_activity_logs["Activity Logs"]
  node_settings["Platform Settings<br/>[SettingsPage.tsx]"]
end

subgraph group_services["Data and Utilities"]
  node_menu_parser["Menu Parser<br/>[menuParser.ts]"]
  node_data_client["Supabase Client<br/>[client.ts]"]
  node_query_cache["Query Cache<br/>[queryCache.ts]"]
  node_formatters["Domain Formatters<br/>[formatters.ts]"]
  node_invite_function["Invite Edge Function<br/>[index.ts]"]
end

node_visitor(("Visitor"))
node_admin_user(("Admin User"))
node_google_drive["Google Drive"]
node_maps_service["Google Maps"]
node_supabase[("Supabase Database")]

node_app -->|"provides auth"| node_auth
node_app -->|"renders routes"| node_routes
node_routes -->|"routes to"| node_directory
node_routes -->|"routes to"| node_normal_admin
node_routes -->|"routes to"| node_super_overview
node_routes -->|"routes to"| node_business_admin
node_routes -->|"routes to"| node_review_queue
node_routes -->|"routes to"| node_review_detail
node_routes -->|"routes to"| node_team_admin
node_routes -->|"routes to"| node_activity_logs
node_routes -->|"routes to"| node_settings
node_visitor -->|"explores listings"| node_directory
node_admin_user -->|"authenticates"| node_auth
node_admin_user -->|"manages listings"| node_normal_admin
node_auth -->|"loads session"| node_data_client
node_auth -->|"invokes function"| node_invite_function
node_directory -->|"loads listings"| node_data_client
node_normal_admin -->|"uses data API"| node_data_client
node_normal_admin -.->|"hosts wizard"| node_owner_wizard
node_owner_wizard -->|"saves listing"| node_data_client
node_owner_wizard -->|"uses picker"| node_location_picker
node_owner_wizard -->|"parses menu"| node_menu_parser
node_owner_wizard -->|"parses media links"| node_google_drive
node_owner_wizard -->|"validates map links"| node_maps_service
node_owner_wizard -->|"formats timings"| node_formatters
node_super_overview -->|"loads metrics"| node_data_client
node_super_overview -->|"caches queries"| node_query_cache
node_business_admin -.->|"manages records"| node_data_client
node_review_queue -->|"loads submissions"| node_data_client
node_review_detail -->|"updates reviews"| node_data_client
node_team_admin -->|"manages admins"| node_data_client
node_activity_logs -.->|"loads audit trail"| node_data_client
node_settings -->|"uses data API"| node_data_client
node_data_client -->|"reads and writes"| node_supabase
node_data_client -->|"deduplicates requests"| node_query_cache
node_invite_function -.->|"uses backend"| node_supabase

click node_app "https://github.com/amarnath2007/project-zipbi/blob/main/src/App.tsx"
click node_routes "https://github.com/amarnath2007/project-zipbi/blob/main/src/routes/index.tsx"
click node_auth "https://github.com/amarnath2007/project-zipbi/blob/main/src/features/auth/AuthContext.tsx"
click node_directory "https://github.com/amarnath2007/project-zipbi/blob/main/src/features/directory/PublicDirectoryPage.tsx"
click node_normal_admin "https://github.com/amarnath2007/project-zipbi/tree/main/src/features/normal-admin"
click node_owner_wizard "https://github.com/amarnath2007/project-zipbi/blob/main/src/features/normal-admin/wizard/NormalAdminWizardPage.tsx"
click node_location_picker "https://github.com/amarnath2007/project-zipbi/blob/main/src/components/map/LocationPickerMap.tsx"
click node_menu_parser "https://github.com/amarnath2007/project-zipbi/blob/main/src/lib/utils/menuParser.ts"
click node_super_overview "https://github.com/amarnath2007/project-zipbi/blob/main/src/features/super-admin/overview/OverviewPage.tsx"
click node_business_admin "https://github.com/amarnath2007/project-zipbi/tree/main/src/features/super-admin/businesses"
click node_review_queue "https://github.com/amarnath2007/project-zipbi/blob/main/src/features/super-admin/reviews/ReviewQueuePage.tsx"
click node_review_detail "https://github.com/amarnath2007/project-zipbi/blob/main/src/features/super-admin/reviews/ReviewDetailPage.tsx"
click node_team_admin "https://github.com/amarnath2007/project-zipbi/blob/main/src/features/super-admin/team/AdminTeamPage.tsx"
click node_activity_logs "https://github.com/amarnath2007/project-zipbi/blob/main/src/features/super-admin/activity/ActivityLogsPage.tsx"
click node_settings "https://github.com/amarnath2007/project-zipbi/blob/main/src/features/super-admin/settings/SettingsPage.tsx"
click node_data_client "https://github.com/amarnath2007/project-zipbi/blob/main/src/lib/supabase/client.ts"
click node_query_cache "https://github.com/amarnath2007/project-zipbi/blob/main/src/lib/cache/queryCache.ts"
click node_formatters "https://github.com/amarnath2007/project-zipbi/blob/main/src/lib/utils/formatters.ts"
click node_invite_function "https://github.com/amarnath2007/project-zipbi/blob/main/supabase/functions/invite-admin/index.ts"

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_routes,node_auth,node_admin_user toneBlue
class node_directory,node_supabase toneAmber
class node_normal_admin,node_owner_wizard,node_location_picker toneMint
class node_super_overview,node_business_admin,node_review_queue,node_review_detail,node_team_admin,node_activity_logs,node_settings toneRose
class node_menu_parser,node_data_client,node_query_cache,node_formatters,node_invite_function,node_visitor,node_google_drive,node_maps_service toneIndigo
```

## Components

### App and Access

- [Application Root](https://github.com/amarnath2007/project-zipbi/blob/main/src/App.tsx): `src/App.tsx`
- [Role-based Routes](https://github.com/amarnath2007/project-zipbi/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Authentication](https://github.com/amarnath2007/project-zipbi/blob/main/src/features/auth/AuthContext.tsx): `src/features/auth/AuthContext.tsx`

### Public Discovery

- [Public Directory](https://github.com/amarnath2007/project-zipbi/blob/main/src/features/directory/PublicDirectoryPage.tsx): `src/features/directory/PublicDirectoryPage.tsx`

### Owner Administration

- [Owner Portal](https://github.com/amarnath2007/project-zipbi/tree/main/src/features/normal-admin): `src/features/normal-admin`
- [Listing Wizard](https://github.com/amarnath2007/project-zipbi/blob/main/src/features/normal-admin/wizard/NormalAdminWizardPage.tsx): `src/features/normal-admin/wizard/NormalAdminWizardPage.tsx`
- [Location Picker](https://github.com/amarnath2007/project-zipbi/blob/main/src/components/map/LocationPickerMap.tsx): `src/components/map/LocationPickerMap.tsx`

### Super Admin

- [Admin Overview](https://github.com/amarnath2007/project-zipbi/blob/main/src/features/super-admin/overview/OverviewPage.tsx): `src/features/super-admin/overview/OverviewPage.tsx`
- [Business Registry](https://github.com/amarnath2007/project-zipbi/tree/main/src/features/super-admin/businesses): `src/features/super-admin/businesses`
- [Review Queue](https://github.com/amarnath2007/project-zipbi/blob/main/src/features/super-admin/reviews/ReviewQueuePage.tsx): `src/features/super-admin/reviews/ReviewQueuePage.tsx`
- [Review Detail](https://github.com/amarnath2007/project-zipbi/blob/main/src/features/super-admin/reviews/ReviewDetailPage.tsx): `src/features/super-admin/reviews/ReviewDetailPage.tsx`
- [Team Management](https://github.com/amarnath2007/project-zipbi/blob/main/src/features/super-admin/team/AdminTeamPage.tsx): `src/features/super-admin/team/AdminTeamPage.tsx`
- [Activity Logs](https://github.com/amarnath2007/project-zipbi/blob/main/src/features/super-admin/activity/ActivityLogsPage.tsx): `src/features/super-admin/activity/ActivityLogsPage.tsx`
- [Platform Settings](https://github.com/amarnath2007/project-zipbi/blob/main/src/features/super-admin/settings/SettingsPage.tsx): `src/features/super-admin/settings/SettingsPage.tsx`

### Data and Utilities

- [Menu Parser](https://github.com/amarnath2007/project-zipbi/blob/main/src/lib/utils/menuParser.ts): `src/lib/utils/menuParser.ts`
- [Supabase Client](https://github.com/amarnath2007/project-zipbi/blob/main/src/lib/supabase/client.ts): `src/lib/supabase/client.ts`
- [Query Cache](https://github.com/amarnath2007/project-zipbi/blob/main/src/lib/cache/queryCache.ts): `src/lib/cache/queryCache.ts`
- [Domain Formatters](https://github.com/amarnath2007/project-zipbi/blob/main/src/lib/utils/formatters.ts): `src/lib/utils/formatters.ts`
- [Invite Edge Function](https://github.com/amarnath2007/project-zipbi/blob/main/supabase/functions/invite-admin/index.ts): `supabase/functions/invite-admin/index.ts`

### Other components

- **Visitor**
- **Admin User**
- **Google Drive**
- **Google Maps**
- **Supabase Database**

## Connections

- Application Root → Authentication: provides auth (evidence: `src/App.tsx`)
- Application Root → Role-based Routes: renders routes (evidence: `src/App.tsx`)
- Role-based Routes → Public Directory: routes to (evidence: `src/routes/index.tsx`)
- Role-based Routes → Owner Portal: routes to (evidence: `src/routes/index.tsx`)
- Role-based Routes → Admin Overview: routes to (evidence: `src/routes/index.tsx`)
- Role-based Routes → Business Registry: routes to (evidence: `src/routes/index.tsx`)
- Role-based Routes → Review Queue: routes to (evidence: `src/routes/index.tsx`)
- Role-based Routes → Review Detail: routes to (evidence: `src/routes/index.tsx`)
- Role-based Routes → Team Management: routes to (evidence: `src/routes/index.tsx`)
- Role-based Routes → Activity Logs: routes to (evidence: `src/routes/index.tsx`)
- Role-based Routes → Platform Settings: routes to (evidence: `src/routes/index.tsx`)
- Visitor → Public Directory: explores listings (evidence: `README.md`)
- Admin User → Authentication: authenticates (evidence: `README.md`)
- Admin User → Owner Portal: manages listings (evidence: `README.md`)
- Authentication → Supabase Client: loads session (evidence: `src/features/auth/AuthContext.tsx`)
- Authentication → Invite Edge Function: invokes function (evidence: `src/features/auth/AuthContext.tsx`)
- Public Directory → Supabase Client: loads listings (evidence: `src/features/directory/PublicDirectoryPage.tsx`)
- Owner Portal → Supabase Client: uses data API (evidence: `src/features/normal-admin/wizard/NormalAdminWizardPage.tsx`)
- Owner Portal → Listing Wizard: hosts wizard
- Listing Wizard → Supabase Client: saves listing (evidence: `src/features/normal-admin/wizard/NormalAdminWizardPage.tsx`)
- Listing Wizard → Location Picker: uses picker (evidence: `src/features/normal-admin/wizard/NormalAdminWizardPage.tsx`)
- Listing Wizard → Menu Parser: parses menu (evidence: `src/features/normal-admin/wizard/NormalAdminWizardPage.tsx`)
- Listing Wizard → Google Drive: parses media links (evidence: `README.md`)
- Listing Wizard → Google Maps: validates map links (evidence: `README.md`)
- Listing Wizard → Domain Formatters: formats timings (evidence: `src/features/normal-admin/wizard/NormalAdminWizardPage.tsx`)
- Admin Overview → Supabase Client: loads metrics (evidence: `src/features/super-admin/overview/OverviewPage.tsx`)
- Admin Overview → Query Cache: caches queries (evidence: `src/features/super-admin/overview/OverviewPage.tsx`)
- Business Registry → Supabase Client: manages records (evidence: `src/features/super-admin/businesses/BusinessDetailsPage.tsx`)
- Review Queue → Supabase Client: loads submissions (evidence: `src/features/super-admin/reviews/ReviewQueuePage.tsx`)
- Review Detail → Supabase Client: updates reviews (evidence: `src/features/super-admin/reviews/ReviewDetailPage.tsx`)
- Team Management → Supabase Client: manages admins (evidence: `src/features/super-admin/team/AdminTeamPage.tsx`)
- Activity Logs → Supabase Client: loads audit trail
- Platform Settings → Supabase Client: uses data API (evidence: `src/features/super-admin/settings/SettingsPage.tsx`)
- Supabase Client → Supabase Database: reads and writes (evidence: `README.md`)
- Supabase Client → Query Cache: deduplicates requests (evidence: `src/lib/supabase/client.ts`)
- Invite Edge Function → Supabase Database: uses backend
