# rs9313399-dot/identityscope architecture

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

- Interactive diagram: https://gitdiagram.com/rs9313399-dot/identityscope
- Repository: https://github.com/rs9313399-dot/identityscope

## Overview

IDENTITYSCOPE scans public identity signals and presents scored developer profiles with AI guidance. The principal flow runs from scan input through connector collection, scoring, report persistence, and dashboard/report views. Separate branches support profile comparison, AI report generation, scan history, and bookmarks. The scan routes and several UI components are only partially sampled; unsampled capabilities and their relationships are included only where the README documents them, and the graph omits uncertain wiring.

Main entry points: [`src/app/api/scan/route.ts`](https://github.com/rs9313399-dot/identityscope/blob/main/src/app/api/scan/route.ts) (Scan API), [`src/app/api/scan-stream/route.ts`](https://github.com/rs9313399-dot/identityscope/blob/main/src/app/api/scan-stream/route.ts) (Streaming scan), [`src/hooks/use-scan.ts`](https://github.com/rs9313399-dot/identityscope/blob/main/src/hooks/use-scan.ts) (Scan client), [`src/lib/db.ts`](https://github.com/rs9313399-dot/identityscope/blob/main/src/lib/db.ts) (Scan database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_landing["Landing view<br/>[landing-view.tsx]"]
  node_scanner["Scanner view<br/>[scanner-view.tsx]"]
  node_scan_hook["Scan client<br/>[use-scan.ts]"]
  node_app_state["App state<br/>[app-store.ts]"]
  node_dashboard["Dashboard<br/>[dashboard-view.tsx]"]
  node_report_view["Report view<br/>[report-view.tsx]"]
  node_compare_view["Compare view<br/>[compare-view.tsx]"]
  node_history_view["History view<br/>[history-view.tsx]"]
  node_bookmarks_view["Bookmarks view<br/>[bookmarks-view.tsx]"]
end

subgraph group_scan["Identity scanning"]
  node_scan_api["Scan API<br/>[route.ts]"]
  node_stream_api["Streaming scan<br/>[route.ts]"]
  node_github["GitHub analysis<br/>[github.ts]"]
  node_codeforces["Codeforces lookup<br/>[codeforces.ts]"]
  node_website["Website analysis<br/>[website.ts]"]
  node_email["Email validation<br/>[email.ts]"]
  node_social["Social discovery<br/>[social.ts]"]
  node_packages["Package registries<br/>[packages.ts]"]
end

subgraph group_insights["Reports and insights"]
  node_scoring["Scoring engine<br/>[scoring.ts]"]
  node_ai_api["AI report API<br/>[route.ts]"]
  node_ai_stream["AI report stream<br/>[route.ts]"]
  node_ai_service{{"AI model service"}}
  node_compare_api["Compare API<br/>[route.ts]"]
end

subgraph group_records["Saved records"]
  node_db[("Scan database<br/>[db.ts]")]
  node_history_api["History API<br/>[route.ts]"]
  node_history_item_api["Single scan API<br/>[route.ts]"]
  node_bookmarks_api["Bookmarks API<br/>[route.ts]"]
end

node_user(("User"))

node_user -->|"opens"| node_landing
node_user -->|"enters scan"| node_scanner
node_scanner -->|"submits input"| node_scan_hook
node_scan_hook -->|"posts scan"| node_scan_api
node_scan_hook -->|"streams scan"| node_stream_api
node_scan_hook -->|"updates state"| node_app_state
node_scan_api -->|"queries"| node_github
node_scan_api -->|"queries"| node_codeforces
node_scan_api -->|"queries"| node_website
node_scan_api -->|"queries"| node_email
node_scan_api -->|"queries"| node_social
node_scan_api -->|"queries"| node_packages
node_stream_api -->|"queries"| node_github
node_stream_api -->|"queries"| node_codeforces
node_stream_api -->|"queries"| node_website
node_stream_api -->|"queries"| node_email
node_stream_api -->|"queries"| node_social
node_stream_api -->|"queries"| node_packages
node_scan_api -->|"computes scores"| node_scoring
node_stream_api -->|"computes scores"| node_scoring
node_scan_api -->|"persists scan"| node_db
node_stream_api -->|"persists scan"| node_db
node_dashboard -->|"uses scan"| node_scan_hook
node_dashboard -->|"reads report"| node_app_state
node_report_view -.->|"displays report"| node_app_state
node_user -->|"compares profiles"| node_compare_view
node_compare_view -->|"requests comparison"| node_compare_api
node_compare_api -->|"calls twice"| node_scan_api
node_user -->|"requests guidance"| node_ai_api
node_scan_hook -->|"posts report"| node_ai_api
node_scan_hook -->|"streams report"| node_ai_stream
node_ai_api -->|"summarizes report"| node_scoring
node_ai_api -->|"generates guidance"| node_ai_service
node_ai_stream -.->|"generates guidance"| node_ai_service
node_user -->|"reviews history"| node_history_view
node_history_view -.->|"loads records"| node_history_api
node_user -->|"opens bookmarks"| node_bookmarks_view
node_bookmarks_view -.->|"loads bookmarks"| node_bookmarks_api
node_history_api -.->|"reads scans"| node_db
node_history_item_api -->|"reads or deletes"| node_db
node_bookmarks_api -->|"reads or updates"| node_db

click node_landing "https://github.com/rs9313399-dot/identityscope/blob/main/src/components/identity/landing-view.tsx"
click node_scanner "https://github.com/rs9313399-dot/identityscope/blob/main/src/components/identity/scanner-view.tsx"
click node_scan_hook "https://github.com/rs9313399-dot/identityscope/blob/main/src/hooks/use-scan.ts"
click node_app_state "https://github.com/rs9313399-dot/identityscope/blob/main/src/stores/app-store.ts"
click node_dashboard "https://github.com/rs9313399-dot/identityscope/blob/main/src/components/identity/dashboard-view.tsx"
click node_report_view "https://github.com/rs9313399-dot/identityscope/blob/main/src/components/identity/report-view.tsx"
click node_compare_view "https://github.com/rs9313399-dot/identityscope/blob/main/src/components/identity/compare-view.tsx"
click node_scan_api "https://github.com/rs9313399-dot/identityscope/blob/main/src/app/api/scan/route.ts"
click node_stream_api "https://github.com/rs9313399-dot/identityscope/blob/main/src/app/api/scan-stream/route.ts"
click node_github "https://github.com/rs9313399-dot/identityscope/blob/main/src/lib/apis/github.ts"
click node_codeforces "https://github.com/rs9313399-dot/identityscope/blob/main/src/lib/apis/codeforces.ts"
click node_website "https://github.com/rs9313399-dot/identityscope/blob/main/src/lib/apis/website.ts"
click node_email "https://github.com/rs9313399-dot/identityscope/blob/main/src/lib/apis/email.ts"
click node_social "https://github.com/rs9313399-dot/identityscope/blob/main/src/lib/apis/social.ts"
click node_packages "https://github.com/rs9313399-dot/identityscope/blob/main/src/lib/apis/packages.ts"
click node_scoring "https://github.com/rs9313399-dot/identityscope/blob/main/src/lib/scoring.ts"
click node_ai_api "https://github.com/rs9313399-dot/identityscope/blob/main/src/app/api/ai-report/route.ts"
click node_ai_stream "https://github.com/rs9313399-dot/identityscope/blob/main/src/app/api/ai-report-stream/route.ts"
click node_compare_api "https://github.com/rs9313399-dot/identityscope/blob/main/src/app/api/compare/route.ts"
click node_db "https://github.com/rs9313399-dot/identityscope/blob/main/src/lib/db.ts"
click node_history_api "https://github.com/rs9313399-dot/identityscope/blob/main/src/app/api/history/route.ts"
click node_history_item_api "https://github.com/rs9313399-dot/identityscope/blob/main/src/app/api/history/%5Bid%5D/route.ts"
click node_bookmarks_api "https://github.com/rs9313399-dot/identityscope/blob/main/src/app/api/bookmarks/route.ts"
click node_history_view "https://github.com/rs9313399-dot/identityscope/blob/main/src/components/identity/history-view.tsx"
click node_bookmarks_view "https://github.com/rs9313399-dot/identityscope/blob/main/src/components/identity/bookmarks-view.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_landing,node_scanner,node_scan_hook,node_app_state,node_dashboard,node_report_view,node_compare_view,node_history_view,node_bookmarks_view,node_user toneBlue
class node_scan_api,node_stream_api,node_github,node_codeforces,node_website,node_email,node_social,node_packages toneAmber
class node_scoring,node_ai_api,node_ai_stream,node_ai_service,node_compare_api toneMint
class node_db,node_history_api,node_history_item_api,node_bookmarks_api toneRose
```

## Components

### User experience

- [Landing view](https://github.com/rs9313399-dot/identityscope/blob/main/src/components/identity/landing-view.tsx): `src/components/identity/landing-view.tsx`
- [Scanner view](https://github.com/rs9313399-dot/identityscope/blob/main/src/components/identity/scanner-view.tsx): `src/components/identity/scanner-view.tsx`
- [Scan client](https://github.com/rs9313399-dot/identityscope/blob/main/src/hooks/use-scan.ts): `src/hooks/use-scan.ts`
- [App state](https://github.com/rs9313399-dot/identityscope/blob/main/src/stores/app-store.ts): `src/stores/app-store.ts`
- [Dashboard](https://github.com/rs9313399-dot/identityscope/blob/main/src/components/identity/dashboard-view.tsx): `src/components/identity/dashboard-view.tsx`
- [Report view](https://github.com/rs9313399-dot/identityscope/blob/main/src/components/identity/report-view.tsx): `src/components/identity/report-view.tsx`
- [Compare view](https://github.com/rs9313399-dot/identityscope/blob/main/src/components/identity/compare-view.tsx): `src/components/identity/compare-view.tsx`
- [History view](https://github.com/rs9313399-dot/identityscope/blob/main/src/components/identity/history-view.tsx): `src/components/identity/history-view.tsx`
- [Bookmarks view](https://github.com/rs9313399-dot/identityscope/blob/main/src/components/identity/bookmarks-view.tsx): `src/components/identity/bookmarks-view.tsx`

### Identity scanning

- [Scan API](https://github.com/rs9313399-dot/identityscope/blob/main/src/app/api/scan/route.ts): `src/app/api/scan/route.ts`
- [Streaming scan](https://github.com/rs9313399-dot/identityscope/blob/main/src/app/api/scan-stream/route.ts): `src/app/api/scan-stream/route.ts`
- [GitHub analysis](https://github.com/rs9313399-dot/identityscope/blob/main/src/lib/apis/github.ts): `src/lib/apis/github.ts`
- [Codeforces lookup](https://github.com/rs9313399-dot/identityscope/blob/main/src/lib/apis/codeforces.ts): `src/lib/apis/codeforces.ts`
- [Website analysis](https://github.com/rs9313399-dot/identityscope/blob/main/src/lib/apis/website.ts): `src/lib/apis/website.ts`
- [Email validation](https://github.com/rs9313399-dot/identityscope/blob/main/src/lib/apis/email.ts): `src/lib/apis/email.ts`
- [Social discovery](https://github.com/rs9313399-dot/identityscope/blob/main/src/lib/apis/social.ts): `src/lib/apis/social.ts`
- [Package registries](https://github.com/rs9313399-dot/identityscope/blob/main/src/lib/apis/packages.ts): `src/lib/apis/packages.ts`

### Reports and insights

- [Scoring engine](https://github.com/rs9313399-dot/identityscope/blob/main/src/lib/scoring.ts): `src/lib/scoring.ts`
- [AI report API](https://github.com/rs9313399-dot/identityscope/blob/main/src/app/api/ai-report/route.ts): `src/app/api/ai-report/route.ts`
- [AI report stream](https://github.com/rs9313399-dot/identityscope/blob/main/src/app/api/ai-report-stream/route.ts): `src/app/api/ai-report-stream/route.ts`
- **AI model service**
- [Compare API](https://github.com/rs9313399-dot/identityscope/blob/main/src/app/api/compare/route.ts): `src/app/api/compare/route.ts`

### Saved records

- [Scan database](https://github.com/rs9313399-dot/identityscope/blob/main/src/lib/db.ts): `src/lib/db.ts`
- [History API](https://github.com/rs9313399-dot/identityscope/blob/main/src/app/api/history/route.ts): `src/app/api/history/route.ts`
- [Single scan API](https://github.com/rs9313399-dot/identityscope/blob/main/src/app/api/history/%5Bid%5D/route.ts): `src/app/api/history/[id]/route.ts`
- [Bookmarks API](https://github.com/rs9313399-dot/identityscope/blob/main/src/app/api/bookmarks/route.ts): `src/app/api/bookmarks/route.ts`

### Other components

- **User**

## Connections

- User → Landing view: opens
- User → Scanner view: enters scan
- Scanner view → Scan client: submits input (evidence: `src/hooks/use-scan.ts`)
- Scan client → Scan API: posts scan (evidence: `src/hooks/use-scan.ts`)
- Scan client → Streaming scan: streams scan (evidence: `src/hooks/use-scan.ts`)
- Scan client → App state: updates state (evidence: `src/hooks/use-scan.ts`)
- Scan API → GitHub analysis: queries (evidence: `src/app/api/scan/route.ts`)
- Scan API → Codeforces lookup: queries (evidence: `src/app/api/scan/route.ts`)
- Scan API → Website analysis: queries (evidence: `src/app/api/scan/route.ts`)
- Scan API → Email validation: queries (evidence: `src/app/api/scan/route.ts`)
- Scan API → Social discovery: queries (evidence: `src/app/api/scan/route.ts`)
- Scan API → Package registries: queries (evidence: `src/app/api/scan/route.ts`)
- Streaming scan → GitHub analysis: queries (evidence: `src/app/api/scan-stream/route.ts`)
- Streaming scan → Codeforces lookup: queries (evidence: `src/app/api/scan-stream/route.ts`)
- Streaming scan → Website analysis: queries (evidence: `src/app/api/scan-stream/route.ts`)
- Streaming scan → Email validation: queries (evidence: `src/app/api/scan-stream/route.ts`)
- Streaming scan → Social discovery: queries (evidence: `src/app/api/scan-stream/route.ts`)
- Streaming scan → Package registries: queries (evidence: `src/app/api/scan-stream/route.ts`)
- Scan API → Scoring engine: computes scores (evidence: `src/app/api/scan/route.ts`)
- Streaming scan → Scoring engine: computes scores (evidence: `src/app/api/scan-stream/route.ts`)
- Scan API → Scan database: persists scan (evidence: `src/app/api/scan/route.ts`)
- Streaming scan → Scan database: persists scan (evidence: `src/app/api/scan-stream/route.ts`)
- Dashboard → Scan client: uses scan (evidence: `src/components/identity/dashboard-view.tsx`)
- Dashboard → App state: reads report (evidence: `src/components/identity/dashboard-view.tsx`)
- Report view → App state: displays report
- User → Compare view: compares profiles
- Compare view → Compare API: requests comparison
- Compare API → Scan API: calls twice (evidence: `src/app/api/compare/route.ts`)
- User → AI report API: requests guidance
- Scan client → AI report API: posts report (evidence: `src/hooks/use-scan.ts`)
- Scan client → AI report stream: streams report (evidence: `src/hooks/use-scan.ts`)
- AI report API → Scoring engine: summarizes report (evidence: `src/app/api/ai-report/route.ts`)
- AI report API → AI model service: generates guidance (evidence: `src/app/api/ai-report/route.ts`)
- AI report stream → AI model service: generates guidance
- User → History view: reviews history
- History view → History API: loads records
- User → Bookmarks view: opens bookmarks
- Bookmarks view → Bookmarks API: loads bookmarks
- History API → Scan database: reads scans
- Single scan API → Scan database: reads or deletes (evidence: `src/app/api/history/[id]/route.ts`)
- Bookmarks API → Scan database: reads or updates (evidence: `src/app/api/bookmarks/route.ts`)
