# srikanth198v/weblens-pro architecture

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

- Interactive diagram: https://gitdiagram.com/srikanth198v/weblens-pro
- Repository: https://github.com/srikanth198v/weblens-pro

## Overview

WebLens Pro is a website-audit SaaS: a visitor submits a URL, an analysis run gathers and interprets evidence, and a dashboard presents scores and actionable recommendations. The product also supports accounts, saved and shared reports, comparisons, exports, and conversational questions. The graph reflects inspected excerpts and SOURCE INDEX references; several feature modules and route implementations were not sampled, so their internal wiring is omitted or marked unverified.

Main entry points: [`src/lib/analysis/live-engine.ts`](https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/analysis/live-engine.ts) (Live engine), [`src/lib/dashboard/build-report.ts`](https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/dashboard/build-report.ts) (Report builder), [`src/routes/report.tsx`](https://github.com/srikanth198v/weblens-pro/blob/main/src/routes/report.tsx) (Report view), [`src/hooks/use-session.ts`](https://github.com/srikanth198v/weblens-pro/blob/main/src/hooks/use-session.ts) (Session hook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and identity"]
  node_landing["Landing route<br/>[index.tsx]"]
  node_urlform["URL submission"]
  node_authroute["Account access<br/>[auth.tsx]"]
  node_session["Session hook<br/>[use-session.ts]"]
  node_supabase["Supabase client<br/>[client.ts]"]
end

subgraph group_analysis["Audit pipeline"]
  node_analysisroute["Analysis route<br/>[analysis.tsx]"]
  node_runhook["Analysis run"]
  node_engine["Live engine<br/>[live-engine.ts]"]
  node_inspection["Inspection functions"]
  node_evidence["Evidence model<br/>[evidence.ts]"]
  node_understanding["Site understanding<br/>[understanding.ts]"]
  node_scoring["Evidence scoring"]
  node_visual["Visual analysis"]
end

subgraph group_insights["Insights and chat"]
  node_dashboardbuilder["Report builder<br/>[build-report.ts]"]
  node_recommendations["Recommendation context"]
  node_dashboardroute["Dashboard route<br/>[dashboard.tsx]"]
  node_dashboardui["Dashboard presentation"]
  node_chatui["Ask WebLens UI<br/>[ask-weblens.tsx]"]
  node_chatservice["Chat service<br/>[ask.functions.ts]"]
end

subgraph group_reports["Reports and library"]
  node_libraryhook["Report library hook"]
  node_localreports[("Local report store<br/>[storage.ts]")]
  node_cloudreports[("Cloud reports<br/>[cloud.ts]")]
  node_reportroute["Report view<br/>[report.tsx]"]
  node_reportview["Report presentation"]
  node_comparison["Report comparison<br/>[compare.ts]"]
  node_sharing["Report sharing<br/>[share.ts]"]
  node_exports["Report export<br/>[export.ts]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_landing
node_landing -->|"renders"| node_urlform
node_landing -->|"navigates"| node_analysisroute
node_urlform -.->|"submits URL"| node_analysisroute
node_analysisroute -.->|"starts run"| node_runhook
node_runhook -.->|"runs analysis"| node_engine
node_engine -->|"invokes"| node_inspection
node_engine -->|"scores evidence"| node_scoring
node_engine -->|"interprets"| node_understanding
node_engine -->|"uses types"| node_evidence
node_dashboardbuilder -->|"reads"| node_evidence
node_dashboardbuilder -->|"uses scores"| node_scoring
node_dashboardbuilder -->|"uses"| node_understanding
node_dashboardbuilder -->|"builds context"| node_recommendations
node_recommendations -->|"classifies"| node_evidence
node_dashboardroute -->|"renders"| node_dashboardui
node_dashboardroute -.->|"loads report"| node_dashboardbuilder
node_chatui -->|"asks"| node_chatservice
node_authroute -->|"checks session"| node_session
node_session -->|"reads auth"| node_supabase
node_libraryhook -->|"uses identity"| node_session
node_libraryhook -->|"reads and writes"| node_localreports
node_libraryhook -->|"loads cloud reports"| node_cloudreports
node_reportroute -->|"builds view"| node_reportview
node_reportroute -->|"checks identity"| node_session
node_comparison -.->|"compares reports"| node_reportroute
node_sharing -.->|"uses report data"| node_cloudreports
node_exports -.->|"exports report"| node_reportroute
node_visual -.->|"contributes analysis"| node_engine

click node_landing "https://github.com/srikanth198v/weblens-pro/blob/main/src/routes/index.tsx"
click node_urlform "https://github.com/srikanth198v/weblens-pro/blob/main/src/components/landing/url-analyze-form.tsx"
click node_analysisroute "https://github.com/srikanth198v/weblens-pro/blob/main/src/routes/analysis.tsx"
click node_runhook "https://github.com/srikanth198v/weblens-pro/blob/main/src/hooks/use-analysis-run.ts"
click node_engine "https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/analysis/live-engine.ts"
click node_inspection "https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/analysis/inspect.functions.ts"
click node_evidence "https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/analysis/evidence.ts"
click node_understanding "https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/analysis/understanding.ts"
click node_scoring "https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/analysis/score-from-evidence.ts"
click node_dashboardbuilder "https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/dashboard/build-report.ts"
click node_recommendations "https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/analysis/recommendation-context.ts"
click node_dashboardroute "https://github.com/srikanth198v/weblens-pro/blob/main/src/routes/dashboard.tsx"
click node_dashboardui "https://github.com/srikanth198v/weblens-pro/tree/main/src/components/dashboard"
click node_chatui "https://github.com/srikanth198v/weblens-pro/blob/main/src/components/chat/ask-weblens.tsx"
click node_chatservice "https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/chat/ask.functions.ts"
click node_authroute "https://github.com/srikanth198v/weblens-pro/blob/main/src/routes/auth.tsx"
click node_session "https://github.com/srikanth198v/weblens-pro/blob/main/src/hooks/use-session.ts"
click node_supabase "https://github.com/srikanth198v/weblens-pro/blob/main/src/integrations/supabase/client.ts"
click node_libraryhook "https://github.com/srikanth198v/weblens-pro/blob/main/src/hooks/use-report-library.ts"
click node_localreports "https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/reports/storage.ts"
click node_cloudreports "https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/reports/cloud.ts"
click node_reportroute "https://github.com/srikanth198v/weblens-pro/blob/main/src/routes/report.tsx"
click node_reportview "https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/report/build-report-view.ts"
click node_comparison "https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/report/compare.ts"
click node_sharing "https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/reports/share.ts"
click node_exports "https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/dashboard/export.ts"
click node_visual "https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/visual/analyze.functions.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_landing,node_urlform,node_authroute,node_session,node_supabase toneBlue
class node_analysisroute,node_runhook,node_engine,node_inspection,node_evidence,node_understanding,node_scoring,node_visual toneAmber
class node_dashboardbuilder,node_recommendations,node_dashboardroute,node_dashboardui,node_chatui,node_chatservice toneMint
class node_libraryhook,node_localreports,node_cloudreports,node_reportroute,node_reportview,node_comparison,node_sharing,node_exports toneRose
class node_visitor toneIndigo
```

## Components

### Entry and identity

- [Landing route](https://github.com/srikanth198v/weblens-pro/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [URL submission](https://github.com/srikanth198v/weblens-pro/blob/main/src/components/landing/url-analyze-form.tsx): `src/components/landing/url-analyze-form.tsx`
- [Account access](https://github.com/srikanth198v/weblens-pro/blob/main/src/routes/auth.tsx): `src/routes/auth.tsx`
- [Session hook](https://github.com/srikanth198v/weblens-pro/blob/main/src/hooks/use-session.ts): `src/hooks/use-session.ts`
- [Supabase client](https://github.com/srikanth198v/weblens-pro/blob/main/src/integrations/supabase/client.ts): `src/integrations/supabase/client.ts`

### Audit pipeline

- [Analysis route](https://github.com/srikanth198v/weblens-pro/blob/main/src/routes/analysis.tsx): `src/routes/analysis.tsx`
- [Analysis run](https://github.com/srikanth198v/weblens-pro/blob/main/src/hooks/use-analysis-run.ts): `src/hooks/use-analysis-run.ts`
- [Live engine](https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/analysis/live-engine.ts): `src/lib/analysis/live-engine.ts`
- [Inspection functions](https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/analysis/inspect.functions.ts): `src/lib/analysis/inspect.functions.ts`
- [Evidence model](https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/analysis/evidence.ts): `src/lib/analysis/evidence.ts`
- [Site understanding](https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/analysis/understanding.ts): `src/lib/analysis/understanding.ts`
- [Evidence scoring](https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/analysis/score-from-evidence.ts): `src/lib/analysis/score-from-evidence.ts`
- [Visual analysis](https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/visual/analyze.functions.ts): `src/lib/visual/analyze.functions.ts`

### Insights and chat

- [Report builder](https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/dashboard/build-report.ts): `src/lib/dashboard/build-report.ts`
- [Recommendation context](https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/analysis/recommendation-context.ts): `src/lib/analysis/recommendation-context.ts`
- [Dashboard route](https://github.com/srikanth198v/weblens-pro/blob/main/src/routes/dashboard.tsx): `src/routes/dashboard.tsx`
- [Dashboard presentation](https://github.com/srikanth198v/weblens-pro/tree/main/src/components/dashboard): `src/components/dashboard`
- [Ask WebLens UI](https://github.com/srikanth198v/weblens-pro/blob/main/src/components/chat/ask-weblens.tsx): `src/components/chat/ask-weblens.tsx`
- [Chat service](https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/chat/ask.functions.ts): `src/lib/chat/ask.functions.ts`

### Reports and library

- [Report library hook](https://github.com/srikanth198v/weblens-pro/blob/main/src/hooks/use-report-library.ts): `src/hooks/use-report-library.ts`
- [Local report store](https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/reports/storage.ts): `src/lib/reports/storage.ts`
- [Cloud reports](https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/reports/cloud.ts): `src/lib/reports/cloud.ts`
- [Report view](https://github.com/srikanth198v/weblens-pro/blob/main/src/routes/report.tsx): `src/routes/report.tsx`
- [Report presentation](https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/report/build-report-view.ts): `src/lib/report/build-report-view.ts`
- [Report comparison](https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/report/compare.ts): `src/lib/report/compare.ts`
- [Report sharing](https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/reports/share.ts): `src/lib/reports/share.ts`
- [Report export](https://github.com/srikanth198v/weblens-pro/blob/main/src/lib/dashboard/export.ts): `src/lib/dashboard/export.ts`

### Other components

- **Visitor**

## Connections

- Visitor → Landing route: opens (evidence: `src/routes/index.tsx`)
- Landing route → URL submission: renders (evidence: `src/routes/index.tsx`)
- Landing route → Analysis route: navigates (evidence: `src/routes/index.tsx`)
- URL submission → Analysis route: submits URL
- Analysis route → Analysis run: starts run
- Analysis run → Live engine: runs analysis
- Live engine → Inspection functions: invokes (evidence: `src/lib/analysis/live-engine.ts`)
- Live engine → Evidence scoring: scores evidence (evidence: `src/lib/analysis/live-engine.ts`)
- Live engine → Site understanding: interprets (evidence: `src/lib/analysis/live-engine.ts`)
- Live engine → Evidence model: uses types (evidence: `src/lib/analysis/live-engine.ts`)
- Report builder → Evidence model: reads (evidence: `src/lib/dashboard/build-report.ts`)
- Report builder → Evidence scoring: uses scores (evidence: `src/lib/dashboard/build-report.ts`)
- Report builder → Site understanding: uses (evidence: `src/lib/dashboard/build-report.ts`)
- Report builder → Recommendation context: builds context (evidence: `src/lib/dashboard/build-report.ts`)
- Recommendation context → Evidence model: classifies (evidence: `src/lib/analysis/recommendation-context.ts`)
- Dashboard route → Dashboard presentation: renders (evidence: `src/routes/dashboard.tsx`)
- Dashboard route → Report builder: loads report
- Ask WebLens UI → Chat service: asks (evidence: `src/components/chat/ask-weblens.tsx`)
- Account access → Session hook: checks session (evidence: `src/routes/auth.tsx`)
- Session hook → Supabase client: reads auth (evidence: `src/hooks/use-session.ts`)
- Report library hook → Session hook: uses identity (evidence: `src/hooks/use-report-library.ts`)
- Report library hook → Local report store: reads and writes (evidence: `src/hooks/use-report-library.ts`)
- Report library hook → Cloud reports: loads cloud reports (evidence: `src/hooks/use-report-library.ts`)
- Report view → Report presentation: builds view (evidence: `src/routes/report.tsx`)
- Report view → Session hook: checks identity (evidence: `src/routes/report.tsx`)
- Report comparison → Report view: compares reports
- Report sharing → Cloud reports: uses report data
- Report export → Report view: exports report
- Visual analysis → Live engine: contributes analysis
