# ifouzezi/crypto-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/ifouzezi/crypto-frontend
- Repository: https://github.com/ifouzezi/crypto-frontend

## Overview

Crypto Assets Viewer is a small React app for viewing live cryptocurrency names, symbols, and USD prices. The user-facing flow starts at the app entry point, loads CoinGecko market data through a hook and API client, then displays loading/error feedback or a searchable asset table. The table delegates row rendering and price formatting to focused components. The README documents the main capabilities; the graph’s source-level relationships are limited to the excerpted files.

Main entry points: [`src/pages/homepage.jsx`](https://github.com/ifouzezi/crypto-frontend/blob/main/src/pages/homepage.jsx) (Homepage), [`src/main.jsx`](https://github.com/ifouzezi/crypto-frontend/blob/main/src/main.jsx) (React Entry), [`src/App.jsx`](https://github.com/ifouzezi/crypto-frontend/blob/main/src/App.jsx) (App), [`src/hooks/useAssets.js`](https://github.com/ifouzezi/crypto-frontend/blob/main/src/hooks/useAssets.js) (Asset Hook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application UI"]
  node_entry["React Entry<br/>[main.jsx]"]
  node_app_component["App<br/>[App.jsx]"]
  node_homepage["Homepage<br/>[homepage.jsx]"]
end

subgraph group_data["Market Data"]
  node_hook["Asset Hook<br/>[useAssets.js]"]
  node_client["CoinGecko Client<br/>[coinGecko.js]"]
  node_coingecko["CoinGecko API"]
end

subgraph group_display["Asset Display"]
  node_search["Search Bar<br/>[searchBar.jsx]"]
  node_table["Asset Table<br/>[assetTable.jsx]"]
  node_row["Asset Row<br/>[assetRow.jsx]"]
  node_formatter["USD Formatter<br/>[format.js]"]
  node_loading["Loading State<br/>[loading.jsx]"]
  node_error["Error Message<br/>[errorMessage.jsx]"]
end

node_user(("User"))

node_user -->|"opens"| node_entry
node_entry -->|"renders"| node_app_component
node_app_component -->|"renders"| node_homepage
node_homepage -->|"loads data"| node_hook
node_hook -->|"fetches assets"| node_client
node_client -->|"requests markets"| node_coingecko
node_homepage -->|"renders"| node_search
node_homepage -->|"renders"| node_table
node_homepage -->|"renders"| node_loading
node_homepage -->|"renders"| node_error
node_table -->|"renders"| node_row
node_row -->|"formats price"| node_formatter

click node_entry "https://github.com/ifouzezi/crypto-frontend/blob/main/src/main.jsx"
click node_app_component "https://github.com/ifouzezi/crypto-frontend/blob/main/src/App.jsx"
click node_homepage "https://github.com/ifouzezi/crypto-frontend/blob/main/src/pages/homepage.jsx"
click node_hook "https://github.com/ifouzezi/crypto-frontend/blob/main/src/hooks/useAssets.js"
click node_client "https://github.com/ifouzezi/crypto-frontend/blob/main/src/api/coinGecko.js"
click node_search "https://github.com/ifouzezi/crypto-frontend/blob/main/src/components/searchBar.jsx"
click node_table "https://github.com/ifouzezi/crypto-frontend/blob/main/src/components/assetTable.jsx"
click node_row "https://github.com/ifouzezi/crypto-frontend/blob/main/src/components/assetRow.jsx"
click node_formatter "https://github.com/ifouzezi/crypto-frontend/blob/main/src/utils/format.js"
click node_loading "https://github.com/ifouzezi/crypto-frontend/blob/main/src/components/loading.jsx"
click node_error "https://github.com/ifouzezi/crypto-frontend/blob/main/src/components/errorMessage.jsx"

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_entry,node_app_component,node_homepage,node_user toneBlue
class node_hook,node_client,node_coingecko toneAmber
class node_search,node_table,node_row,node_formatter,node_loading,node_error toneMint
```

## Components

### Application UI

- [React Entry](https://github.com/ifouzezi/crypto-frontend/blob/main/src/main.jsx): `src/main.jsx`
- [App](https://github.com/ifouzezi/crypto-frontend/blob/main/src/App.jsx): `src/App.jsx`
- [Homepage](https://github.com/ifouzezi/crypto-frontend/blob/main/src/pages/homepage.jsx): `src/pages/homepage.jsx`

### Market Data

- [Asset Hook](https://github.com/ifouzezi/crypto-frontend/blob/main/src/hooks/useAssets.js): `src/hooks/useAssets.js`
- [CoinGecko Client](https://github.com/ifouzezi/crypto-frontend/blob/main/src/api/coinGecko.js): `src/api/coinGecko.js`
- **CoinGecko API**

### Asset Display

- [Search Bar](https://github.com/ifouzezi/crypto-frontend/blob/main/src/components/searchBar.jsx): `src/components/searchBar.jsx`
- [Asset Table](https://github.com/ifouzezi/crypto-frontend/blob/main/src/components/assetTable.jsx): `src/components/assetTable.jsx`
- [Asset Row](https://github.com/ifouzezi/crypto-frontend/blob/main/src/components/assetRow.jsx): `src/components/assetRow.jsx`
- [USD Formatter](https://github.com/ifouzezi/crypto-frontend/blob/main/src/utils/format.js): `src/utils/format.js`
- [Loading State](https://github.com/ifouzezi/crypto-frontend/blob/main/src/components/loading.jsx): `src/components/loading.jsx`
- [Error Message](https://github.com/ifouzezi/crypto-frontend/blob/main/src/components/errorMessage.jsx): `src/components/errorMessage.jsx`

### Other components

- **User**

## Connections

- User → React Entry: opens
- React Entry → App: renders (evidence: `src/main.jsx`)
- App → Homepage: renders (evidence: `src/App.jsx`)
- Homepage → Asset Hook: loads data (evidence: `src/pages/homepage.jsx`)
- Asset Hook → CoinGecko Client: fetches assets (evidence: `src/hooks/useAssets.js`)
- CoinGecko Client → CoinGecko API: requests markets (evidence: `src/api/coinGecko.js`)
- Homepage → Search Bar: renders (evidence: `src/pages/homepage.jsx`)
- Homepage → Asset Table: renders (evidence: `src/pages/homepage.jsx`)
- Homepage → Loading State: renders (evidence: `src/pages/homepage.jsx`)
- Homepage → Error Message: renders (evidence: `src/pages/homepage.jsx`)
- Asset Table → Asset Row: renders (evidence: `src/components/assetTable.jsx`)
- Asset Row → USD Formatter: formats price (evidence: `src/components/assetRow.jsx`)
