# omi1739/github-project-intelligence architecture

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

- Interactive diagram: https://gitdiagram.com/omi1739/github-project-intelligence
- Repository: https://github.com/omi1739/github-project-intelligence

## Overview

GPI is a browser-only GitHub repository intelligence extension. A user opens a GitHub repo and starts analysis from the page or side panel; the side panel resolves the repository, the analysis service collects repository data, builds a deterministic multi-domain report, caches it locally, and renders report sections. Options configure the GitHub token and cache, while the documented AI provider layer is optional and currently hidden in the UI. Some wiring is documented rather than excerpted, so unverified links are omitted.

Main entry points: [`src/analyzers/index.ts`](https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/index.ts) (Report builder), [`src/services/analysis.ts`](https://github.com/omi1739/github-project-intelligence/blob/main/src/services/analysis.ts) (Analysis orchestration), [`src/sidepanel/App.tsx`](https://github.com/omi1739/github-project-intelligence/blob/main/src/sidepanel/App.tsx) (Side panel app), [`src/services/github.ts`](https://github.com/omi1739/github-project-intelligence/blob/main/src/services/github.ts) (GitHub collector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Extension entry"]
  node_content_detector["Repo page detector<br/>[github-detector.ts]"]
  node_service_worker["Extension worker<br/>[service-worker.ts]"]
end

subgraph group_collection["Repository collection"]
  node_analysis_service["Analysis orchestration<br/>[analysis.ts]"]
  node_github_collector["GitHub collector<br/>[github.ts]"]
  node_local_storage[("Local settings and cache<br/>[storage.ts]")]
end

subgraph group_analysis["Analysis engine"]
  node_report_builder["Report builder<br/>[index.ts]"]
  node_stack["Stack detection<br/>[stack.ts]"]
  node_structure["Structure inference<br/>[structure.ts]"]
  node_dependencies["Dependency analysis<br/>[dependencies.ts]"]
  node_testing["Testing analysis<br/>[testing.ts]"]
  node_security["Security signals<br/>[security.ts]"]
  node_quality["Code quality<br/>[quality.ts]"]
  node_readme_analysis["README analysis<br/>[readme.ts]"]
  node_activity["Activity and overview<br/>[activity.ts]"]
  node_health["Health scoring<br/>[health.ts]"]
  node_manifest_parser["Manifest parsing<br/>[manifest.ts]"]
end

subgraph group_presentation["Report interface"]
  node_sidepanel_app["Side panel app<br/>[App.tsx]"]
  node_report_sections["Report sections"]
end

subgraph group_settings["Settings and AI"]
  node_options_app["Options interface<br/>[OptionsApp.tsx]"]
  node_ai_service["Optional AI providers<br/>[ai.ts]"]
  node_redaction["Secret redaction<br/>[redact.ts]"]
end

node_user(("Repository user"))
node_github["GitHub repository"]
node_github_api["GitHub API"]

node_user -->|"opens repo page"| node_content_detector
node_content_detector -->|"detects repo page"| node_github
node_user -->|"opens side panel"| node_sidepanel_app
node_sidepanel_app -->|"requests analysis"| node_analysis_service
node_sidepanel_app -->|"loads cached report"| node_analysis_service
node_analysis_service -->|"collects repository data"| node_github_collector
node_github_collector -->|"requests repository data"| node_github_api
node_github_collector -->|"fetches raw files"| node_github
node_analysis_service -->|"reads and writes cache"| node_local_storage
node_analysis_service -->|"builds report"| node_report_builder
node_report_builder -->|"runs detection"| node_stack
node_report_builder -->|"runs analysis"| node_structure
node_report_builder -->|"runs analysis"| node_dependencies
node_report_builder -->|"runs analysis"| node_testing
node_report_builder -->|"runs analysis"| node_security
node_report_builder -->|"runs analysis"| node_quality
node_report_builder -->|"runs analysis"| node_readme_analysis
node_report_builder -->|"builds overview"| node_activity
node_report_builder -->|"calculates score"| node_health
node_stack -->|"parses dependencies"| node_manifest_parser
node_sidepanel_app -->|"renders report"| node_report_sections
node_user -->|"configures extension"| node_options_app
node_options_app -->|"loads and saves settings"| node_local_storage
node_ai_service -->|"redacts secrets"| node_redaction
node_report_builder -.->|"can summarize report"| node_ai_service

click node_content_detector "https://github.com/omi1739/github-project-intelligence/blob/main/src/content/github-detector.ts"
click node_service_worker "https://github.com/omi1739/github-project-intelligence/blob/main/src/background/service-worker.ts"
click node_sidepanel_app "https://github.com/omi1739/github-project-intelligence/blob/main/src/sidepanel/App.tsx"
click node_analysis_service "https://github.com/omi1739/github-project-intelligence/blob/main/src/services/analysis.ts"
click node_github_collector "https://github.com/omi1739/github-project-intelligence/blob/main/src/services/github.ts"
click node_local_storage "https://github.com/omi1739/github-project-intelligence/blob/main/src/services/storage.ts"
click node_report_builder "https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/index.ts"
click node_stack "https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/stack.ts"
click node_structure "https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/structure.ts"
click node_dependencies "https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/dependencies.ts"
click node_testing "https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/testing.ts"
click node_security "https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/security.ts"
click node_quality "https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/quality.ts"
click node_readme_analysis "https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/readme.ts"
click node_activity "https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/activity.ts"
click node_health "https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/health.ts"
click node_report_sections "https://github.com/omi1739/github-project-intelligence/tree/main/src/sidepanel/components/sections"
click node_options_app "https://github.com/omi1739/github-project-intelligence/blob/main/src/options/OptionsApp.tsx"
click node_ai_service "https://github.com/omi1739/github-project-intelligence/blob/main/src/services/ai.ts"
click node_redaction "https://github.com/omi1739/github-project-intelligence/blob/main/src/utils/redact.ts"
click node_manifest_parser "https://github.com/omi1739/github-project-intelligence/blob/main/src/utils/manifest.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_content_detector,node_service_worker,node_user toneBlue
class node_analysis_service,node_github_collector,node_local_storage toneAmber
class node_report_builder,node_stack,node_structure,node_dependencies,node_testing,node_security,node_quality,node_readme_analysis,node_activity,node_health,node_manifest_parser,node_github_api toneMint
class node_sidepanel_app,node_report_sections toneRose
class node_options_app,node_ai_service,node_redaction,node_github toneIndigo
```

## Components

### Extension entry

- [Repo page detector](https://github.com/omi1739/github-project-intelligence/blob/main/src/content/github-detector.ts): `src/content/github-detector.ts`
- [Extension worker](https://github.com/omi1739/github-project-intelligence/blob/main/src/background/service-worker.ts): `src/background/service-worker.ts`

### Repository collection

- [Analysis orchestration](https://github.com/omi1739/github-project-intelligence/blob/main/src/services/analysis.ts): `src/services/analysis.ts`
- [GitHub collector](https://github.com/omi1739/github-project-intelligence/blob/main/src/services/github.ts): `src/services/github.ts`
- [Local settings and cache](https://github.com/omi1739/github-project-intelligence/blob/main/src/services/storage.ts): `src/services/storage.ts`

### Analysis engine

- [Report builder](https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/index.ts): `src/analyzers/index.ts`
- [Stack detection](https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/stack.ts): `src/analyzers/stack.ts`
- [Structure inference](https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/structure.ts): `src/analyzers/structure.ts`
- [Dependency analysis](https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/dependencies.ts): `src/analyzers/dependencies.ts`
- [Testing analysis](https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/testing.ts): `src/analyzers/testing.ts`
- [Security signals](https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/security.ts): `src/analyzers/security.ts`
- [Code quality](https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/quality.ts): `src/analyzers/quality.ts`
- [README analysis](https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/readme.ts): `src/analyzers/readme.ts`
- [Activity and overview](https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/activity.ts): `src/analyzers/activity.ts`
- [Health scoring](https://github.com/omi1739/github-project-intelligence/blob/main/src/analyzers/health.ts): `src/analyzers/health.ts`
- [Manifest parsing](https://github.com/omi1739/github-project-intelligence/blob/main/src/utils/manifest.ts): `src/utils/manifest.ts`

### Report interface

- [Side panel app](https://github.com/omi1739/github-project-intelligence/blob/main/src/sidepanel/App.tsx): `src/sidepanel/App.tsx`
- [Report sections](https://github.com/omi1739/github-project-intelligence/tree/main/src/sidepanel/components/sections): `src/sidepanel/components/sections`

### Settings and AI

- [Options interface](https://github.com/omi1739/github-project-intelligence/blob/main/src/options/OptionsApp.tsx): `src/options/OptionsApp.tsx`
- [Optional AI providers](https://github.com/omi1739/github-project-intelligence/blob/main/src/services/ai.ts): `src/services/ai.ts`
- [Secret redaction](https://github.com/omi1739/github-project-intelligence/blob/main/src/utils/redact.ts): `src/utils/redact.ts`

### Other components

- **Repository user**
- **GitHub repository**
- **GitHub API**

## Connections

- Repository user → Repo page detector: opens repo page (evidence: `README.md`)
- Repo page detector → GitHub repository: detects repo page (evidence: `README.md`)
- Repository user → Side panel app: opens side panel (evidence: `README.md`)
- Side panel app → Analysis orchestration: requests analysis (evidence: `src/sidepanel/App.tsx`)
- Side panel app → Analysis orchestration: loads cached report (evidence: `src/sidepanel/App.tsx`)
- Analysis orchestration → GitHub collector: collects repository data (evidence: `src/services/analysis.ts`)
- GitHub collector → GitHub API: requests repository data (evidence: `README.md`)
- GitHub collector → GitHub repository: fetches raw files (evidence: `README.md`)
- Analysis orchestration → Local settings and cache: reads and writes cache (evidence: `src/services/analysis.ts`)
- Analysis orchestration → Report builder: builds report (evidence: `src/services/analysis.ts`)
- Report builder → Stack detection: runs detection (evidence: `src/analyzers/index.ts`)
- Report builder → Structure inference: runs analysis (evidence: `src/analyzers/index.ts`)
- Report builder → Dependency analysis: runs analysis (evidence: `src/analyzers/index.ts`)
- Report builder → Testing analysis: runs analysis (evidence: `src/analyzers/index.ts`)
- Report builder → Security signals: runs analysis (evidence: `src/analyzers/index.ts`)
- Report builder → Code quality: runs analysis (evidence: `src/analyzers/index.ts`)
- Report builder → README analysis: runs analysis (evidence: `src/analyzers/index.ts`)
- Report builder → Activity and overview: builds overview (evidence: `src/analyzers/index.ts`)
- Report builder → Health scoring: calculates score (evidence: `src/analyzers/index.ts`)
- Stack detection → Manifest parsing: parses dependencies (evidence: `src/analyzers/stack.ts`)
- Side panel app → Report sections: renders report (evidence: `src/sidepanel/App.tsx`)
- Repository user → Options interface: configures extension (evidence: `README.md`)
- Options interface → Local settings and cache: loads and saves settings (evidence: `src/options/OptionsApp.tsx`)
- Optional AI providers → Secret redaction: redacts secrets (evidence: `src/services/ai.ts`)
- Report builder → Optional AI providers: can summarize report (evidence: `README.md`)
