# engineerdaoud/optix architecture

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

- Interactive diagram: https://gitdiagram.com/engineerdaoud/optix
- Repository: https://github.com/engineerdaoud/optix

## Overview

SEOPilot is a website-monitoring and SEO research product. A user signs in, adds a site, then uses the dashboard to run site checks and view SEO, speed, ranking, and traffic results. Separate workflows connect Google data, research keywords and competitors, track traffic history, manage tasks, and produce reports. The graph combines documented product flows with source-index-supported shared modules; several page-to-function links are documented by the README rather than shown in the sampled page code.

Main entry points: [`src/context/Site.tsx`](https://github.com/engineerdaoud/optix/blob/main/src/context/Site.tsx) (Site management), [`src/pages/Dashboard.tsx`](https://github.com/engineerdaoud/optix/blob/main/src/pages/Dashboard.tsx) (Dashboard), [`supabase/functions/research/index.ts`](https://github.com/engineerdaoud/optix/blob/main/supabase/functions/research/index.ts) (Research function), [`supabase/functions/_shared/traffic.ts`](https://github.com/engineerdaoud/optix/blob/main/supabase/functions/_shared/traffic.ts) (Traffic analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and Sites"]
  node_auth["Authentication<br/>[Auth.tsx]"]
  node_site["Site management<br/>[Site.tsx]"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
end

subgraph group_analysis["Site Analysis"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_crawl["Site crawl<br/>[index.ts]"]
  node_audit["SEO audit<br/>[index.ts]"]
  node_analysis_helpers["Site analysis helpers<br/>[analyse.ts]"]
  node_siteinfo["Site data helpers<br/>[siteinfo.ts]"]
end

subgraph group_research["Research and Links"]
  node_research_page["Domain research<br/>[Research.tsx]"]
  node_research_fn["Research function<br/>[index.ts]"]
  node_keywordlab["Keyword Lab<br/>[KeywordLab.tsx]"]
  node_bank[("Keyword data bank<br/>[bank.ts]")]
  node_backlinks["Backlink analysis<br/>[index.ts]"]
end

subgraph group_insights["Traffic and Insights"]
  node_integrations["Google integrations<br/>[Integrations.tsx]"]
  node_google_fn["Google connection<br/>[index.ts]"]
  node_traffic_fn["Traffic analysis<br/>[traffic.ts]"]
  node_traffic_page["Traffic history<br/>[Traffic.tsx]"]
end

subgraph group_reporting["Tasks and Reports"]
  node_tasks["SEO tasks<br/>[Tasks.tsx]"]
  node_reports["Reports<br/>[Reports.tsx]"]
  node_report_fn["Report generation<br/>[index.ts]"]
  node_scheduled["Scheduled jobs<br/>[index.ts]"]
end

node_user(("Site owner"))
node_supabase[("Supabase")]
node_google["Google APIs"]
node_serper["Serper search data"]

node_user -->|"signs in"| node_auth
node_auth -->|"checks session"| node_supabase_client
node_user -->|"adds site"| node_site
node_site -->|"manages sites"| node_supabase_client
node_site -->|"stores site"| node_supabase
node_user -->|"opens dashboard"| node_dashboard
node_dashboard -.->|"runs checks"| node_crawl
node_dashboard -.->|"runs audit"| node_audit
node_crawl -->|"uses analysis"| node_analysis_helpers
node_analysis_helpers -->|"uses site data"| node_siteinfo
node_user -->|"researches domains"| node_research_page
node_research_page -.->|"requests research"| node_research_fn
node_research_fn -->|"reuses saved data"| node_bank
node_user -->|"explores keywords"| node_keywordlab
node_keywordlab -.->|"queries keyword bank"| node_bank
node_user -->|"checks backlinks"| node_backlinks
node_backlinks -->|"uses link bank"| node_bank
node_user -->|"connects Google"| node_integrations
node_integrations -.->|"starts OAuth"| node_google_fn
node_google_fn -.->|"connects APIs"| node_google
node_user -->|"loads history"| node_traffic_page
node_traffic_page -.->|"requests traffic"| node_traffic_fn
node_traffic_fn -.->|"reads Google data"| node_google
node_user -->|"manages tasks"| node_tasks
node_tasks -->|"reads and writes tasks"| node_supabase
node_user -->|"views reports"| node_reports
node_report_fn -.->|"saves reports"| node_supabase
node_scheduled -.->|"runs due reports"| node_report_fn
node_scheduled -.->|"syncs sites"| node_traffic_fn
node_research_fn -.->|"checks search results"| node_serper

click node_auth "https://github.com/engineerdaoud/optix/blob/main/src/context/Auth.tsx"
click node_site "https://github.com/engineerdaoud/optix/blob/main/src/context/Site.tsx"
click node_supabase_client "https://github.com/engineerdaoud/optix/blob/main/src/lib/supabase.ts"
click node_dashboard "https://github.com/engineerdaoud/optix/blob/main/src/pages/Dashboard.tsx"
click node_crawl "https://github.com/engineerdaoud/optix/blob/main/supabase/functions/crawl/index.ts"
click node_audit "https://github.com/engineerdaoud/optix/blob/main/supabase/functions/audit/index.ts"
click node_analysis_helpers "https://github.com/engineerdaoud/optix/blob/main/supabase/functions/_shared/analyse.ts"
click node_siteinfo "https://github.com/engineerdaoud/optix/blob/main/supabase/functions/_shared/siteinfo.ts"
click node_research_page "https://github.com/engineerdaoud/optix/blob/main/src/pages/Research.tsx"
click node_research_fn "https://github.com/engineerdaoud/optix/blob/main/supabase/functions/research/index.ts"
click node_keywordlab "https://github.com/engineerdaoud/optix/blob/main/src/pages/KeywordLab.tsx"
click node_bank "https://github.com/engineerdaoud/optix/blob/main/supabase/functions/_shared/bank.ts"
click node_backlinks "https://github.com/engineerdaoud/optix/blob/main/supabase/functions/backlinks/index.ts"
click node_integrations "https://github.com/engineerdaoud/optix/blob/main/src/pages/Integrations.tsx"
click node_google_fn "https://github.com/engineerdaoud/optix/blob/main/supabase/functions/google/index.ts"
click node_traffic_fn "https://github.com/engineerdaoud/optix/blob/main/supabase/functions/_shared/traffic.ts"
click node_traffic_page "https://github.com/engineerdaoud/optix/blob/main/src/pages/Traffic.tsx"
click node_tasks "https://github.com/engineerdaoud/optix/blob/main/src/pages/Tasks.tsx"
click node_reports "https://github.com/engineerdaoud/optix/blob/main/src/pages/Reports.tsx"
click node_report_fn "https://github.com/engineerdaoud/optix/blob/main/supabase/functions/report/index.ts"
click node_scheduled "https://github.com/engineerdaoud/optix/blob/main/supabase/functions/scheduled/index.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_auth,node_site,node_supabase_client toneBlue
class node_dashboard,node_crawl,node_audit,node_analysis_helpers,node_siteinfo,node_supabase toneAmber
class node_research_page,node_research_fn,node_keywordlab,node_bank,node_backlinks,node_google toneMint
class node_integrations,node_google_fn,node_traffic_fn,node_traffic_page toneRose
class node_tasks,node_reports,node_report_fn,node_scheduled,node_user,node_serper toneIndigo
```

## Components

### Access and Sites

- [Authentication](https://github.com/engineerdaoud/optix/blob/main/src/context/Auth.tsx): `src/context/Auth.tsx`
- [Site management](https://github.com/engineerdaoud/optix/blob/main/src/context/Site.tsx): `src/context/Site.tsx`
- [Supabase client](https://github.com/engineerdaoud/optix/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`

### Site Analysis

- [Dashboard](https://github.com/engineerdaoud/optix/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [Site crawl](https://github.com/engineerdaoud/optix/blob/main/supabase/functions/crawl/index.ts): `supabase/functions/crawl/index.ts`
- [SEO audit](https://github.com/engineerdaoud/optix/blob/main/supabase/functions/audit/index.ts): `supabase/functions/audit/index.ts`
- [Site analysis helpers](https://github.com/engineerdaoud/optix/blob/main/supabase/functions/_shared/analyse.ts): `supabase/functions/_shared/analyse.ts`
- [Site data helpers](https://github.com/engineerdaoud/optix/blob/main/supabase/functions/_shared/siteinfo.ts): `supabase/functions/_shared/siteinfo.ts`

### Research and Links

- [Domain research](https://github.com/engineerdaoud/optix/blob/main/src/pages/Research.tsx): `src/pages/Research.tsx`
- [Research function](https://github.com/engineerdaoud/optix/blob/main/supabase/functions/research/index.ts): `supabase/functions/research/index.ts`
- [Keyword Lab](https://github.com/engineerdaoud/optix/blob/main/src/pages/KeywordLab.tsx): `src/pages/KeywordLab.tsx`
- [Keyword data bank](https://github.com/engineerdaoud/optix/blob/main/supabase/functions/_shared/bank.ts): `supabase/functions/_shared/bank.ts`
- [Backlink analysis](https://github.com/engineerdaoud/optix/blob/main/supabase/functions/backlinks/index.ts): `supabase/functions/backlinks/index.ts`

### Traffic and Insights

- [Google integrations](https://github.com/engineerdaoud/optix/blob/main/src/pages/Integrations.tsx): `src/pages/Integrations.tsx`
- [Google connection](https://github.com/engineerdaoud/optix/blob/main/supabase/functions/google/index.ts): `supabase/functions/google/index.ts`
- [Traffic analysis](https://github.com/engineerdaoud/optix/blob/main/supabase/functions/_shared/traffic.ts): `supabase/functions/_shared/traffic.ts`
- [Traffic history](https://github.com/engineerdaoud/optix/blob/main/src/pages/Traffic.tsx): `src/pages/Traffic.tsx`

### Tasks and Reports

- [SEO tasks](https://github.com/engineerdaoud/optix/blob/main/src/pages/Tasks.tsx): `src/pages/Tasks.tsx`
- [Reports](https://github.com/engineerdaoud/optix/blob/main/src/pages/Reports.tsx): `src/pages/Reports.tsx`
- [Report generation](https://github.com/engineerdaoud/optix/blob/main/supabase/functions/report/index.ts): `supabase/functions/report/index.ts`
- [Scheduled jobs](https://github.com/engineerdaoud/optix/blob/main/supabase/functions/scheduled/index.ts): `supabase/functions/scheduled/index.ts`

### Other components

- **Site owner**
- **Supabase**
- **Google APIs**
- **Serper search data**

## Connections

- Site owner → Authentication: signs in
- Authentication → Supabase client: checks session (evidence: `src/context/Auth.tsx`)
- Site owner → Site management: adds site (evidence: `src/context/Site.tsx`)
- Site management → Supabase client: manages sites (evidence: `src/context/Site.tsx`)
- Site management → Supabase: stores site (evidence: `src/context/Site.tsx`)
- Site owner → Dashboard: opens dashboard
- Dashboard → Site crawl: runs checks (evidence: `README.md`)
- Dashboard → SEO audit: runs audit (evidence: `README.md`)
- Site crawl → Site analysis helpers: uses analysis (evidence: `supabase/functions/crawl/index.ts`)
- Site analysis helpers → Site data helpers: uses site data (evidence: `supabase/functions/_shared/analyse.ts`)
- Site owner → Domain research: researches domains (evidence: `README.md`)
- Domain research → Research function: requests research (evidence: `README.md`)
- Research function → Keyword data bank: reuses saved data (evidence: `supabase/functions/research/index.ts`)
- Site owner → Keyword Lab: explores keywords (evidence: `README.md`)
- Keyword Lab → Keyword data bank: queries keyword bank (evidence: `README.md`)
- Site owner → Backlink analysis: checks backlinks (evidence: `README.md`)
- Backlink analysis → Keyword data bank: uses link bank (evidence: `supabase/functions/backlinks/index.ts`)
- Site owner → Google integrations: connects Google (evidence: `README.md`)
- Google integrations → Google connection: starts OAuth (evidence: `README.md`)
- Google connection → Google APIs: connects APIs (evidence: `README.md`)
- Site owner → Traffic history: loads history (evidence: `README.md`)
- Traffic history → Traffic analysis: requests traffic (evidence: `README.md`)
- Traffic analysis → Google APIs: reads Google data (evidence: `README.md`)
- Site owner → SEO tasks: manages tasks
- SEO tasks → Supabase: reads and writes tasks (evidence: `src/pages/Tasks.tsx`)
- Site owner → Reports: views reports (evidence: `README.md`)
- Report generation → Supabase: saves reports (evidence: `README.md`)
- Scheduled jobs → Report generation: runs due reports (evidence: `README.md`)
- Scheduled jobs → Traffic analysis: syncs sites (evidence: `README.md`)
- Research function → Serper search data: checks search results (evidence: `README.md`)
