# nainar1409-sketch/fact-lens-pro architecture

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

- Interactive diagram: https://gitdiagram.com/nainar1409-sketch/fact-lens-pro
- Repository: https://github.com/nainar1409-sketch/fact-lens-pro

## Overview

Truth Compass is a news-credibility analysis web app. Users submit text, a URL, or a selected file; the main page invokes the Supabase `analyze-news` function, then displays the returned score, model breakdown, factors, and sources. A separate monitoring page reads monitored-news records and offers scan controls. The README describes broader ML and verification capabilities, but sampled code does not establish their implementation details, so those are represented only where the tree supports a subsystem. Unsampled function internals and scan dispatch are not inferred.

Main entry points: [`src/pages/Index.tsx`](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/pages/Index.tsx) (Analysis page), [`src/pages/MonitoringDashboard.tsx`](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/pages/MonitoringDashboard.tsx) (Monitoring dashboard), [`src/components/ResultsDashboard.tsx`](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/ResultsDashboard.tsx) (Results dashboard), [`src/integrations/supabase/client.ts`](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/integrations/supabase/client.ts) (Supabase client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["App router<br/>[App.tsx]"]
  node_analysis_page["Analysis page<br/>[Index.tsx]"]
  node_news_input["News input<br/>[NewsInput.tsx]"]
  node_results["Results dashboard"]
  node_gauge["Truth gauge<br/>[TruthGauge.tsx]"]
  node_model_view["Model breakdown<br/>[ModelBreakdown.tsx]"]
  node_factors["Key factors<br/>[KeyFactors.tsx]"]
  node_source_view["Source verification"]
  node_header["Site header<br/>[Header.tsx]"]
  node_hero["Landing hero<br/>[Hero.tsx]"]
  node_how_it_works["How it works<br/>[HowItWorks.tsx]"]
  node_footer["Site footer<br/>[Footer.tsx]"]
end

subgraph group_analysis["News analysis"]
  node_analyze_fn["Analysis function<br/>[index.ts]"]
end

subgraph group_monitor["News monitoring"]
  node_monitor_page["Monitoring dashboard"]
  node_monitored_store[("Monitored news")]
  node_monitor_fn["Monitoring function<br/>[index.ts]"]
end

subgraph group_auth["Supabase integration"]
  node_supabase["Supabase client<br/>[client.ts]"]
  node_preview_storage["Preview auth storage"]
end

node_visitor(("News analyst"))

node_visitor -->|"opens"| node_analysis_page
node_app -->|"routes to"| node_analysis_page
node_app -->|"routes to"| node_monitor_page
node_analysis_page -->|"renders"| node_header
node_analysis_page -->|"renders"| node_hero
node_analysis_page -->|"renders"| node_news_input
node_analysis_page -->|"renders"| node_how_it_works
node_analysis_page -->|"renders"| node_footer
node_news_input -->|"submits content"| node_analysis_page
node_analysis_page -->|"invokes function"| node_supabase
node_analysis_page -->|"sends text"| node_analyze_fn
node_analysis_page -->|"renders result"| node_results
node_results -->|"renders"| node_gauge
node_results -->|"renders"| node_model_view
node_results -->|"renders"| node_factors
node_results -->|"renders"| node_source_view
node_monitor_page -->|"renders"| node_header
node_monitor_page -->|"renders"| node_footer
node_monitor_page -->|"queries records"| node_supabase
node_monitor_page -->|"reads"| node_monitored_store
node_supabase -->|"configures auth"| node_preview_storage
node_monitor_page -.->|"may dispatch scan"| node_monitor_fn

click node_app "https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/App.tsx"
click node_analysis_page "https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/pages/Index.tsx"
click node_news_input "https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/NewsInput.tsx"
click node_results "https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/ResultsDashboard.tsx"
click node_gauge "https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/TruthGauge.tsx"
click node_model_view "https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/ModelBreakdown.tsx"
click node_factors "https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/KeyFactors.tsx"
click node_source_view "https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/SourceVerification.tsx"
click node_header "https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/Header.tsx"
click node_hero "https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/Hero.tsx"
click node_how_it_works "https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/HowItWorks.tsx"
click node_footer "https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/Footer.tsx"
click node_analyze_fn "https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/supabase/functions/analyze-news/index.ts"
click node_monitor_page "https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/pages/MonitoringDashboard.tsx"
click node_monitor_fn "https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/supabase/functions/monitor-news/index.ts"
click node_supabase "https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/integrations/supabase/client.ts"
click node_preview_storage "https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/integrations/supabase/previewAuthStorage.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_app,node_analysis_page,node_news_input,node_results,node_gauge,node_model_view,node_factors,node_source_view,node_header,node_hero,node_how_it_works,node_footer toneBlue
class node_analyze_fn toneAmber
class node_monitor_page,node_monitored_store,node_monitor_fn toneMint
class node_supabase,node_preview_storage toneRose
class node_visitor toneIndigo
```

## Components

### Web application

- [App router](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/App.tsx): `src/App.tsx`
- [Analysis page](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/pages/Index.tsx): `src/pages/Index.tsx`
- [News input](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/NewsInput.tsx): `src/components/NewsInput.tsx`
- [Results dashboard](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/ResultsDashboard.tsx): `src/components/ResultsDashboard.tsx`
- [Truth gauge](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/TruthGauge.tsx): `src/components/TruthGauge.tsx`
- [Model breakdown](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/ModelBreakdown.tsx): `src/components/ModelBreakdown.tsx`
- [Key factors](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/KeyFactors.tsx): `src/components/KeyFactors.tsx`
- [Source verification](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/SourceVerification.tsx): `src/components/SourceVerification.tsx`
- [Site header](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/Header.tsx): `src/components/Header.tsx`
- [Landing hero](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/Hero.tsx): `src/components/Hero.tsx`
- [How it works](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/HowItWorks.tsx): `src/components/HowItWorks.tsx`
- [Site footer](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/components/Footer.tsx): `src/components/Footer.tsx`

### News analysis

- [Analysis function](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/supabase/functions/analyze-news/index.ts): `supabase/functions/analyze-news/index.ts`

### News monitoring

- [Monitoring dashboard](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/pages/MonitoringDashboard.tsx): `src/pages/MonitoringDashboard.tsx`
- **Monitored news**
- [Monitoring function](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/supabase/functions/monitor-news/index.ts): `supabase/functions/monitor-news/index.ts`

### Supabase integration

- [Supabase client](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/integrations/supabase/client.ts): `src/integrations/supabase/client.ts`
- [Preview auth storage](https://github.com/nainar1409-sketch/fact-lens-pro/blob/main/src/integrations/supabase/previewAuthStorage.ts): `src/integrations/supabase/previewAuthStorage.ts`

### Other components

- **News analyst**

## Connections

- News analyst → Analysis page: opens
- App router → Analysis page: routes to (evidence: `src/App.tsx`)
- App router → Monitoring dashboard: routes to (evidence: `src/App.tsx`)
- Analysis page → Site header: renders (evidence: `src/pages/Index.tsx`)
- Analysis page → Landing hero: renders (evidence: `src/pages/Index.tsx`)
- Analysis page → News input: renders (evidence: `src/pages/Index.tsx`)
- Analysis page → How it works: renders (evidence: `src/pages/Index.tsx`)
- Analysis page → Site footer: renders (evidence: `src/pages/Index.tsx`)
- News input → Analysis page: submits content (evidence: `src/pages/Index.tsx`)
- Analysis page → Supabase client: invokes function (evidence: `src/pages/Index.tsx`)
- Analysis page → Analysis function: sends text (evidence: `src/pages/Index.tsx`)
- Analysis page → Results dashboard: renders result (evidence: `src/pages/Index.tsx`)
- Results dashboard → Truth gauge: renders (evidence: `src/components/ResultsDashboard.tsx`)
- Results dashboard → Model breakdown: renders (evidence: `src/components/ResultsDashboard.tsx`)
- Results dashboard → Key factors: renders (evidence: `src/components/ResultsDashboard.tsx`)
- Results dashboard → Source verification: renders (evidence: `src/components/ResultsDashboard.tsx`)
- Monitoring dashboard → Site header: renders (evidence: `src/pages/MonitoringDashboard.tsx`)
- Monitoring dashboard → Site footer: renders (evidence: `src/pages/MonitoringDashboard.tsx`)
- Monitoring dashboard → Supabase client: queries records (evidence: `src/pages/MonitoringDashboard.tsx`)
- Monitoring dashboard → Monitored news: reads (evidence: `src/pages/MonitoringDashboard.tsx`)
- Supabase client → Preview auth storage: configures auth (evidence: `src/integrations/supabase/client.ts`)
- Monitoring dashboard → Monitoring function: may dispatch scan
