# oceanprotocol/market architecture

> Architecture diagram of the GitHub repository oceanprotocol/market, 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/oceanprotocol/market
- Repository: https://github.com/oceanprotocol/market

## Overview

Ocean Marketplace is a Next.js data-market frontend. Users discover assets through home and search, inspect asset details, then buy or download them; publishers use a multi-step wizard to configure metadata, services, pricing, and submit on-chain and to the metadata cache. The graph preserves profile, messaging, privacy, wallet/network, and market-data capabilities identified by the tree and README. Some branches are documented or indexed but unsampled, so those relationships are omitted rather than inferred.

Main entry points: [`src/components/Publish/index.tsx`](https://github.com/oceanprotocol/market/blob/main/src/components/Publish/index.tsx) (Publish wizard), [`src/components/Search/index.tsx`](https://github.com/oceanprotocol/market/blob/main/src/components/Search/index.tsx) (Search results), [`src/components/Asset/AssetActions/index.tsx`](https://github.com/oceanprotocol/market/blob/main/src/components/Asset/AssetActions/index.tsx) (Buy and download), [`src/@utils/aquarius/index.ts`](https://github.com/oceanprotocol/market/blob/main/src/%40utils/aquarius/index.ts) (Aquarius client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routes["App routes"]
  node_home["Home<br/>[index.tsx]"]
  node_searchroute["Search route<br/>[search.tsx]"]
  node_assetroute["Asset route<br/>[index.tsx]"]
  node_publishroute["Publish route<br/>[&#91;step&#93;.tsx]"]
end

subgraph group_discovery["Asset discovery"]
  node_homeview["Home sections"]
  node_searchbar["Search bar<br/>[SearchBar.tsx]"]
  node_search["Search results<br/>[index.tsx]"]
  node_filters["Filters and sort<br/>[Filters.tsx]"]
  node_asset["Asset detail<br/>[index.tsx]"]
  node_assetactions["Buy and download<br/>[index.tsx]"]
end

subgraph group_publishing["Publishing"]
  node_publish["Publish wizard<br/>[index.tsx]"]
  node_publishsteps["Wizard steps<br/>[_constants.tsx]"]
  node_publishutils["Publish processing<br/>[_utils.ts]"]
end

subgraph group_account["Accounts and wallet"]
  node_profiles["Profiles<br/>[index.tsx]"]
  node_messages["Direct messages<br/>[index.tsx]"]
  node_privacy["Privacy center<br/>[&#91;slug&#93;.tsx]"]
  node_wallet["Wallet and networks<br/>[index.ts]"]
end

subgraph group_integrations["Protocol integrations"]
  node_metadata["Market metadata<br/>[index.tsx]"]
  node_aquarius["Aquarius client<br/>[index.ts]"]
end

node_visitor(("Marketplace user"))
node_cache(("Aquarius metadata cache"))
node_chain(("Ocean chains"))
node_provider(("Ocean provider"))
node_blockchain(("Ocean blockchain contracts"))
node_urql(("Graph data services"))

node_visitor -->|"opens"| node_home
node_visitor -->|"enters query"| node_searchbar
node_home -.->|"renders"| node_homeview
node_homeview -->|"queries assets"| node_aquarius
node_searchroute -->|"renders"| node_search
node_searchbar -->|"navigates"| node_searchroute
node_search -->|"renders"| node_filters
node_search -->|"requests results"| node_aquarius
node_aquarius -->|"queries metadata"| node_cache
node_visitor -->|"opens asset"| node_assetroute
node_assetroute -.->|"renders"| node_asset
node_asset -.->|"renders"| node_assetactions
node_assetactions -.->|"purchases access"| node_blockchain
node_assetactions -.->|"downloads asset"| node_provider
node_visitor -->|"opens publishing"| node_publishroute
node_publishroute -.->|"renders"| node_publish
node_publish -->|"renders steps"| node_publishsteps
node_publish -->|"creates tokens and DDO"| node_publishutils
node_publish -->|"registers NFT metadata"| node_blockchain
node_publishutils -.->|"creates tokens and pricing"| node_blockchain
node_publish -.->|"encrypts DDO"| node_provider
node_visitor -->|"views profile"| node_profiles
node_visitor -.->|"sends messages"| node_messages
node_visitor -->|"sets privacy choices"| node_privacy
node_visitor -.->|"connects wallet"| node_wallet
node_wallet -->|"selects network"| node_chain
node_metadata -.->|"reads fees and tokens"| node_blockchain
node_metadata -.->|"loads market data"| node_urql

click node_home "https://github.com/oceanprotocol/market/blob/main/src/pages/index.tsx"
click node_homeview "https://github.com/oceanprotocol/market/blob/main/src/components/Home/SectionQueryResult.tsx"
click node_searchroute "https://github.com/oceanprotocol/market/blob/main/src/pages/search.tsx"
click node_searchbar "https://github.com/oceanprotocol/market/blob/main/src/components/Header/SearchBar.tsx"
click node_search "https://github.com/oceanprotocol/market/blob/main/src/components/Search/index.tsx"
click node_filters "https://github.com/oceanprotocol/market/blob/main/src/components/Search/Filters.tsx"
click node_assetroute "https://github.com/oceanprotocol/market/blob/main/src/pages/asset/%5Bdid%5D/index.tsx"
click node_asset "https://github.com/oceanprotocol/market/blob/main/src/components/Asset/index.tsx"
click node_assetactions "https://github.com/oceanprotocol/market/blob/main/src/components/Asset/AssetActions/index.tsx"
click node_publishroute "https://github.com/oceanprotocol/market/blob/main/src/pages/publish/%5Bstep%5D.tsx"
click node_publish "https://github.com/oceanprotocol/market/blob/main/src/components/Publish/index.tsx"
click node_publishsteps "https://github.com/oceanprotocol/market/blob/main/src/components/Publish/_constants.tsx"
click node_publishutils "https://github.com/oceanprotocol/market/blob/main/src/components/Publish/_utils.ts"
click node_profiles "https://github.com/oceanprotocol/market/blob/main/src/components/Profile/index.tsx"
click node_messages "https://github.com/oceanprotocol/market/blob/main/src/%40context/DirectMessages/index.tsx"
click node_privacy "https://github.com/oceanprotocol/market/blob/main/src/pages/privacy/%5Bslug%5D.tsx"
click node_wallet "https://github.com/oceanprotocol/market/blob/main/src/%40utils/wallet/index.ts"
click node_metadata "https://github.com/oceanprotocol/market/blob/main/src/%40context/MarketMetadata/index.tsx"
click node_aquarius "https://github.com/oceanprotocol/market/blob/main/src/%40utils/aquarius/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_home,node_searchroute,node_assetroute,node_publishroute,node_visitor toneBlue
class node_homeview,node_searchbar,node_search,node_filters,node_asset,node_assetactions,node_cache toneAmber
class node_publish,node_publishsteps,node_publishutils toneMint
class node_profiles,node_messages,node_privacy,node_wallet toneRose
class node_metadata,node_aquarius,node_chain,node_provider,node_blockchain,node_urql toneIndigo
```

## Components

### App routes

- [Home](https://github.com/oceanprotocol/market/blob/main/src/pages/index.tsx): `src/pages/index.tsx`
- [Search route](https://github.com/oceanprotocol/market/blob/main/src/pages/search.tsx): `src/pages/search.tsx`
- [Asset route](https://github.com/oceanprotocol/market/blob/main/src/pages/asset/%5Bdid%5D/index.tsx): `src/pages/asset/[did]/index.tsx`
- [Publish route](https://github.com/oceanprotocol/market/blob/main/src/pages/publish/%5Bstep%5D.tsx): `src/pages/publish/[step].tsx`

### Asset discovery

- [Home sections](https://github.com/oceanprotocol/market/blob/main/src/components/Home/SectionQueryResult.tsx): `src/components/Home/SectionQueryResult.tsx`
- [Search bar](https://github.com/oceanprotocol/market/blob/main/src/components/Header/SearchBar.tsx): `src/components/Header/SearchBar.tsx`
- [Search results](https://github.com/oceanprotocol/market/blob/main/src/components/Search/index.tsx): `src/components/Search/index.tsx`
- [Filters and sort](https://github.com/oceanprotocol/market/blob/main/src/components/Search/Filters.tsx): `src/components/Search/Filters.tsx`
- [Asset detail](https://github.com/oceanprotocol/market/blob/main/src/components/Asset/index.tsx): `src/components/Asset/index.tsx`
- [Buy and download](https://github.com/oceanprotocol/market/blob/main/src/components/Asset/AssetActions/index.tsx): `src/components/Asset/AssetActions/index.tsx`

### Publishing

- [Publish wizard](https://github.com/oceanprotocol/market/blob/main/src/components/Publish/index.tsx): `src/components/Publish/index.tsx`
- [Wizard steps](https://github.com/oceanprotocol/market/blob/main/src/components/Publish/_constants.tsx): `src/components/Publish/_constants.tsx`
- [Publish processing](https://github.com/oceanprotocol/market/blob/main/src/components/Publish/_utils.ts): `src/components/Publish/_utils.ts`

### Accounts and wallet

- [Profiles](https://github.com/oceanprotocol/market/blob/main/src/components/Profile/index.tsx): `src/components/Profile/index.tsx`
- [Direct messages](https://github.com/oceanprotocol/market/blob/main/src/%40context/DirectMessages/index.tsx): `src/@context/DirectMessages/index.tsx`
- [Privacy center](https://github.com/oceanprotocol/market/blob/main/src/pages/privacy/%5Bslug%5D.tsx): `src/pages/privacy/[slug].tsx`
- [Wallet and networks](https://github.com/oceanprotocol/market/blob/main/src/%40utils/wallet/index.ts): `src/@utils/wallet/index.ts`

### Protocol integrations

- [Market metadata](https://github.com/oceanprotocol/market/blob/main/src/%40context/MarketMetadata/index.tsx): `src/@context/MarketMetadata/index.tsx`
- [Aquarius client](https://github.com/oceanprotocol/market/blob/main/src/%40utils/aquarius/index.ts): `src/@utils/aquarius/index.ts`

### Other components

- **Marketplace user**
- **Aquarius metadata cache**
- **Ocean chains**
- **Ocean provider**
- **Ocean blockchain contracts**
- **Graph data services**

## Connections

- Marketplace user → Home: opens
- Marketplace user → Search bar: enters query (evidence: `src/components/Header/SearchBar.tsx`)
- Home → Home sections: renders
- Home sections → Aquarius client: queries assets (evidence: `src/components/Home/SectionQueryResult.tsx`)
- Search route → Search results: renders (evidence: `src/pages/search.tsx`)
- Search bar → Search route: navigates (evidence: `src/components/Header/SearchBar.tsx`)
- Search results → Filters and sort: renders (evidence: `src/components/Search/index.tsx`)
- Search results → Aquarius client: requests results (evidence: `src/components/Search/index.tsx`)
- Aquarius client → Aquarius metadata cache: queries metadata (evidence: `src/@utils/aquarius/index.ts`)
- Marketplace user → Asset route: opens asset
- Asset route → Asset detail: renders
- Asset detail → Buy and download: renders
- Buy and download → Ocean blockchain contracts: purchases access
- Buy and download → Ocean provider: downloads asset
- Marketplace user → Publish route: opens publishing
- Publish route → Publish wizard: renders
- Publish wizard → Wizard steps: renders steps (evidence: `src/components/Publish/index.tsx`)
- Publish wizard → Publish processing: creates tokens and DDO (evidence: `src/components/Publish/index.tsx`)
- Publish wizard → Ocean blockchain contracts: registers NFT metadata (evidence: `src/components/Publish/index.tsx`)
- Publish processing → Ocean blockchain contracts: creates tokens and pricing
- Publish wizard → Ocean provider: encrypts DDO
- Marketplace user → Profiles: views profile
- Marketplace user → Direct messages: sends messages
- Marketplace user → Privacy center: sets privacy choices (evidence: `src/pages/privacy/[slug].tsx`)
- Marketplace user → Wallet and networks: connects wallet
- Wallet and networks → Ocean chains: selects network (evidence: `src/@utils/wallet/index.ts`)
- Market metadata → Ocean blockchain contracts: reads fees and tokens
- Market metadata → Graph data services: loads market data
