# rishavvrajj/github-analytics-platform architecture

> Architecture diagram of the GitHub repository rishavvrajj/github-analytics-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rishavvrajj/github-analytics-platform
- Repository: https://github.com/rishavvrajj/github-analytics-platform

## Overview

Leuk analyzes public GitHub profiles and compares two developers, presenting scores, activity, repository health, language mix, and recruiter-oriented insights. Users enter a username or pair of usernames, reach a profile or comparison page, and view the resulting dashboard. The API handlers invoke the analytics library; the README documents GitHub analytics and AI insights, but the library implementation and some client fetch code were not sampled, so those links are shown as unverified where necessary.

Main entry points: [`app/analyze/[username]/page.tsx`](https://github.com/rishavvrajj/github-analytics-platform/blob/master/app/analyze/%5Busername%5D/page.tsx) (Profile dashboard), [`app/page.tsx`](https://github.com/rishavvrajj/github-analytics-platform/blob/master/app/page.tsx) (Landing page), [`app/compare/[left]/[right]/page.tsx`](https://github.com/rishavvrajj/github-analytics-platform/blob/master/app/compare/%5Bleft%5D/%5Bright%5D/page.tsx) (Comparison dashboard), [`app/api/analytics/compare/route.ts`](https://github.com/rishavvrajj/github-analytics-platform/blob/master/app/api/analytics/compare/route.ts) (Comparison API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and navigation"]
  node_home["Landing page<br/>[page.tsx]"]
  node_landing_sections["Landing sections"]
  node_analyze_search["Profile search<br/>[page.tsx]"]
  node_compare_search["Comparison search<br/>[page.tsx]"]
end

subgraph group_analysis["Profile analytics"]
  node_profile_page["Profile dashboard<br/>[page.tsx]"]
  node_profile_api["Profile analytics API<br/>[route.ts]"]
  node_analytics_engine["Analytics engine"]
  node_analytics_types["Analytics data types<br/>[analytics-types.ts]"]
  node_profile_visuals["Profile metrics views"]
  node_activity_chart["Activity trends<br/>[ActivityChart.tsx]"]
  node_top_repositories["Repository breakdown"]
  node_recruiter_insights["Recruiter insights"]
end

subgraph group_comparison["Developer comparison"]
  node_comparison_page["Comparison dashboard<br/>[page.tsx]"]
  node_comparison_api["Comparison API<br/>[route.ts]"]
  node_comparison_table["Comparison results"]
end

subgraph group_presentation["Shared presentation"]
  node_shared_ui["Shared layout and theme"]
  node_theme_provider["Theme provider<br/>[ThemeProvider.tsx]"]
end

node_visitor(("Developer"))
node_github(("GitHub"))

node_visitor -->|"opens"| node_home
node_home -->|"renders"| node_landing_sections
node_visitor -->|"enters username"| node_analyze_search
node_visitor -->|"enters pair"| node_compare_search
node_analyze_search -->|"navigates"| node_profile_page
node_compare_search -->|"navigates"| node_comparison_page
node_profile_page -.->|"requests analytics"| node_profile_api
node_profile_api -->|"gets analytics"| node_analytics_engine
node_analytics_engine -.->|"reads public profile"| node_github
node_profile_page -->|"renders dashboard"| node_profile_visuals
node_profile_page -->|"renders trends"| node_activity_chart
node_profile_page -->|"renders repositories"| node_top_repositories
node_profile_page -->|"renders insights"| node_recruiter_insights
node_comparison_page -.->|"requests comparison"| node_comparison_api
node_comparison_api -->|"loads both profiles"| node_analytics_engine
node_comparison_page -->|"renders results"| node_comparison_table
node_profile_page -->|"uses data shape"| node_analytics_types
node_comparison_api -->|"uses result types"| node_analytics_types
node_comparison_table -->|"uses result type"| node_analytics_types
node_home -.->|"uses layout"| node_shared_ui
node_theme_provider -.->|"provides theme"| node_shared_ui

click node_home "https://github.com/rishavvrajj/github-analytics-platform/blob/master/app/page.tsx"
click node_landing_sections "https://github.com/rishavvrajj/github-analytics-platform/tree/master/components/page"
click node_analyze_search "https://github.com/rishavvrajj/github-analytics-platform/blob/master/app/analyze/page.tsx"
click node_compare_search "https://github.com/rishavvrajj/github-analytics-platform/blob/master/app/compare/page.tsx"
click node_profile_page "https://github.com/rishavvrajj/github-analytics-platform/blob/master/app/analyze/%5Busername%5D/page.tsx"
click node_profile_api "https://github.com/rishavvrajj/github-analytics-platform/blob/master/app/api/analytics/%5Busername%5D/route.ts"
click node_comparison_page "https://github.com/rishavvrajj/github-analytics-platform/blob/master/app/compare/%5Bleft%5D/%5Bright%5D/page.tsx"
click node_comparison_api "https://github.com/rishavvrajj/github-analytics-platform/blob/master/app/api/analytics/compare/route.ts"
click node_analytics_engine "https://github.com/rishavvrajj/github-analytics-platform/blob/master/lib/github-analytics.ts"
click node_analytics_types "https://github.com/rishavvrajj/github-analytics-platform/blob/master/lib/analytics-types.ts"
click node_profile_visuals "https://github.com/rishavvrajj/github-analytics-platform/tree/master/components/analytics"
click node_activity_chart "https://github.com/rishavvrajj/github-analytics-platform/blob/master/components/analytics/ActivityChart.tsx"
click node_top_repositories "https://github.com/rishavvrajj/github-analytics-platform/blob/master/components/analytics/TopRepositories.tsx"
click node_recruiter_insights "https://github.com/rishavvrajj/github-analytics-platform/blob/master/components/analytics/RecruiterInsights.tsx"
click node_comparison_table "https://github.com/rishavvrajj/github-analytics-platform/blob/master/components/analytics/ComparisonTable.tsx"
click node_shared_ui "https://github.com/rishavvrajj/github-analytics-platform/tree/master/components/ui"
click node_theme_provider "https://github.com/rishavvrajj/github-analytics-platform/blob/master/components/providers/ThemeProvider.tsx"

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_landing_sections,node_analyze_search,node_compare_search toneBlue
class node_profile_page,node_profile_api,node_analytics_engine,node_analytics_types,node_profile_visuals,node_activity_chart,node_top_repositories,node_recruiter_insights toneAmber
class node_comparison_page,node_comparison_api,node_comparison_table toneMint
class node_shared_ui,node_theme_provider toneRose
class node_visitor,node_github toneIndigo
```

## Components

### Entry and navigation

- [Landing page](https://github.com/rishavvrajj/github-analytics-platform/blob/master/app/page.tsx): `app/page.tsx`
- [Landing sections](https://github.com/rishavvrajj/github-analytics-platform/tree/master/components/page): `components/page`
- [Profile search](https://github.com/rishavvrajj/github-analytics-platform/blob/master/app/analyze/page.tsx): `app/analyze/page.tsx`
- [Comparison search](https://github.com/rishavvrajj/github-analytics-platform/blob/master/app/compare/page.tsx): `app/compare/page.tsx`

### Profile analytics

- [Profile dashboard](https://github.com/rishavvrajj/github-analytics-platform/blob/master/app/analyze/%5Busername%5D/page.tsx): `app/analyze/[username]/page.tsx`
- [Profile analytics API](https://github.com/rishavvrajj/github-analytics-platform/blob/master/app/api/analytics/%5Busername%5D/route.ts): `app/api/analytics/[username]/route.ts`
- [Analytics engine](https://github.com/rishavvrajj/github-analytics-platform/blob/master/lib/github-analytics.ts): `lib/github-analytics.ts`
- [Analytics data types](https://github.com/rishavvrajj/github-analytics-platform/blob/master/lib/analytics-types.ts): `lib/analytics-types.ts`
- [Profile metrics views](https://github.com/rishavvrajj/github-analytics-platform/tree/master/components/analytics): `components/analytics`
- [Activity trends](https://github.com/rishavvrajj/github-analytics-platform/blob/master/components/analytics/ActivityChart.tsx): `components/analytics/ActivityChart.tsx`
- [Repository breakdown](https://github.com/rishavvrajj/github-analytics-platform/blob/master/components/analytics/TopRepositories.tsx): `components/analytics/TopRepositories.tsx`
- [Recruiter insights](https://github.com/rishavvrajj/github-analytics-platform/blob/master/components/analytics/RecruiterInsights.tsx): `components/analytics/RecruiterInsights.tsx`

### Developer comparison

- [Comparison dashboard](https://github.com/rishavvrajj/github-analytics-platform/blob/master/app/compare/%5Bleft%5D/%5Bright%5D/page.tsx): `app/compare/[left]/[right]/page.tsx`
- [Comparison API](https://github.com/rishavvrajj/github-analytics-platform/blob/master/app/api/analytics/compare/route.ts): `app/api/analytics/compare/route.ts`
- [Comparison results](https://github.com/rishavvrajj/github-analytics-platform/blob/master/components/analytics/ComparisonTable.tsx): `components/analytics/ComparisonTable.tsx`

### Shared presentation

- [Shared layout and theme](https://github.com/rishavvrajj/github-analytics-platform/tree/master/components/ui): `components/ui`
- [Theme provider](https://github.com/rishavvrajj/github-analytics-platform/blob/master/components/providers/ThemeProvider.tsx): `components/providers/ThemeProvider.tsx`

### Other components

- **Developer**
- **GitHub**

## Connections

- Developer → Landing page: opens
- Landing page → Landing sections: renders (evidence: `app/page.tsx`)
- Developer → Profile search: enters username (evidence: `app/analyze/page.tsx`)
- Developer → Comparison search: enters pair (evidence: `app/compare/page.tsx`)
- Profile search → Profile dashboard: navigates (evidence: `app/analyze/page.tsx`)
- Comparison search → Comparison dashboard: navigates (evidence: `app/compare/page.tsx`)
- Profile dashboard → Profile analytics API: requests analytics
- Profile analytics API → Analytics engine: gets analytics (evidence: `app/api/analytics/[username]/route.ts`)
- Analytics engine → GitHub: reads public profile
- Profile dashboard → Profile metrics views: renders dashboard (evidence: `app/analyze/[username]/page.tsx`)
- Profile dashboard → Activity trends: renders trends (evidence: `app/analyze/[username]/page.tsx`)
- Profile dashboard → Repository breakdown: renders repositories (evidence: `app/analyze/[username]/page.tsx`)
- Profile dashboard → Recruiter insights: renders insights (evidence: `app/analyze/[username]/page.tsx`)
- Comparison dashboard → Comparison API: requests comparison
- Comparison API → Analytics engine: loads both profiles (evidence: `app/api/analytics/compare/route.ts`)
- Comparison dashboard → Comparison results: renders results (evidence: `app/compare/[left]/[right]/page.tsx`)
- Profile dashboard → Analytics data types: uses data shape (evidence: `app/analyze/[username]/page.tsx`)
- Comparison API → Analytics data types: uses result types (evidence: `app/api/analytics/compare/route.ts`)
- Comparison results → Analytics data types: uses result type (evidence: `components/analytics/ComparisonTable.tsx`)
- Landing page → Shared layout and theme: uses layout (evidence: `app/page.tsx`)
- Theme provider → Shared layout and theme: provides theme
