# jagrit0711/zuup-auth-worker architecture

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

- Interactive diagram: https://gitdiagram.com/jagrit0711/zuup-auth-worker
- Repository: https://github.com/jagrit0711/zuup-auth-worker

## Overview

Zuup Auth Gateway is a Cloudflare Worker-based authentication, identity, payment, and database proxy. Its principal workflow is that client applications send requests through the gateway, which protects credentials and mediates access to backend services; documented branches also cover SSO/OAuth, KYC, and admin operations. The excerpts show the admin console UI and public-page renderers, but not the gateway’s route implementation, so service-flow edges rely on README statements rather than inspected handler code.

Main entry points: [`src/index.ts`](https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/index.ts) (Auth Gateway), [`src/components/layout.ts`](https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/components/layout.ts) (Shared Page Layout), [`src/adminDashboard.ts`](https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/adminDashboard.ts) (Admin Console UI), [`src/routes/home.ts`](https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/routes/home.ts) (Home Page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gateway["Gateway Services"]
  node_worker["Auth Gateway<br/>[index.ts]"]
  node_database_proxy["Database Proxy<br/>[index.ts]"]
  node_identity["Identity and SSO<br/>[index.ts]"]
  node_kyc["KYC Verification<br/>[index.ts]"]
  node_payments["Payment Gateway<br/>[index.ts]"]
end

subgraph group_admin["Admin Console"]
  node_admin_ui["Admin Console UI<br/>[adminDashboard.ts]"]
end

subgraph group_web["Public Web"]
  node_home["Home Page<br/>[home.ts]"]
  node_docs["Documentation<br/>[docs.ts]"]
  node_api_pages["API and Policy Pages<br/>[pages.ts]"]
  node_layout["Shared Page Layout<br/>[layout.ts]"]
end

node_clients(("Client Apps"))
node_supabase[("Supabase")]
node_google["Google OAuth"]
node_digilocker["DigiLocker"]
node_razorpay["Razorpay"]
node_cloudflare["Cloudflare"]

node_clients -->|"send requests"| node_worker
node_worker -.->|"dispatches to"| node_database_proxy
node_database_proxy -->|"proxies queries"| node_supabase
node_worker -.->|"handles auth"| node_identity
node_identity -->|"syncs sessions"| node_supabase
node_identity -->|"exchanges codes"| node_google
node_worker -.->|"handles KYC"| node_kyc
node_kyc -->|"verifies identity"| node_digilocker
node_kyc -->|"stores details"| node_supabase
node_worker -.->|"handles payments"| node_payments
node_payments -->|"creates and verifies"| node_razorpay
node_payments -->|"syncs transactions"| node_supabase
node_cloudflare -->|"provides edge runtime"| node_worker
node_clients -.->|"uses console"| node_admin_ui
node_admin_ui -->|"manages data"| node_supabase
node_home -->|"renders with"| node_layout
node_docs -->|"renders with"| node_layout
node_api_pages -->|"renders with"| node_layout

click node_worker "https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/index.ts"
click node_database_proxy "https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/index.ts"
click node_identity "https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/index.ts"
click node_kyc "https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/index.ts"
click node_payments "https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/index.ts"
click node_admin_ui "https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/adminDashboard.ts"
click node_home "https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/routes/home.ts"
click node_docs "https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/routes/docs.ts"
click node_api_pages "https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/routes/pages.ts"
click node_layout "https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/components/layout.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_worker,node_database_proxy,node_identity,node_kyc,node_payments,node_clients toneBlue
class node_admin_ui,node_supabase toneAmber
class node_home,node_docs,node_api_pages,node_layout toneMint
class node_google,node_digilocker,node_razorpay,node_cloudflare toneIndigo
```

## Components

### Gateway Services

- [Auth Gateway](https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/index.ts): `src/index.ts`
- [Database Proxy](https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/index.ts): `src/index.ts`
- [Identity and SSO](https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/index.ts): `src/index.ts`
- [KYC Verification](https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/index.ts): `src/index.ts`
- [Payment Gateway](https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/index.ts): `src/index.ts`

### Admin Console

- [Admin Console UI](https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/adminDashboard.ts): `src/adminDashboard.ts`

### Public Web

- [Home Page](https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/routes/home.ts): `src/routes/home.ts`
- [Documentation](https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/routes/docs.ts): `src/routes/docs.ts`
- [API and Policy Pages](https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/routes/pages.ts): `src/routes/pages.ts`
- [Shared Page Layout](https://github.com/jagrit0711/zuup-auth-worker/blob/main/src/components/layout.ts): `src/components/layout.ts`

### Other components

- **Client Apps**
- **Supabase**
- **Google OAuth**
- **DigiLocker**
- **Razorpay**
- **Cloudflare**

## Connections

- Client Apps → Auth Gateway: send requests (evidence: `README.md`)
- Auth Gateway → Database Proxy: dispatches to
- Database Proxy → Supabase: proxies queries (evidence: `README.md`)
- Auth Gateway → Identity and SSO: handles auth
- Identity and SSO → Supabase: syncs sessions (evidence: `README.md`)
- Identity and SSO → Google OAuth: exchanges codes (evidence: `README.md`)
- Auth Gateway → KYC Verification: handles KYC
- KYC Verification → DigiLocker: verifies identity (evidence: `README.md`)
- KYC Verification → Supabase: stores details (evidence: `README.md`)
- Auth Gateway → Payment Gateway: handles payments
- Payment Gateway → Razorpay: creates and verifies (evidence: `README.md`)
- Payment Gateway → Supabase: syncs transactions (evidence: `README.md`)
- Cloudflare → Auth Gateway: provides edge runtime (evidence: `README.md`)
- Client Apps → Admin Console UI: uses console
- Admin Console UI → Supabase: manages data (evidence: `README.md`)
- Home Page → Shared Page Layout: renders with (evidence: `src/routes/home.ts`)
- Documentation → Shared Page Layout: renders with (evidence: `src/routes/docs.ts`)
- API and Policy Pages → Shared Page Layout: renders with (evidence: `src/routes/pages.ts`)
