# hscecoder/gitscope architecture

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

- Interactive diagram: https://gitdiagram.com/hscecoder/gitscope
- Repository: https://github.com/hscecoder/gitscope

## Overview

GitScope is a frontend-only GitHub developer analytics dashboard. A user selects Dashboard, searches a public username, and the page loads profile, repository, public-event, and contribution data before rendering analytics and a downloadable developer card. A separate Compare workflow loads two users and presents side-by-side metrics. The graph follows the sampled entry points and source-index references; unsampled feature implementations are represented by their exact component paths, and external contribution data is kept distinct from GitHub’s REST API.

Main entry points: [`src/components/Dashboard.jsx`](https://github.com/hscecoder/gitscope/blob/main/src/components/Dashboard.jsx) (Analytics dashboard), [`src/api/github.js`](https://github.com/hscecoder/gitscope/blob/main/src/api/github.js) (GitHub client), [`src/components/DevCard.jsx`](https://github.com/hscecoder/gitscope/blob/main/src/components/DevCard.jsx) (Developer card), [`src/components/CompareView.jsx`](https://github.com/hscecoder/gitscope/blob/main/src/components/CompareView.jsx) (Side-by-side view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application flow"]
  node_app["Tab shell<br/>[App.jsx]"]
  node_dashboard_page["Dashboard search<br/>[DashboardPage.jsx]"]
  node_compare_page["Compare page<br/>[ComparePage.jsx]"]
end

subgraph group_data["Data access"]
  node_github_hook["Dashboard loader<br/>[useGithub.js]"]
  node_compare_hook["Comparison loader<br/>[useCompare.js]"]
  node_github_client["GitHub client<br/>[github.js]"]
  node_repos_client["Repository client<br/>[repos.js]"]
  node_github_api["GitHub REST API"]
  node_contributions_api["Contributions API"]
end

subgraph group_dashboard["Developer analytics"]
  node_dashboard["Analytics dashboard<br/>[Dashboard.jsx]"]
  node_profile["Profile analytics<br/>[ProfileCard.jsx]"]
  node_stat_cards["Profile statistics<br/>[StatCards.jsx]"]
  node_language_chart["Language analytics<br/>[LanguageChart.jsx]"]
  node_repo_analytics["Repository analytics<br/>[TopReposChart.jsx]"]
  node_repo_list["Repository lists<br/>[RepoList.jsx]"]
  node_activity["Activity views<br/>[ActivityChart.jsx]"]
  node_activity_timeline["Activity timeline"]
  node_insights["Growth insights<br/>[Insights.jsx]"]
  node_growth["Growth calculations<br/>[growth.js]"]
  node_heatmap["Contribution heatmap<br/>[Heatmap.jsx]"]
  node_heatmap_data["Heatmap processing<br/>[heatmap.js]"]
  node_dev_card["Developer card<br/>[DevCard.jsx]"]
  node_brand_card["Card rendering<br/>[BrandCard.jsx]"]
  node_download["PNG download<br/>[download.js]"]
  node_stats["Repository statistics<br/>[stats.js]"]
  node_bar_chart["Bar chart<br/>[SimpleBarChart.jsx]"]
  node_chart_tooltip["Chart tooltip<br/>[ChartTooltip.jsx]"]
  node_format["Display formatting<br/>[format.js]"]
end

subgraph group_compare["Developer comparison"]
  node_compare_view["Side-by-side view<br/>[CompareView.jsx]"]
  node_compare_metrics["Comparison metrics<br/>[compare.js]"]
  node_compare_user["Compared profiles<br/>[CompareUser.jsx]"]
  node_compare_row["Metric rows<br/>[CompareRow.jsx]"]
end

node_user(("Visitor"))

node_user -->|"selects view"| node_app
node_app -->|"shows dashboard"| node_dashboard_page
node_app -->|"shows comparison"| node_compare_page
node_dashboard_page -->|"searches through"| node_github_hook
node_dashboard_page -->|"renders results"| node_dashboard
node_github_hook -->|"fetches user and events"| node_github_client
node_github_hook -->|"fetches repositories"| node_repos_client
node_github_client -->|"requests profile and events"| node_github_api
node_repos_client -->|"uses JSON client"| node_github_client
node_repos_client -->|"requests repository pages"| node_github_api
node_github_client -->|"requests contributions"| node_contributions_api
node_github_client -->|"requests user data"| node_github_api
node_dashboard -->|"renders profile"| node_profile
node_dashboard -->|"renders statistics"| node_stat_cards
node_dashboard -->|"renders languages"| node_language_chart
node_dashboard -->|"renders popular repos"| node_repo_analytics
node_dashboard -->|"renders repository lists"| node_repo_list
node_dashboard -->|"renders activity chart"| node_activity
node_dashboard -->|"renders activity timeline"| node_activity_timeline
node_dashboard -->|"renders growth insights"| node_insights
node_dashboard -->|"renders contributions"| node_heatmap
node_dashboard -->|"renders developer card"| node_dev_card
node_dashboard -->|"selects top repositories"| node_stats
node_insights -->|"uses growth data"| node_growth
node_insights -->|"renders chart"| node_bar_chart
node_heatmap -->|"processes heatmap data"| node_heatmap_data
node_activity -->|"renders chart"| node_bar_chart
node_bar_chart -->|"configures tooltip"| node_chart_tooltip
node_dev_card -->|"renders card"| node_brand_card
node_dev_card -->|"downloads image"| node_download
node_dev_card -->|"uses repository statistics"| node_stats
node_compare_page -->|"loads pair"| node_compare_hook
node_compare_page -->|"renders comparison"| node_compare_view
node_compare_hook -->|"fetches profiles"| node_github_client
node_compare_hook -->|"fetches repositories"| node_repos_client
node_compare_view -->|"builds metric rows"| node_compare_metrics
node_compare_view -->|"renders users"| node_compare_user
node_compare_view -->|"renders metric rows"| node_compare_row
node_compare_metrics -->|"calculates totals and languages"| node_stats
node_compare_row -->|"uses comparison helpers"| node_compare_metrics
node_compare_user -->|"uses repository statistics"| node_stats

click node_app "https://github.com/hscecoder/gitscope/blob/main/src/App.jsx"
click node_dashboard_page "https://github.com/hscecoder/gitscope/blob/main/src/components/DashboardPage.jsx"
click node_compare_page "https://github.com/hscecoder/gitscope/blob/main/src/components/ComparePage.jsx"
click node_github_hook "https://github.com/hscecoder/gitscope/blob/main/src/hooks/useGithub.js"
click node_compare_hook "https://github.com/hscecoder/gitscope/blob/main/src/hooks/useCompare.js"
click node_github_client "https://github.com/hscecoder/gitscope/blob/main/src/api/github.js"
click node_repos_client "https://github.com/hscecoder/gitscope/blob/main/src/api/repos.js"
click node_dashboard "https://github.com/hscecoder/gitscope/blob/main/src/components/Dashboard.jsx"
click node_profile "https://github.com/hscecoder/gitscope/blob/main/src/components/ProfileCard.jsx"
click node_stat_cards "https://github.com/hscecoder/gitscope/blob/main/src/components/StatCards.jsx"
click node_language_chart "https://github.com/hscecoder/gitscope/blob/main/src/components/LanguageChart.jsx"
click node_repo_analytics "https://github.com/hscecoder/gitscope/blob/main/src/components/TopReposChart.jsx"
click node_repo_list "https://github.com/hscecoder/gitscope/blob/main/src/components/RepoList.jsx"
click node_activity "https://github.com/hscecoder/gitscope/blob/main/src/components/ActivityChart.jsx"
click node_activity_timeline "https://github.com/hscecoder/gitscope/blob/main/src/components/ActivityTimeline.jsx"
click node_insights "https://github.com/hscecoder/gitscope/blob/main/src/components/Insights.jsx"
click node_growth "https://github.com/hscecoder/gitscope/blob/main/src/utils/growth.js"
click node_heatmap "https://github.com/hscecoder/gitscope/blob/main/src/components/Heatmap.jsx"
click node_heatmap_data "https://github.com/hscecoder/gitscope/blob/main/src/utils/heatmap.js"
click node_dev_card "https://github.com/hscecoder/gitscope/blob/main/src/components/DevCard.jsx"
click node_brand_card "https://github.com/hscecoder/gitscope/blob/main/src/components/BrandCard.jsx"
click node_download "https://github.com/hscecoder/gitscope/blob/main/src/utils/download.js"
click node_stats "https://github.com/hscecoder/gitscope/blob/main/src/utils/stats.js"
click node_bar_chart "https://github.com/hscecoder/gitscope/blob/main/src/components/SimpleBarChart.jsx"
click node_chart_tooltip "https://github.com/hscecoder/gitscope/blob/main/src/components/ChartTooltip.jsx"
click node_format "https://github.com/hscecoder/gitscope/blob/main/src/utils/format.js"
click node_compare_view "https://github.com/hscecoder/gitscope/blob/main/src/components/CompareView.jsx"
click node_compare_metrics "https://github.com/hscecoder/gitscope/blob/main/src/utils/compare.js"
click node_compare_user "https://github.com/hscecoder/gitscope/blob/main/src/components/CompareUser.jsx"
click node_compare_row "https://github.com/hscecoder/gitscope/blob/main/src/components/CompareRow.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_app,node_dashboard_page,node_compare_page toneBlue
class node_github_hook,node_compare_hook,node_github_client,node_repos_client,node_github_api,node_contributions_api toneAmber
class node_dashboard,node_profile,node_stat_cards,node_language_chart,node_repo_analytics,node_repo_list,node_activity,node_activity_timeline,node_insights,node_growth,node_heatmap,node_heatmap_data,node_dev_card,node_brand_card,node_download,node_stats,node_bar_chart,node_chart_tooltip,node_format toneMint
class node_compare_view,node_compare_metrics,node_compare_user,node_compare_row toneRose
class node_user toneIndigo
```

## Components

### Application flow

- [Tab shell](https://github.com/hscecoder/gitscope/blob/main/src/App.jsx): `src/App.jsx`
- [Dashboard search](https://github.com/hscecoder/gitscope/blob/main/src/components/DashboardPage.jsx): `src/components/DashboardPage.jsx`
- [Compare page](https://github.com/hscecoder/gitscope/blob/main/src/components/ComparePage.jsx): `src/components/ComparePage.jsx`

### Data access

- [Dashboard loader](https://github.com/hscecoder/gitscope/blob/main/src/hooks/useGithub.js): `src/hooks/useGithub.js`
- [Comparison loader](https://github.com/hscecoder/gitscope/blob/main/src/hooks/useCompare.js): `src/hooks/useCompare.js`
- [GitHub client](https://github.com/hscecoder/gitscope/blob/main/src/api/github.js): `src/api/github.js`
- [Repository client](https://github.com/hscecoder/gitscope/blob/main/src/api/repos.js): `src/api/repos.js`
- **GitHub REST API**
- **Contributions API**

### Developer analytics

- [Analytics dashboard](https://github.com/hscecoder/gitscope/blob/main/src/components/Dashboard.jsx): `src/components/Dashboard.jsx`
- [Profile analytics](https://github.com/hscecoder/gitscope/blob/main/src/components/ProfileCard.jsx): `src/components/ProfileCard.jsx`
- [Profile statistics](https://github.com/hscecoder/gitscope/blob/main/src/components/StatCards.jsx): `src/components/StatCards.jsx`
- [Language analytics](https://github.com/hscecoder/gitscope/blob/main/src/components/LanguageChart.jsx): `src/components/LanguageChart.jsx`
- [Repository analytics](https://github.com/hscecoder/gitscope/blob/main/src/components/TopReposChart.jsx): `src/components/TopReposChart.jsx`
- [Repository lists](https://github.com/hscecoder/gitscope/blob/main/src/components/RepoList.jsx): `src/components/RepoList.jsx`
- [Activity views](https://github.com/hscecoder/gitscope/blob/main/src/components/ActivityChart.jsx): `src/components/ActivityChart.jsx`
- [Activity timeline](https://github.com/hscecoder/gitscope/blob/main/src/components/ActivityTimeline.jsx): `src/components/ActivityTimeline.jsx`
- [Growth insights](https://github.com/hscecoder/gitscope/blob/main/src/components/Insights.jsx): `src/components/Insights.jsx`
- [Growth calculations](https://github.com/hscecoder/gitscope/blob/main/src/utils/growth.js): `src/utils/growth.js`
- [Contribution heatmap](https://github.com/hscecoder/gitscope/blob/main/src/components/Heatmap.jsx): `src/components/Heatmap.jsx`
- [Heatmap processing](https://github.com/hscecoder/gitscope/blob/main/src/utils/heatmap.js): `src/utils/heatmap.js`
- [Developer card](https://github.com/hscecoder/gitscope/blob/main/src/components/DevCard.jsx): `src/components/DevCard.jsx`
- [Card rendering](https://github.com/hscecoder/gitscope/blob/main/src/components/BrandCard.jsx): `src/components/BrandCard.jsx`
- [PNG download](https://github.com/hscecoder/gitscope/blob/main/src/utils/download.js): `src/utils/download.js`
- [Repository statistics](https://github.com/hscecoder/gitscope/blob/main/src/utils/stats.js): `src/utils/stats.js`
- [Bar chart](https://github.com/hscecoder/gitscope/blob/main/src/components/SimpleBarChart.jsx): `src/components/SimpleBarChart.jsx`
- [Chart tooltip](https://github.com/hscecoder/gitscope/blob/main/src/components/ChartTooltip.jsx): `src/components/ChartTooltip.jsx`
- [Display formatting](https://github.com/hscecoder/gitscope/blob/main/src/utils/format.js): `src/utils/format.js`

### Developer comparison

- [Side-by-side view](https://github.com/hscecoder/gitscope/blob/main/src/components/CompareView.jsx): `src/components/CompareView.jsx`
- [Comparison metrics](https://github.com/hscecoder/gitscope/blob/main/src/utils/compare.js): `src/utils/compare.js`
- [Compared profiles](https://github.com/hscecoder/gitscope/blob/main/src/components/CompareUser.jsx): `src/components/CompareUser.jsx`
- [Metric rows](https://github.com/hscecoder/gitscope/blob/main/src/components/CompareRow.jsx): `src/components/CompareRow.jsx`

### Other components

- **Visitor**

## Connections

- Visitor → Tab shell: selects view (evidence: `src/App.jsx`)
- Tab shell → Dashboard search: shows dashboard (evidence: `src/App.jsx`)
- Tab shell → Compare page: shows comparison (evidence: `src/App.jsx`)
- Dashboard search → Dashboard loader: searches through (evidence: `src/components/DashboardPage.jsx`)
- Dashboard search → Analytics dashboard: renders results (evidence: `src/components/DashboardPage.jsx`)
- Dashboard loader → GitHub client: fetches user and events (evidence: `src/hooks/useGithub.js`)
- Dashboard loader → Repository client: fetches repositories (evidence: `src/hooks/useGithub.js`)
- GitHub client → GitHub REST API: requests profile and events (evidence: `src/api/github.js`)
- Repository client → GitHub client: uses JSON client (evidence: `src/api/repos.js`)
- Repository client → GitHub REST API: requests repository pages (evidence: `src/api/repos.js`)
- GitHub client → Contributions API: requests contributions (evidence: `src/api/github.js`)
- GitHub client → GitHub REST API: requests user data (evidence: `src/api/github.js`)
- Analytics dashboard → Profile analytics: renders profile (evidence: `src/components/Dashboard.jsx`)
- Analytics dashboard → Profile statistics: renders statistics (evidence: `src/components/Dashboard.jsx`)
- Analytics dashboard → Language analytics: renders languages (evidence: `src/components/Dashboard.jsx`)
- Analytics dashboard → Repository analytics: renders popular repos (evidence: `src/components/Dashboard.jsx`)
- Analytics dashboard → Repository lists: renders repository lists (evidence: `src/components/Dashboard.jsx`)
- Analytics dashboard → Activity views: renders activity chart (evidence: `src/components/Dashboard.jsx`)
- Analytics dashboard → Activity timeline: renders activity timeline (evidence: `src/components/Dashboard.jsx`)
- Analytics dashboard → Growth insights: renders growth insights (evidence: `src/components/Dashboard.jsx`)
- Analytics dashboard → Contribution heatmap: renders contributions (evidence: `src/components/Dashboard.jsx`)
- Analytics dashboard → Developer card: renders developer card (evidence: `src/components/Dashboard.jsx`)
- Analytics dashboard → Repository statistics: selects top repositories (evidence: `src/components/Dashboard.jsx`)
- Growth insights → Growth calculations: uses growth data (evidence: `src/components/Insights.jsx`)
- Growth insights → Bar chart: renders chart (evidence: `src/components/Insights.jsx`)
- Contribution heatmap → Heatmap processing: processes heatmap data (evidence: `src/components/Heatmap.jsx`)
- Activity views → Bar chart: renders chart (evidence: `src/components/ActivityChart.jsx`)
- Bar chart → Chart tooltip: configures tooltip (evidence: `src/components/SimpleBarChart.jsx`)
- Developer card → Card rendering: renders card (evidence: `src/components/DevCard.jsx`)
- Developer card → PNG download: downloads image (evidence: `src/components/DevCard.jsx`)
- Developer card → Repository statistics: uses repository statistics (evidence: `src/components/DevCard.jsx`)
- Compare page → Comparison loader: loads pair (evidence: `src/components/ComparePage.jsx`)
- Compare page → Side-by-side view: renders comparison (evidence: `src/components/ComparePage.jsx`)
- Comparison loader → GitHub client: fetches profiles (evidence: `src/hooks/useCompare.js`)
- Comparison loader → Repository client: fetches repositories (evidence: `src/hooks/useCompare.js`)
- Side-by-side view → Comparison metrics: builds metric rows (evidence: `src/components/CompareView.jsx`)
- Side-by-side view → Compared profiles: renders users (evidence: `src/components/CompareView.jsx`)
- Side-by-side view → Metric rows: renders metric rows (evidence: `src/components/CompareView.jsx`)
- Comparison metrics → Repository statistics: calculates totals and languages (evidence: `src/utils/compare.js`)
- Metric rows → Comparison metrics: uses comparison helpers (evidence: `src/components/CompareRow.jsx`)
- Compared profiles → Repository statistics: uses repository statistics (evidence: `src/components/CompareUser.jsx`)
