# sameershaik07/crypto-tracker architecture

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

- Interactive diagram: https://gitdiagram.com/sameershaik07/crypto-tracker
- Repository: https://github.com/sameershaik07/crypto-tracker

## Overview

1. **Overall shape**
   - This repository is a React single-page application with a separate Node.js server directory.
   - The front end contains most of the product logic and UI; the server appears to be a lightweight companion service rather than a large backend.

2. **Runtime boundaries**
   - `src/` is the main browser app built with Create React App.
   - `server/` is an independent Node package with its own `package.json` and `node_modules`, so it is a distinct runtime/deployment boundary.
   - `public/` provides the static entry shell and PWA metadata.

3. **Primary user surfaces**
   - The app is organized around five pages: `Home`, `Dashboard`, `Coin`, `ComparePage`, and `Watchlist`.
   - These pages define the top-level routes and coordinate the major feature areas.

4. **Global layout and shared chrome**
   - `src/components/common/` contains app-wide UI pieces: `Header`, `Footer`, `Button`, `Loader`, and `ScrollTop`.
   - `Header` likely handles primary navigation and a drawer-based mobile menu.
   - `Loader` and `ScrollTop` support cross-page behavior during async loading and navigation.

5. **Landing experience**
   - `src/components/Landingpage/MainComponent` is the home/marketing entry section.
   - This is a separate presentation area from the data-heavy crypto views, indicating a distinct landing flow before users enter the dashboard features.

6. **Dashboard subsystem**
   - `src/components/dashboard/` groups the main market overview UI into `Grid`, `List`, `Pagination`, `Search`, and `Tabs`.
   - This suggests the dashboard supports multiple views of the same coin dataset, filtering, paging, and search.
   - `Dashboard.js` is likely the page-level orchestrator for this subsystem.

7. **Coin detail and comparison subsystem**
   - `src/components/coins/` contains `coinInfo`, `Select`, `PriceType`, `LineChart`, and `ComparePage/SelectCoins`.
   - The structure implies a coin detail page with metadata, selectable chart parameters, price-type toggles, and historical chart visualization.
   - `ComparePage` appears to reuse the coin-selection concept for side-by-side comparison of multiple assets.

8. **Watchlist subsystem**
   - `src/components/Watchlist/NoList` is a dedicated empty-state view, which implies the watchlist has its own page and can be empty.
   - Supporting functions such as `getWatchlist`, `toggleWatchlist`, and `isInWatchlist` indicate watchlist state is managed outside the page components, likely through client-side persistence.

9. **Data and transformation layer**
   - `src/functions/` is the app’s shared logic layer for fetching and shaping data.
   - Functions like `get100Coins`, `getCoinData`, and `getCoinPrice` indicate the app consumes coin-market data from an external API.
   - Utility functions such as `convertDate`, `converNum`, `setCoinObject`, and `settingChartData` normalize raw API responses into UI-friendly structures.

10. **Likely data flow**
   - Pages request data through the helper functions in `src/functions/`.
   - Raw market data is converted into simplified objects and chart series, then passed down into feature components.
   - Watchlist actions feed back into the helper layer for add/remove checks and persistence.

11. **State and composition pattern**
   - The architecture is component-driven: page components assemble feature components, and feature components assemble smaller presentational controls.
   - Reusable controls are centralized under `common`, while feature-specific controls stay under `dashboard` and `coins`.
   - This keeps layout concerns separate from data-display concerns.

12. **Static assets and app shell**
   - `public/index.html`, `manifest.json`, and `robots.txt` show a standard CRA app shell with PWA-ready metadata.
   - `src/index.css` and `src/App.css` provide global styling, while each component has its own CSS file for local presentation.

13. **External/service dependencies**
   - The file names strongly suggest integration with a cryptocurrency market data provider for coin lists, coin details, prices, and historical charts.
   - The server directory may proxy, serve, or supplement this data, but the dominant architecture is client-rendered.

14. **How to diagram it**
   - Model the system as: browser SPA at the center, page-level routes on top, shared UI components around them, a shared helper/data layer beneath, and a separate Node server as an auxiliary boundary.
   - Emphasize the flow from external coin data source → helper functions → page/components → user actions such as search, compare, and watchlist updates.

