# neo193/oneclub-next architecture

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

- Interactive diagram: https://gitdiagram.com/neo193/oneclub-next
- Repository: https://github.com/neo193/oneclub-next

## Overview

One Club is a membership, benefits, events and partner-services application with public, member and staff experiences. The main user path runs from public membership information and authentication into a member portal, where members manage membership, pay, book events, browse benefits and request support. Staff workspaces administer members, events, partners, tiers, refunds and support. The graph reflects sampled code and the README; unsampled workspace internals are represented at their existing directory paths, without asserting their call details.

Main entry points: [`src/lib/auth/profile.ts`](https://github.com/neo193/oneclub-next/blob/main/src/lib/auth/profile.ts) (Profile and access), [`src/lib/supabase/server.ts`](https://github.com/neo193/oneclub-next/blob/main/src/lib/supabase/server.ts) (Server data client), [`src/lib/supabase/client.ts`](https://github.com/neo193/oneclub-next/blob/main/src/lib/supabase/client.ts) (Browser data client), [`src/app/(member)/portal`](https://github.com/neo193/oneclub-next/tree/main/src/app/(member)/portal) (Member portal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public site"]
  node_public_pages["Public pages"]
  node_public_content["Public content UI"]
  node_enquiry["Enquiry form<br/>[enquiry-form.tsx]"]
end

subgraph group_identity["Identity"]
  node_auth_pages["Login and invitations"]
  node_auth_ui["Authentication UI"]
  node_auth_callback["Auth callback<br/>[route.ts]"]
end

subgraph group_member["Member portal"]
  node_member_portal["Member portal"]
  node_member_features["Member services"]
  node_event_booking["Event booking"]
  node_membership_payment["Membership payment"]
end

subgraph group_operations["Staff operations"]
  node_staff_routes["Staff workspaces"]
  node_staff_ui["Staff administration"]
  node_diagnostics_route["Diagnostics API<br/>[route.ts]"]
end

subgraph group_platform["Services and data"]
  node_payment_client["Payment client<br/>[razorpay.ts]"]
  node_payment_function["Payment service<br/>[index.ts]"]
  node_deletion_function["Account deletion<br/>[index.ts]"]
  node_profile_auth["Profile and access<br/>[profile.ts]"]
  node_supabase_server["Server data client<br/>[server.ts]"]
  node_supabase_browser["Browser data client<br/>[client.ts]"]
  node_database_types["Database contract<br/>[database.ts]"]
  node_supabase[("Supabase")]
  node_razorpay["Razorpay"]
  node_cloudflare["Cloudflare APIs"]
end

node_visitor(("Visitor"))
node_member_actor(("Member"))
node_staff_actor(("Staff"))

node_visitor -->|"browses"| node_public_pages
node_public_pages -->|"renders"| node_public_content
node_public_pages -.->|"offers enquiries"| node_enquiry
node_visitor -.->|"signs in"| node_auth_pages
node_auth_pages -.->|"uses"| node_auth_ui
node_auth_pages -.->|"continues authentication"| node_auth_callback
node_auth_callback -->|"exchanges session"| node_supabase_server
node_auth_callback -->|"validates redirect"| node_profile_auth
node_member_actor -->|"uses"| node_member_portal
node_member_portal -->|"requires profile"| node_profile_auth
node_member_portal -->|"reads claims and tiers"| node_supabase_server
node_member_portal -->|"renders membership UI"| node_member_features
node_member_features -.->|"provides event booking"| node_event_booking
node_member_features -.->|"provides checkout"| node_membership_payment
node_event_booking -->|"uses data client"| node_supabase_browser
node_event_booking -->|"starts payment"| node_payment_client
node_membership_payment -->|"starts payment"| node_payment_client
node_payment_client -->|"gets session"| node_supabase_browser
node_payment_client -->|"calls service"| node_payment_function
node_payment_function -.->|"processes payment data"| node_supabase
node_payment_function -.->|"processes checkout"| node_razorpay
node_staff_actor -->|"uses"| node_staff_routes
node_staff_routes -.->|"presents workspaces"| node_staff_ui
node_staff_routes -->|"uses profile and navigation"| node_profile_auth
node_staff_ui -->|"uses data client"| node_supabase_browser
node_diagnostics_route -->|"checks access"| node_profile_auth
node_diagnostics_route -->|"queries diagnostics"| node_supabase_server
node_diagnostics_route -->|"checks deployment and security"| node_cloudflare
node_supabase_server -->|"creates server client"| node_supabase
node_supabase_browser -->|"creates browser client"| node_supabase
node_profile_auth -->|"loads profile"| node_supabase_server
node_profile_auth -->|"types profile"| node_database_types
node_supabase_server -->|"types queries"| node_database_types
node_supabase_browser -->|"types queries"| node_database_types
node_deletion_function -.->|"handles deletion"| node_supabase

click node_public_pages "https://github.com/neo193/oneclub-next/tree/main/src/app/(public)"
click node_public_content "https://github.com/neo193/oneclub-next/tree/main/src/components/public"
click node_enquiry "https://github.com/neo193/oneclub-next/blob/main/src/components/public/enquiry-form.tsx"
click node_auth_pages "https://github.com/neo193/oneclub-next/tree/main/src/app/(auth)"
click node_auth_ui "https://github.com/neo193/oneclub-next/tree/main/src/components/auth"
click node_auth_callback "https://github.com/neo193/oneclub-next/blob/main/src/app/auth/callback/route.ts"
click node_member_portal "https://github.com/neo193/oneclub-next/tree/main/src/app/(member)/portal"
click node_member_features "https://github.com/neo193/oneclub-next/tree/main/src/components/member"
click node_event_booking "https://github.com/neo193/oneclub-next/blob/main/src/components/member/event-booking-view.tsx"
click node_membership_payment "https://github.com/neo193/oneclub-next/blob/main/src/components/member/membership-payment.tsx"
click node_staff_routes "https://github.com/neo193/oneclub-next/tree/main/src/app/(staff)/staff"
click node_staff_ui "https://github.com/neo193/oneclub-next/tree/main/src/components/staff"
click node_diagnostics_route "https://github.com/neo193/oneclub-next/blob/main/src/app/api/technical-diagnostics/route.ts"
click node_payment_client "https://github.com/neo193/oneclub-next/blob/main/src/lib/payments/razorpay.ts"
click node_payment_function "https://github.com/neo193/oneclub-next/blob/main/supabase/functions/razorpay-payments/index.ts"
click node_deletion_function "https://github.com/neo193/oneclub-next/blob/main/supabase/functions/account-deletion/index.ts"
click node_profile_auth "https://github.com/neo193/oneclub-next/blob/main/src/lib/auth/profile.ts"
click node_supabase_server "https://github.com/neo193/oneclub-next/blob/main/src/lib/supabase/server.ts"
click node_supabase_browser "https://github.com/neo193/oneclub-next/blob/main/src/lib/supabase/client.ts"
click node_database_types "https://github.com/neo193/oneclub-next/blob/main/src/types/database.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_public_pages,node_public_content,node_enquiry toneBlue
class node_auth_pages,node_auth_ui,node_auth_callback toneAmber
class node_member_portal,node_member_features,node_event_booking,node_membership_payment toneMint
class node_staff_routes,node_staff_ui,node_diagnostics_route toneRose
class node_payment_client,node_payment_function,node_deletion_function,node_profile_auth,node_supabase_server,node_supabase_browser,node_database_types,node_supabase,node_razorpay,node_cloudflare,node_visitor,node_member_actor,node_staff_actor toneIndigo
```

## Components

### Public site

- [Public pages](https://github.com/neo193/oneclub-next/tree/main/src/app/(public)): `src/app/(public)`
- [Public content UI](https://github.com/neo193/oneclub-next/tree/main/src/components/public): `src/components/public`
- [Enquiry form](https://github.com/neo193/oneclub-next/blob/main/src/components/public/enquiry-form.tsx): `src/components/public/enquiry-form.tsx`

### Identity

- [Login and invitations](https://github.com/neo193/oneclub-next/tree/main/src/app/(auth)): `src/app/(auth)`
- [Authentication UI](https://github.com/neo193/oneclub-next/tree/main/src/components/auth): `src/components/auth`
- [Auth callback](https://github.com/neo193/oneclub-next/blob/main/src/app/auth/callback/route.ts): `src/app/auth/callback/route.ts`

### Member portal

- [Member portal](https://github.com/neo193/oneclub-next/tree/main/src/app/(member)/portal): `src/app/(member)/portal`
- [Member services](https://github.com/neo193/oneclub-next/tree/main/src/components/member): `src/components/member`
- [Event booking](https://github.com/neo193/oneclub-next/blob/main/src/components/member/event-booking-view.tsx): `src/components/member/event-booking-view.tsx`
- [Membership payment](https://github.com/neo193/oneclub-next/blob/main/src/components/member/membership-payment.tsx): `src/components/member/membership-payment.tsx`

### Staff operations

- [Staff workspaces](https://github.com/neo193/oneclub-next/tree/main/src/app/(staff)/staff): `src/app/(staff)/staff`
- [Staff administration](https://github.com/neo193/oneclub-next/tree/main/src/components/staff): `src/components/staff`
- [Diagnostics API](https://github.com/neo193/oneclub-next/blob/main/src/app/api/technical-diagnostics/route.ts): `src/app/api/technical-diagnostics/route.ts`

### Services and data

- [Payment client](https://github.com/neo193/oneclub-next/blob/main/src/lib/payments/razorpay.ts): `src/lib/payments/razorpay.ts`
- [Payment service](https://github.com/neo193/oneclub-next/blob/main/supabase/functions/razorpay-payments/index.ts): `supabase/functions/razorpay-payments/index.ts`
- [Account deletion](https://github.com/neo193/oneclub-next/blob/main/supabase/functions/account-deletion/index.ts): `supabase/functions/account-deletion/index.ts`
- [Profile and access](https://github.com/neo193/oneclub-next/blob/main/src/lib/auth/profile.ts): `src/lib/auth/profile.ts`
- [Server data client](https://github.com/neo193/oneclub-next/blob/main/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`
- [Browser data client](https://github.com/neo193/oneclub-next/blob/main/src/lib/supabase/client.ts): `src/lib/supabase/client.ts`
- [Database contract](https://github.com/neo193/oneclub-next/blob/main/src/types/database.ts): `src/types/database.ts`
- **Supabase**
- **Razorpay**
- **Cloudflare APIs**

### Other components

- **Visitor**
- **Member**
- **Staff**

## Connections

- Visitor → Public pages: browses (evidence: `README.md`)
- Public pages → Public content UI: renders (evidence: `src/app/(public)/about/page.tsx`)
- Public pages → Enquiry form: offers enquiries
- Visitor → Login and invitations: signs in
- Login and invitations → Authentication UI: uses
- Login and invitations → Auth callback: continues authentication
- Auth callback → Server data client: exchanges session (evidence: `src/app/auth/callback/route.ts`)
- Auth callback → Profile and access: validates redirect (evidence: `src/app/auth/callback/route.ts`)
- Member → Member portal: uses (evidence: `README.md`)
- Member portal → Profile and access: requires profile (evidence: `src/app/(member)/portal/page.tsx`)
- Member portal → Server data client: reads claims and tiers (evidence: `src/app/(member)/portal/page.tsx`)
- Member portal → Member services: renders membership UI (evidence: `src/app/(member)/portal/page.tsx`)
- Member services → Event booking: provides event booking
- Member services → Membership payment: provides checkout
- Event booking → Browser data client: uses data client (evidence: `src/components/member/event-booking-view.tsx`)
- Event booking → Payment client: starts payment (evidence: `src/components/member/event-booking-view.tsx`)
- Membership payment → Payment client: starts payment (evidence: `src/components/member/membership-payment.tsx`)
- Payment client → Browser data client: gets session (evidence: `src/lib/payments/razorpay.ts`)
- Payment client → Payment service: calls service (evidence: `src/lib/payments/razorpay.ts`)
- Payment service → Supabase: processes payment data
- Payment service → Razorpay: processes checkout
- Staff → Staff workspaces: uses (evidence: `README.md`)
- Staff workspaces → Staff administration: presents workspaces
- Staff workspaces → Profile and access: uses profile and navigation (evidence: `src/app/(staff)/staff/page.tsx`)
- Staff administration → Browser data client: uses data client (evidence: `src/components/staff/member-administration-workspace.tsx`)
- Diagnostics API → Profile and access: checks access (evidence: `src/app/api/technical-diagnostics/route.ts`)
- Diagnostics API → Server data client: queries diagnostics (evidence: `src/app/api/technical-diagnostics/route.ts`)
- Diagnostics API → Cloudflare APIs: checks deployment and security (evidence: `src/app/api/technical-diagnostics/route.ts`)
- Server data client → Supabase: creates server client (evidence: `src/lib/supabase/server.ts`)
- Browser data client → Supabase: creates browser client (evidence: `src/lib/supabase/client.ts`)
- Profile and access → Server data client: loads profile (evidence: `src/lib/auth/profile.ts`)
- Profile and access → Database contract: types profile (evidence: `src/lib/auth/profile.ts`)
- Server data client → Database contract: types queries (evidence: `src/lib/supabase/server.ts`)
- Browser data client → Database contract: types queries (evidence: `src/lib/supabase/client.ts`)
- Account deletion → Supabase: handles deletion
