# p90752831-ai/number architecture

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

- Interactive diagram: https://gitdiagram.com/p90752831-ai/number
- Repository: https://github.com/p90752831-ai/number

## Overview

NUMBER is a Next.js identity-profile MVP: users register to receive a database-assigned number, enrich their profile, and let others find it by number or public profile link. The graph follows the evidenced page/component calls and documents database responsibilities from the README; unsampled storage and middleware behavior is not expanded into guessed flows.

Main entry points: [`lib/supabase/server.ts`](https://github.com/p90752831-ai/number/blob/main/lib/supabase/server.ts) (Server Supabase client), [`app/[number]/page.tsx`](https://github.com/p90752831-ai/number/blob/main/app/%5Bnumber%5D/page.tsx) (Public profile), [`app/search/page.tsx`](https://github.com/p90752831-ai/number/blob/main/app/search/page.tsx) (Number search), [`app/dashboard/page.tsx`](https://github.com/p90752831-ai/number/blob/main/app/dashboard/page.tsx) (Account dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Pages and discovery"]
  node_home["Home<br/>[page.tsx]"]
  node_search["Number search<br/>[page.tsx]"]
  node_public_profile["Public profile<br/>[page.tsx]"]
  node_marketplace["Marketplace placeholder<br/>[page.tsx]"]
end

subgraph group_identity["Accounts and profiles"]
  node_auth_pages["Login and register<br/>[page.tsx]"]
  node_auth_form["Authentication form<br/>[AuthForm.tsx]"]
  node_dashboard["Account dashboard<br/>[page.tsx]"]
  node_edit_page["Profile edit page<br/>[page.tsx]"]
  node_edit_form["Profile editor<br/>[EditForm.tsx]"]
  node_nav["Navigation<br/>[Nav.tsx]"]
  node_logout["Logout control<br/>[LogoutButton.tsx]"]
end

subgraph group_shared["Shared profile features"]
  node_profile_card["Profile card<br/>[ProfileCard.tsx]"]
  node_qr["QR code<br/>[Qr.tsx]"]
  node_search_form["Search form<br/>[SearchForm.tsx]"]
  node_links["Profile links and completion<br/>[links.ts]"]
  node_types["Profile types<br/>[types.ts]"]
end

subgraph group_platform["Data and services"]
  node_client["Browser Supabase client<br/>[client.ts]"]
  node_server["Server Supabase client<br/>[server.ts]"]
  node_schema[("Profiles, policies, triggers<br/>[schema.sql]")]
  node_supabase[("Supabase Auth, Postgres, Storage")]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_home
node_visitor -->|"registers or logs in"| node_auth_pages
node_home -->|"renders"| node_search_form
node_visitor -->|"searches number"| node_search
node_search -->|"renders"| node_search_form
node_search -->|"queries profiles"| node_server
node_visitor -->|"opens number link"| node_public_profile
node_public_profile -->|"queries profiles"| node_server
node_public_profile -->|"renders"| node_profile_card
node_home -->|"links to registration"| node_auth_pages
node_auth_pages -->|"renders"| node_auth_form
node_auth_pages -->|"renders"| node_auth_form
node_auth_form -->|"signs in or up"| node_client
node_auth_form -->|"requests authentication"| node_supabase
node_supabase -->|"assigns unique number"| node_schema
node_dashboard -->|"checks session and reads profile"| node_server
node_dashboard -->|"renders"| node_qr
node_visitor -->|"views account"| node_dashboard
node_edit_page -->|"checks session and reads profile"| node_server
node_edit_page -->|"renders"| node_edit_form
node_edit_form -->|"updates profile and avatar"| node_client
node_client -.->|"accesses data and storage"| node_supabase
node_server -->|"uses cookie session"| node_supabase
node_schema -->|"defines policies and triggers"| node_supabase
node_profile_card -->|"formats social links"| node_links
node_links -->|"uses profile shape"| node_types
node_dashboard -->|"calculates completion"| node_links
node_nav -->|"checks session"| node_server
node_nav -->|"renders"| node_logout
node_logout -->|"signs out"| node_client
node_profile_card -->|"renders profile data"| node_types
node_search -->|"uses profile data"| node_types
node_public_profile -->|"renders"| node_qr
node_qr -->|"encodes profile link"| node_public_profile
node_visitor -->|"views placeholder"| node_marketplace

click node_home "https://github.com/p90752831-ai/number/blob/main/app/page.tsx"
click node_search "https://github.com/p90752831-ai/number/blob/main/app/search/page.tsx"
click node_public_profile "https://github.com/p90752831-ai/number/blob/main/app/%5Bnumber%5D/page.tsx"
click node_marketplace "https://github.com/p90752831-ai/number/blob/main/app/marketplace/page.tsx"
click node_auth_pages "https://github.com/p90752831-ai/number/blob/main/app/login/page.tsx"
click node_auth_form "https://github.com/p90752831-ai/number/blob/main/components/AuthForm.tsx"
click node_dashboard "https://github.com/p90752831-ai/number/blob/main/app/dashboard/page.tsx"
click node_edit_page "https://github.com/p90752831-ai/number/blob/main/app/profile/edit/page.tsx"
click node_edit_form "https://github.com/p90752831-ai/number/blob/main/components/EditForm.tsx"
click node_nav "https://github.com/p90752831-ai/number/blob/main/components/Nav.tsx"
click node_logout "https://github.com/p90752831-ai/number/blob/main/components/LogoutButton.tsx"
click node_profile_card "https://github.com/p90752831-ai/number/blob/main/components/ProfileCard.tsx"
click node_qr "https://github.com/p90752831-ai/number/blob/main/components/Qr.tsx"
click node_search_form "https://github.com/p90752831-ai/number/blob/main/components/SearchForm.tsx"
click node_links "https://github.com/p90752831-ai/number/blob/main/lib/links.ts"
click node_types "https://github.com/p90752831-ai/number/blob/main/lib/types.ts"
click node_client "https://github.com/p90752831-ai/number/blob/main/lib/supabase/client.ts"
click node_server "https://github.com/p90752831-ai/number/blob/main/lib/supabase/server.ts"
click node_schema "https://github.com/p90752831-ai/number/blob/main/supabase/schema.sql"

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_home,node_search,node_public_profile,node_marketplace toneBlue
class node_auth_pages,node_auth_form,node_dashboard,node_edit_page,node_edit_form,node_nav,node_logout toneAmber
class node_profile_card,node_qr,node_search_form,node_links,node_types toneMint
class node_client,node_server,node_schema,node_supabase toneRose
class node_visitor toneIndigo
```

## Components

### Pages and discovery

- [Home](https://github.com/p90752831-ai/number/blob/main/app/page.tsx): `app/page.tsx`
- [Number search](https://github.com/p90752831-ai/number/blob/main/app/search/page.tsx): `app/search/page.tsx`
- [Public profile](https://github.com/p90752831-ai/number/blob/main/app/%5Bnumber%5D/page.tsx): `app/[number]/page.tsx`
- [Marketplace placeholder](https://github.com/p90752831-ai/number/blob/main/app/marketplace/page.tsx): `app/marketplace/page.tsx`

### Accounts and profiles

- [Login and register](https://github.com/p90752831-ai/number/blob/main/app/login/page.tsx): `app/login/page.tsx`
- [Authentication form](https://github.com/p90752831-ai/number/blob/main/components/AuthForm.tsx): `components/AuthForm.tsx`
- [Account dashboard](https://github.com/p90752831-ai/number/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Profile edit page](https://github.com/p90752831-ai/number/blob/main/app/profile/edit/page.tsx): `app/profile/edit/page.tsx`
- [Profile editor](https://github.com/p90752831-ai/number/blob/main/components/EditForm.tsx): `components/EditForm.tsx`
- [Navigation](https://github.com/p90752831-ai/number/blob/main/components/Nav.tsx): `components/Nav.tsx`
- [Logout control](https://github.com/p90752831-ai/number/blob/main/components/LogoutButton.tsx): `components/LogoutButton.tsx`

### Shared profile features

- [Profile card](https://github.com/p90752831-ai/number/blob/main/components/ProfileCard.tsx): `components/ProfileCard.tsx`
- [QR code](https://github.com/p90752831-ai/number/blob/main/components/Qr.tsx): `components/Qr.tsx`
- [Search form](https://github.com/p90752831-ai/number/blob/main/components/SearchForm.tsx): `components/SearchForm.tsx`
- [Profile links and completion](https://github.com/p90752831-ai/number/blob/main/lib/links.ts): `lib/links.ts`
- [Profile types](https://github.com/p90752831-ai/number/blob/main/lib/types.ts): `lib/types.ts`

### Data and services

- [Browser Supabase client](https://github.com/p90752831-ai/number/blob/main/lib/supabase/client.ts): `lib/supabase/client.ts`
- [Server Supabase client](https://github.com/p90752831-ai/number/blob/main/lib/supabase/server.ts): `lib/supabase/server.ts`
- [Profiles, policies, triggers](https://github.com/p90752831-ai/number/blob/main/supabase/schema.sql): `supabase/schema.sql`
- **Supabase Auth, Postgres, Storage**

### Other components

- **Visitor**

## Connections

- Visitor → Home: opens (evidence: `README.md`)
- Visitor → Login and register: registers or logs in (evidence: `README.md`)
- Home → Search form: renders (evidence: `app/page.tsx`)
- Visitor → Number search: searches number (evidence: `README.md`)
- Number search → Search form: renders (evidence: `app/search/page.tsx`)
- Number search → Server Supabase client: queries profiles (evidence: `app/search/page.tsx`)
- Visitor → Public profile: opens number link (evidence: `README.md`)
- Public profile → Server Supabase client: queries profiles (evidence: `app/[number]/page.tsx`)
- Public profile → Profile card: renders (evidence: `app/[number]/page.tsx`)
- Home → Login and register: links to registration (evidence: `app/page.tsx`)
- Login and register → Authentication form: renders (evidence: `app/login/page.tsx`)
- Login and register → Authentication form: renders (evidence: `app/login/page.tsx`)
- Authentication form → Browser Supabase client: signs in or up (evidence: `components/AuthForm.tsx`)
- Authentication form → Supabase Auth, Postgres, Storage: requests authentication (evidence: `components/AuthForm.tsx`)
- Supabase Auth, Postgres, Storage → Profiles, policies, triggers: assigns unique number (evidence: `README.md`)
- Account dashboard → Server Supabase client: checks session and reads profile (evidence: `app/dashboard/page.tsx`)
- Account dashboard → QR code: renders (evidence: `app/dashboard/page.tsx`)
- Visitor → Account dashboard: views account (evidence: `README.md`)
- Profile edit page → Server Supabase client: checks session and reads profile (evidence: `app/profile/edit/page.tsx`)
- Profile edit page → Profile editor: renders (evidence: `app/profile/edit/page.tsx`)
- Profile editor → Browser Supabase client: updates profile and avatar (evidence: `components/EditForm.tsx`)
- Browser Supabase client → Supabase Auth, Postgres, Storage: accesses data and storage
- Server Supabase client → Supabase Auth, Postgres, Storage: uses cookie session (evidence: `lib/supabase/server.ts`)
- Profiles, policies, triggers → Supabase Auth, Postgres, Storage: defines policies and triggers (evidence: `README.md`)
- Profile card → Profile links and completion: formats social links (evidence: `components/ProfileCard.tsx`)
- Profile links and completion → Profile types: uses profile shape (evidence: `lib/links.ts`)
- Account dashboard → Profile links and completion: calculates completion (evidence: `app/dashboard/page.tsx`)
- Navigation → Server Supabase client: checks session (evidence: `components/Nav.tsx`)
- Navigation → Logout control: renders (evidence: `components/Nav.tsx`)
- Logout control → Browser Supabase client: signs out (evidence: `components/LogoutButton.tsx`)
- Profile card → Profile types: renders profile data (evidence: `components/ProfileCard.tsx`)
- Number search → Profile types: uses profile data (evidence: `app/search/page.tsx`)
- Public profile → QR code: renders (evidence: `app/[number]/page.tsx`)
- QR code → Public profile: encodes profile link (evidence: `README.md`)
- Visitor → Marketplace placeholder: views placeholder (evidence: `README.md`)