Main entry points: [`src/components/common/Header/index.js`](https://github.com/sameershaik07/crypto-tracker/blob/main/src/components/common/Header/index.js) (Header), [`src/pages/Home.js`](https://github.com/sameershaik07/crypto-tracker/blob/main/src/pages/Home.js) (Home), [`src/pages/Watchlist.js`](https://github.com/sameershaik07/crypto-tracker/blob/main/src/pages/Watchlist.js) (Watchlist), [`src/components/dashboard/Grid/index.js`](https://github.com/sameershaik07/crypto-tracker/blob/main/src/components/dashboard/Grid/index.js) (Dashboard UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["React SPA"]
  node_home_page["Home<br/>page<br/>[Home.js]"]
  node_dashboard_page["Dashboard<br/>page<br/>[Dashboard.js]"]
  node_coin_page["Coin<br/>page<br/>[Coin.js]"]
  node_compare_page["Compare<br/>page<br/>[ComparePage.js]"]
  node_watchlist_page["Watchlist<br/>page<br/>[Watchlist.js]"]
end

subgraph group_shared["Shared UI"]
  node_header["Header<br/>chrome/nav<br/>[index.js]"]
  node_footer["Footer<br/>chrome<br/>[index.js]"]
  node_loader(("Loader<br/>status ui<br/>[index.js]"))
  node_scroll_top(("Scroll Top<br/>navigation aid<br/>[index.js]"))
end

subgraph group_features["Feature Areas"]
  node_main_component["Main Component<br/>landing section<br/>[index.js]"]
  node_dashboard_ui["Dashboard UI<br/>market browser<br/>[index.js]"]
  node_coin_detail["Coin Detail<br/>coin feature<br/>[index.js]"]
  node_compare_select["Select Coins<br/>compare feature<br/>[index.js]"]
  node_watchlist_empty["No List<br/>empty state<br/>[index.js]"]
end

subgraph group_data["Data Layer"]
  node_get100_coins["Get 100 Coins<br/>api helper<br/>[get100Coins.js]"]
  node_coin_data["Coin Data<br/>api helper<br/>[getCoinData.js]"]
  node_chart_data["Chart Data<br/>transform"]
  node_watchlist_ops["Watchlist Ops<br/>storage helper<br/>[getWatchlist.js]"]
end

subgraph group_runtime["Server Runtime"]
  node_server_api["Server<br/>node service<br/>[index.js]"]
end

subgraph group_shell["App Shell"]
  node_public_shell["Public Shell<br/>static shell<br/>[index.html]"]
end

node_public_shell -->|"mounts"| node_home_page
node_header -->|"navigates"| node_home_page
node_header -->|"navigates"| node_dashboard_page
node_header -->|"navigates"| node_coin_page
node_header -->|"navigates"| node_compare_page
node_header -->|"navigates"| node_watchlist_page
node_home_page -->|"renders"| node_main_component
node_dashboard_page -->|"renders"| node_dashboard_ui
node_dashboard_ui -->|"loads"| node_get100_coins
node_dashboard_ui -->|"uses"| node_loader
node_dashboard_ui -.->|"may proxy"| node_server_api
node_coin_page -->|"renders"| node_coin_detail
node_coin_detail -->|"loads"| node_coin_data
node_coin_detail -->|"builds"| node_chart_data
node_coin_detail -->|"uses"| node_loader
node_compare_page -->|"renders"| node_compare_select
node_compare_select -->|"loads"| node_get100_coins
node_watchlist_page -->|"renders"| node_watchlist_empty
node_watchlist_page -->|"uses"| node_watchlist_ops
node_watchlist_page -->|"uses"| node_loader
node_scroll_top -->|"supports"| node_home_page
node_scroll_top -->|"supports"| node_dashboard_page
node_scroll_top -->|"supports"| node_coin_page
node_footer -->|"appears on"| node_home_page
node_footer -->|"appears on"| node_dashboard_page

click node_home_page "https://github.com/sameershaik07/crypto-tracker/blob/main/src/pages/Home.js"
click node_dashboard_page "https://github.com/sameershaik07/crypto-tracker/blob/main/src/pages/Dashboard.js"
click node_coin_page "https://github.com/sameershaik07/crypto-tracker/blob/main/src/pages/Coin.js"
click node_compare_page "https://github.com/sameershaik07/crypto-tracker/blob/main/src/pages/ComparePage.js"
click node_watchlist_page "https://github.com/sameershaik07/crypto-tracker/blob/main/src/pages/Watchlist.js"
click node_header "https://github.com/sameershaik07/crypto-tracker/blob/main/src/components/common/Header/index.js"
click node_footer "https://github.com/sameershaik07/crypto-tracker/blob/main/src/components/common/Footer/index.js"
click node_loader "https://github.com/sameershaik07/crypto-tracker/blob/main/src/components/common/Loader/index.js"
click node_scroll_top "https://github.com/sameershaik07/crypto-tracker/blob/main/src/components/common/ScrollTop/index.js"
click node_main_component "https://github.com/sameershaik07/crypto-tracker/blob/main/src/components/Landingpage/MainComponent/index.js"
click node_dashboard_ui "https://github.com/sameershaik07/crypto-tracker/blob/main/src/components/dashboard/Grid/index.js"
click node_coin_detail "https://github.com/sameershaik07/crypto-tracker/blob/main/src/components/coins/coinInfo/index.js"
click node_compare_select "https://github.com/sameershaik07/crypto-tracker/blob/main/src/components/coins/ComparePage/SelectCoins/index.js"
click node_watchlist_empty "https://github.com/sameershaik07/crypto-tracker/blob/main/src/components/Watchlist/NoList/index.js"
click node_get100_coins "https://github.com/sameershaik07/crypto-tracker/blob/main/src/functions/get100Coins.js"
click node_coin_data "https://github.com/sameershaik07/crypto-tracker/blob/main/src/functions/getCoinData.js"
click node_chart_data "https://github.com/sameershaik07/crypto-tracker/blob/main/src/functions/settingChartData.js"
click node_watchlist_ops "https://github.com/sameershaik07/crypto-tracker/blob/main/src/functions/getWatchlist.js"
click node_server_api "https://github.com/sameershaik07/crypto-tracker/blob/main/server/index.js"
click node_public_shell "https://github.com/sameershaik07/crypto-tracker/blob/main/public/index.html"

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_page,node_dashboard_page,node_coin_page,node_compare_page,node_watchlist_page toneBlue
class node_header,node_footer,node_loader,node_scroll_top toneAmber
class node_main_component,node_dashboard_ui,node_coin_detail,node_compare_select,node_watchlist_empty toneMint
class node_get100_coins,node_coin_data,node_chart_data,node_watchlist_ops toneRose
class node_server_api toneIndigo
class node_public_shell toneTeal
```

## Components

### React SPA

Browser application built with Create React App.

- [Home](https://github.com/sameershaik07/crypto-tracker/blob/main/src/pages/Home.js): page · Landing page route for the marketing entry flow. · `src/pages/Home.js`
- [Dashboard](https://github.com/sameershaik07/crypto-tracker/blob/main/src/pages/Dashboard.js): page · Top-level market overview route. · `src/pages/Dashboard.js`
- [Coin](https://github.com/sameershaik07/crypto-tracker/blob/main/src/pages/Coin.js): page · Coin detail route with charts and metadata. · `src/pages/Coin.js`
- [Compare](https://github.com/sameershaik07/crypto-tracker/blob/main/src/pages/ComparePage.js): page · Side-by-side coin comparison route. · `src/pages/ComparePage.js`
- [Watchlist](https://github.com/sameershaik07/crypto-tracker/blob/main/src/pages/Watchlist.js): page · Saved coins route and empty-state handling. · `src/pages/Watchlist.js`

### Shared UI

App-wide reusable interface components.

- [Header](https://github.com/sameershaik07/crypto-tracker/blob/main/src/components/common/Header/index.js): chrome/nav · Global navigation and mobile drawer. · `src/components/common/Header/index.js`
- [Footer](https://github.com/sameershaik07/crypto-tracker/blob/main/src/components/common/Footer/index.js): chrome · Global footer shown across pages. · `src/components/common/Footer/index.js`
- [Loader](https://github.com/sameershaik07/crypto-tracker/blob/main/src/components/common/Loader/index.js): status ui · Shared async loading indicator. · `src/components/common/Loader/index.js`
- [Scroll Top](https://github.com/sameershaik07/crypto-tracker/blob/main/src/components/common/ScrollTop/index.js): navigation aid · Resets scroll position during route changes. · `src/components/common/ScrollTop/index.js`

### Feature Areas

Page-specific feature subsystems and their internal components.

- [Main Component](https://github.com/sameershaik07/crypto-tracker/blob/main/src/components/Landingpage/MainComponent/index.js): landing section · Landing page hero and intro presentation. · `src/components/Landingpage/MainComponent/index.js`
- [Dashboard UI](https://github.com/sameershaik07/crypto-tracker/blob/main/src/components/dashboard/Grid/index.js): market browser · Dashboard feature set for browsing and filtering coins. · `src/components/dashboard/Grid/index.js`
- [Coin Detail](https://github.com/sameershaik07/crypto-tracker/blob/main/src/components/coins/coinInfo/index.js): coin feature · Coin info, selectors, price type, and chart presentation. · `src/components/coins/coinInfo/index.js`
- [Select Coins](https://github.com/sameershaik07/crypto-tracker/blob/main/src/components/coins/ComparePage/SelectCoins/index.js): compare feature · Coin picker used in comparison flows. · `src/components/coins/ComparePage/SelectCoins/index.js`
- [No List](https://github.com/sameershaik07/crypto-tracker/blob/main/src/components/Watchlist/NoList/index.js): empty state · Watchlist empty-state view. · `src/components/Watchlist/NoList/index.js`

### Data Layer

Shared helpers for fetching, transforming, and persisting coin data.

- [Get 100 Coins](https://github.com/sameershaik07/crypto-tracker/blob/main/src/functions/get100Coins.js): api helper · Fetches the main coin list. · `src/functions/get100Coins.js`
- [Coin Data](https://github.com/sameershaik07/crypto-tracker/blob/main/src/functions/getCoinData.js): api helper · Fetches individual coin detail data. · `src/functions/getCoinData.js`
- [Chart Data](https://github.com/sameershaik07/crypto-tracker/blob/main/src/functions/settingChartData.js): transform · Builds chart series from raw historical prices. · `src/functions/settingChartData.js`
- [Watchlist Ops](https://github.com/sameershaik07/crypto-tracker/blob/main/src/functions/getWatchlist.js): storage helper · Reads, writes, and checks watchlist state. · `src/functions/getWatchlist.js`

### Server Runtime

Separate Node.js companion service.

- [Server](https://github.com/sameershaik07/crypto-tracker/blob/main/server/index.js): node service · Independent Node.js companion runtime. · `server/index.js`

### App Shell

Static entry and PWA metadata.

- [Public Shell](https://github.com/sameershaik07/crypto-tracker/blob/main/public/index.html): static shell · HTML entry point and PWA metadata. · `public/index.html`

## Connections

- Public Shell → Home: mounts · Static shell loads the React application.
- Header → Home: navigates · Global navigation routes users between main pages.
- Header → Dashboard: navigates · Global navigation routes users between main pages.
- Header → Coin: navigates · Global navigation routes users between main pages.
- Header → Compare: navigates · Global navigation routes users between main pages.
- Header → Watchlist: navigates · Global navigation routes users between main pages.
- Home → Main Component: renders · Landing route is composed from the hero section.
- Dashboard → Dashboard UI: renders · Dashboard page orchestrates the market browser subsystem.
- Dashboard UI → Get 100 Coins: loads · Market browser fetches the main coin dataset.
- Dashboard UI → Loader: uses · Shows loading state while market data is requested.
- Dashboard UI → Server: may proxy · Companion server can supplement or proxy data requests.
- Coin → Coin Detail: renders · Coin route composes detail, selectors, and chart views.
- Coin Detail → Coin Data: loads · Detail view fetches per-coin information.
- Coin Detail → Chart Data: builds · Historical data is transformed into chart series.
- Coin Detail → Loader: uses · Shows loading state during detail and chart fetches.
- Compare → Select Coins: renders · Comparison page centers on selecting multiple coins.
- Select Coins → Get 100 Coins: loads · Reuses the coin list for comparison selection.
- Watchlist → No List: renders · Empty state is shown when no saved coins exist.
- Watchlist → Watchlist Ops: uses · Watchlist state is read and updated through helpers.
- Watchlist → Loader: uses · Loading feedback during watchlist hydration.
- Scroll Top → Home: supports · Shared scroll behavior applies across routed pages.
- Scroll Top → Dashboard: supports · Shared scroll behavior applies across routed pages.
- Scroll Top → Coin: supports · Shared scroll behavior applies across routed pages.
- Footer → Home: appears on · Global footer is part of the shared page chrome.
- Footer → Dashboard: appears on · Global footer is part of the shared page chrome.
