# nmndwivedi/archefy architecture

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

- Interactive diagram: https://gitdiagram.com/nmndwivedi/archefy
- Repository: https://github.com/nmndwivedi/archefy

## Overview

Archefy is a marketplace concept where product listings are NFTs representing physical products. Buyers browse a storefront and product pages; creators list products and investors can acquire fractional interests, with royalties ending at a creator-set deprecation date. The README also describes livestreams, wallet login, metadata storage, indexing, and token exit to collectibles. The sampled client shows a storefront, product-page video player, Firebase social login, and wallet connectors, but not the documented listing, purchase, backend, or contract workflows; those links are therefore shown only where documented.

Main entry points: [`archefy-client/pages`](https://github.com/nmndwivedi/archefy/tree/master/archefy-client/pages) (Product listing), [`archefy-client/pages/assemblies/Storefront.jsx`](https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/assemblies/Storefront.jsx) (Storefront), [`archefy-client/pages/components/Slideover.jsx`](https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/components/Slideover.jsx) (Account panel), [`archefy-client/pages/index.js`](https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/index.js) (Home page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_marketplace["Marketplace UI"]
  node_home["Home page<br/>[index.js]"]
  node_storefront["Storefront<br/>[Storefront.jsx]"]
  node_search["Search bar<br/>[SearchBar.jsx]"]
  node_productpage["Product page<br/>[&#91;id&#93;.jsx]"]
end

subgraph group_identity["Identity and wallets"]
  node_accountpanel["Account panel<br/>[Slideover.jsx]"]
  node_firebaseauth["Firebase auth<br/>[firebase.js]"]
  node_authstate["Auth state hook<br/>[useFirebase.js]"]
  node_walletconnectors["Wallet connectors<br/>[_app.js]"]
end

subgraph group_product["Product and creator flows"]
  node_listing["Product listing"]
  node_livestream["Product livestream<br/>[&#91;id&#93;.jsx]"]
  node_creatorstreamui["Creator stream UI<br/>[AppBody.jsx]"]
  node_livepeer["Livepeer"]
end

subgraph group_web3["Web3 and data"]
  node_graphqlapi["GraphQL API route<br/>[graphql.js]"]
  node_contract["ArchefyPath contract"]
  node_ipfs["IPFS metadata"]
  node_thegraph["The Graph indexer"]
end

node_buyer(("Buyer"))
node_creator(("Creator"))
node_investor(("Investor"))

node_buyer -->|"opens"| node_home
node_home -->|"renders"| node_storefront
node_storefront -->|"renders"| node_search
node_storefront -->|"opens"| node_accountpanel
node_buyer -.->|"views"| node_productpage
node_productpage -->|"plays"| node_livestream
node_livestream -.->|"streams video"| node_livepeer
node_creator -.->|"provides listing inputs"| node_listing
node_creator -.->|"arranges livestreams"| node_creatorstreamui
node_investor -.->|"connects wallet"| node_walletconnectors
node_accountpanel -->|"uses"| node_authstate
node_authstate -->|"calls sign-in and sign-out"| node_firebaseauth
node_accountpanel -->|"uses wallet hooks"| node_walletconnectors
node_listing -.->|"stores metadata"| node_ipfs
node_listing -.->|"records listing"| node_contract
node_contract -.->|"indexes sales data"| node_thegraph
node_listing -.->|"uses server API"| node_graphqlapi

click node_home "https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/index.js"
click node_storefront "https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/assemblies/Storefront.jsx"
click node_search "https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/components/SearchBar.jsx"
click node_productpage "https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/products/%5Bid%5D.jsx"
click node_accountpanel "https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/components/Slideover.jsx"
click node_firebaseauth "https://github.com/nmndwivedi/archefy/blob/master/archefy-client/firebase.js"
click node_authstate "https://github.com/nmndwivedi/archefy/blob/master/archefy-client/hooks/useFirebase.js"
click node_walletconnectors "https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/_app.js"
click node_listing "https://github.com/nmndwivedi/archefy/tree/master/archefy-client/pages"
click node_livestream "https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/products/%5Bid%5D.jsx"
click node_creatorstreamui "https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/components/AppBody.jsx"
click node_graphqlapi "https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/api/graphql.js"
click node_contract "https://github.com/nmndwivedi/archefy/tree/master/archefy-contracts/contracts"

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_storefront,node_search,node_productpage toneBlue
class node_accountpanel,node_firebaseauth,node_authstate,node_walletconnectors toneAmber
class node_listing,node_livestream,node_creatorstreamui,node_livepeer toneMint
class node_graphqlapi,node_contract,node_ipfs,node_thegraph toneRose
class node_buyer,node_creator,node_investor toneIndigo
```

## Components

### Marketplace UI

- [Home page](https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/index.js): `archefy-client/pages/index.js`
- [Storefront](https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/assemblies/Storefront.jsx): `archefy-client/pages/assemblies/Storefront.jsx`
- [Search bar](https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/components/SearchBar.jsx): `archefy-client/pages/components/SearchBar.jsx`
- [Product page](https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/products/%5Bid%5D.jsx): `archefy-client/pages/products/[id].jsx`

### Identity and wallets

- [Account panel](https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/components/Slideover.jsx): `archefy-client/pages/components/Slideover.jsx`
- [Firebase auth](https://github.com/nmndwivedi/archefy/blob/master/archefy-client/firebase.js): `archefy-client/firebase.js`
- [Auth state hook](https://github.com/nmndwivedi/archefy/blob/master/archefy-client/hooks/useFirebase.js): `archefy-client/hooks/useFirebase.js`
- [Wallet connectors](https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/_app.js): `archefy-client/pages/_app.js`

### Product and creator flows

- [Product listing](https://github.com/nmndwivedi/archefy/tree/master/archefy-client/pages): `archefy-client/pages`
- [Product livestream](https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/products/%5Bid%5D.jsx): `archefy-client/pages/products/[id].jsx`
- [Creator stream UI](https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/components/AppBody.jsx): `archefy-client/pages/components/AppBody.jsx`
- **Livepeer**

### Web3 and data

- [GraphQL API route](https://github.com/nmndwivedi/archefy/blob/master/archefy-client/pages/api/graphql.js): `archefy-client/pages/api/graphql.js`
- [ArchefyPath contract](https://github.com/nmndwivedi/archefy/tree/master/archefy-contracts/contracts): `archefy-contracts/contracts`
- **IPFS metadata**
- **The Graph indexer**

### Other components

- **Buyer**
- **Creator**
- **Investor**

## Connections

- Buyer → Home page: opens (evidence: `archefy-client/pages/index.js`)
- Home page → Storefront: renders (evidence: `archefy-client/pages/index.js`)
- Storefront → Search bar: renders (evidence: `archefy-client/pages/assemblies/Storefront.jsx`)
- Storefront → Account panel: opens (evidence: `archefy-client/pages/assemblies/Storefront.jsx`)
- Buyer → Product page: views (evidence: `README.md`)
- Product page → Product livestream: plays (evidence: `archefy-client/pages/products/[id].jsx`)
- Product livestream → Livepeer: streams video (evidence: `README.md`)
- Creator → Product listing: provides listing inputs (evidence: `README.md`)
- Creator → Creator stream UI: arranges livestreams (evidence: `README.md`)
- Investor → Wallet connectors: connects wallet (evidence: `README.md`)
- Account panel → Auth state hook: uses (evidence: `archefy-client/pages/components/Slideover.jsx`)
- Auth state hook → Firebase auth: calls sign-in and sign-out (evidence: `archefy-client/hooks/useFirebase.js`)
- Account panel → Wallet connectors: uses wallet hooks (evidence: `archefy-client/pages/components/Slideover.jsx`)
- Product listing → IPFS metadata: stores metadata (evidence: `README.md`)
- Product listing → ArchefyPath contract: records listing (evidence: `README.md`)
- ArchefyPath contract → The Graph indexer: indexes sales data (evidence: `README.md`)
- Product listing → GraphQL API route: uses server API (evidence: `README.md`)
