# d1vyom/repo-radar architecture

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

- Interactive diagram: https://gitdiagram.com/d1vyom/repo-radar
- Repository: https://github.com/d1vyom/repo-radar

## Overview

RepoRadar lets developers discover GitHub repositories through filtered search, domain browsing, repository detail pages, and trending views. Search runs from the interactive interface through a validated API route to GitHub; nightly sync independently fetches popular repositories, classifies them, and stores them in Supabase. Analytics combines stored repository metrics and scoring to support trending results. The graph also preserves documented language and domain browsing capabilities. Unsampled page and analytics internals are represented by their exact paths; their detailed wiring is not inferred.

Main entry points: [`lib/analytics.ts`](https://github.com/d1vyom/repo-radar/blob/master/lib/analytics.ts) (Repository analytics), [`app/page.tsx`](https://github.com/d1vyom/repo-radar/blob/master/app/page.tsx) (Home discovery), [`app/domains/[slug]/page.tsx`](https://github.com/d1vyom/repo-radar/blob/master/app/domains/%5Bslug%5D/page.tsx) (Domain results), [`lib/supabase/sync.ts`](https://github.com/d1vyom/repo-radar/blob/master/lib/supabase/sync.ts) (Supabase sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Repository discovery"]
  node_search_ui["Search interface"]
  node_search_page["Search page<br/>[page.tsx]"]
  node_search_api["Search API<br/>[route.ts]"]
  node_github_search["GitHub search<br/>[search.ts]"]
end

subgraph group_presentation["Browsing and detail"]
  node_home["Home discovery<br/>[page.tsx]"]
  node_domain_index["Domain directory<br/>[page.tsx]"]
  node_domain_detail["Domain results<br/>[page.tsx]"]
  node_language_browse["Language browsing<br/>[page.tsx]"]
  node_repository_detail["Repository detail<br/>[page.tsx]"]
  node_repository_card["Repository card"]
  node_domain_card["Domain card<br/>[domain-card.tsx]"]
end

subgraph group_ingestion["Repository ingestion"]
  node_sync_route["Nightly sync route<br/>[route.ts]"]
  node_classification["Domain classification<br/>[engine.ts]"]
  node_sync_service["Supabase sync<br/>[sync.ts]"]
end

subgraph group_analytics["Metrics and analytics"]
  node_trending_page["Trending page<br/>[page.tsx]"]
  node_analytics["Repository analytics<br/>[analytics.ts]"]
  node_scoring["Trending scoring<br/>[scoring.ts]"]
end

subgraph group_integrations["External services"]
  node_github_client["GitHub client<br/>[client.ts]"]
  node_github(("GitHub API"))
  node_github_repo["GitHub repository fetch<br/>[repo.ts]"]
  node_supabase_client["Supabase server client<br/>[server.ts]"]
  node_supabase[("Supabase database")]
end

node_developer(("Developer"))

node_developer -->|"opens"| node_search_page
node_search_page -->|"renders"| node_search_ui
node_search_ui -->|"fetches results"| node_search_api
node_search_api -->|"calls search"| node_github_search
node_github_search -->|"fetches through"| node_github_client
node_github_client -->|"requests API"| node_github
node_developer -->|"opens"| node_home
node_home -->|"renders"| node_repository_card
node_home -->|"renders"| node_domain_card
node_developer -->|"browses domains"| node_domain_index
node_developer -->|"opens domain"| node_domain_detail
node_domain_detail -->|"loads results"| node_analytics
node_domain_detail -->|"renders"| node_repository_card
node_developer -->|"browses languages"| node_language_browse
node_developer -->|"opens repository"| node_repository_detail
node_repository_detail -->|"fetches details"| node_github_repo
node_developer -->|"opens trending"| node_trending_page
node_analytics -->|"queries metrics"| node_supabase_client
node_analytics -->|"calculates scores"| node_scoring
node_sync_route -->|"fetches popular repos"| node_github_search
node_sync_route -->|"syncs each repo"| node_sync_service
node_sync_service -->|"classifies metadata"| node_classification
node_sync_service -->|"upserts records"| node_supabase_client
node_supabase_client -->|"reads and writes"| node_supabase
node_analytics -->|"reads snapshots"| node_supabase

click node_search_ui "https://github.com/d1vyom/repo-radar/blob/master/components/search-interface.tsx"
click node_search_page "https://github.com/d1vyom/repo-radar/blob/master/app/search/page.tsx"
click node_search_api "https://github.com/d1vyom/repo-radar/blob/master/app/api/search/route.ts"
click node_github_search "https://github.com/d1vyom/repo-radar/blob/master/lib/github/search.ts"
click node_github_client "https://github.com/d1vyom/repo-radar/blob/master/lib/github/client.ts"
click node_home "https://github.com/d1vyom/repo-radar/blob/master/app/page.tsx"
click node_domain_index "https://github.com/d1vyom/repo-radar/blob/master/app/domains/page.tsx"
click node_domain_detail "https://github.com/d1vyom/repo-radar/blob/master/app/domains/%5Bslug%5D/page.tsx"
click node_language_browse "https://github.com/d1vyom/repo-radar/blob/master/app/languages/page.tsx"
click node_repository_detail "https://github.com/d1vyom/repo-radar/blob/master/app/repo/%5Bowner%5D/%5Bname%5D/page.tsx"
click node_github_repo "https://github.com/d1vyom/repo-radar/blob/master/lib/github/repo.ts"
click node_repository_card "https://github.com/d1vyom/repo-radar/blob/master/components/repository-card.tsx"
click node_domain_card "https://github.com/d1vyom/repo-radar/blob/master/components/domain-card.tsx"
click node_trending_page "https://github.com/d1vyom/repo-radar/blob/master/app/trending/page.tsx"
click node_analytics "https://github.com/d1vyom/repo-radar/blob/master/lib/analytics.ts"
click node_scoring "https://github.com/d1vyom/repo-radar/blob/master/lib/scoring.ts"
click node_sync_route "https://github.com/d1vyom/repo-radar/blob/master/app/api/cron/sync/route.ts"
click node_classification "https://github.com/d1vyom/repo-radar/blob/master/lib/classification/engine.ts"
click node_sync_service "https://github.com/d1vyom/repo-radar/blob/master/lib/supabase/sync.ts"
click node_supabase_client "https://github.com/d1vyom/repo-radar/blob/master/lib/supabase/server.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_search_ui,node_search_page,node_search_api,node_github_search toneBlue
class node_home,node_domain_index,node_domain_detail,node_language_browse,node_repository_detail,node_repository_card,node_domain_card toneAmber
class node_sync_route,node_classification,node_sync_service toneMint
class node_trending_page,node_analytics,node_scoring toneRose
class node_github_client,node_github,node_github_repo,node_supabase_client,node_supabase,node_developer toneIndigo
```

## Components

### Repository discovery

- [Search interface](https://github.com/d1vyom/repo-radar/blob/master/components/search-interface.tsx): `components/search-interface.tsx`
- [Search page](https://github.com/d1vyom/repo-radar/blob/master/app/search/page.tsx): `app/search/page.tsx`
- [Search API](https://github.com/d1vyom/repo-radar/blob/master/app/api/search/route.ts): `app/api/search/route.ts`
- [GitHub search](https://github.com/d1vyom/repo-radar/blob/master/lib/github/search.ts): `lib/github/search.ts`

### Browsing and detail

- [Home discovery](https://github.com/d1vyom/repo-radar/blob/master/app/page.tsx): `app/page.tsx`
- [Domain directory](https://github.com/d1vyom/repo-radar/blob/master/app/domains/page.tsx): `app/domains/page.tsx`
- [Domain results](https://github.com/d1vyom/repo-radar/blob/master/app/domains/%5Bslug%5D/page.tsx): `app/domains/[slug]/page.tsx`
- [Language browsing](https://github.com/d1vyom/repo-radar/blob/master/app/languages/page.tsx): `app/languages/page.tsx`
- [Repository detail](https://github.com/d1vyom/repo-radar/blob/master/app/repo/%5Bowner%5D/%5Bname%5D/page.tsx): `app/repo/[owner]/[name]/page.tsx`
- [Repository card](https://github.com/d1vyom/repo-radar/blob/master/components/repository-card.tsx): `components/repository-card.tsx`
- [Domain card](https://github.com/d1vyom/repo-radar/blob/master/components/domain-card.tsx): `components/domain-card.tsx`

### Repository ingestion

- [Nightly sync route](https://github.com/d1vyom/repo-radar/blob/master/app/api/cron/sync/route.ts): `app/api/cron/sync/route.ts`
- [Domain classification](https://github.com/d1vyom/repo-radar/blob/master/lib/classification/engine.ts): `lib/classification/engine.ts`
- [Supabase sync](https://github.com/d1vyom/repo-radar/blob/master/lib/supabase/sync.ts): `lib/supabase/sync.ts`

### Metrics and analytics

- [Trending page](https://github.com/d1vyom/repo-radar/blob/master/app/trending/page.tsx): `app/trending/page.tsx`
- [Repository analytics](https://github.com/d1vyom/repo-radar/blob/master/lib/analytics.ts): `lib/analytics.ts`
- [Trending scoring](https://github.com/d1vyom/repo-radar/blob/master/lib/scoring.ts): `lib/scoring.ts`

### External services

- [GitHub client](https://github.com/d1vyom/repo-radar/blob/master/lib/github/client.ts): `lib/github/client.ts`
- **GitHub API**
- [GitHub repository fetch](https://github.com/d1vyom/repo-radar/blob/master/lib/github/repo.ts): `lib/github/repo.ts`
- [Supabase server client](https://github.com/d1vyom/repo-radar/blob/master/lib/supabase/server.ts): `lib/supabase/server.ts`
- **Supabase database**

### Other components

- **Developer**

## Connections

- Developer → Search page: opens (evidence: `app/search/page.tsx`)
- Search page → Search interface: renders (evidence: `app/search/page.tsx`)
- Search interface → Search API: fetches results (evidence: `components/search-interface.tsx`)
- Search API → GitHub search: calls search (evidence: `app/api/search/route.ts`)
- GitHub search → GitHub client: fetches through (evidence: `lib/github/search.ts`)
- GitHub client → GitHub API: requests API (evidence: `lib/github/client.ts`)
- Developer → Home discovery: opens (evidence: `app/page.tsx`)
- Home discovery → Repository card: renders (evidence: `app/page.tsx`)
- Home discovery → Domain card: renders (evidence: `app/page.tsx`)
- Developer → Domain directory: browses domains (evidence: `README.md`)
- Developer → Domain results: opens domain (evidence: `README.md`)
- Domain results → Repository analytics: loads results (evidence: `app/domains/[slug]/page.tsx`)
- Domain results → Repository card: renders (evidence: `app/domains/[slug]/page.tsx`)
- Developer → Language browsing: browses languages (evidence: `README.md`)
- Developer → Repository detail: opens repository (evidence: `app/repo/[owner]/[name]/page.tsx`)
- Repository detail → GitHub repository fetch: fetches details (evidence: `app/repo/[owner]/[name]/page.tsx`)
- Developer → Trending page: opens trending (evidence: `README.md`)
- Repository analytics → Supabase server client: queries metrics (evidence: `lib/analytics.ts`)
- Repository analytics → Trending scoring: calculates scores (evidence: `lib/analytics.ts`)
- Nightly sync route → GitHub search: fetches popular repos (evidence: `app/api/cron/sync/route.ts`)
- Nightly sync route → Supabase sync: syncs each repo (evidence: `app/api/cron/sync/route.ts`)
- Supabase sync → Domain classification: classifies metadata (evidence: `lib/supabase/sync.ts`)
- Supabase sync → Supabase server client: upserts records (evidence: `lib/supabase/sync.ts`)
- Supabase server client → Supabase database: reads and writes (evidence: `README.md`)
- Repository analytics → Supabase database: reads snapshots (evidence: `README.md`)
