# amitdevv/open-seo architecture

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

- Interactive diagram: https://gitdiagram.com/amitdevv/open-seo
- Repository: https://github.com/amitdevv/open-seo

## Overview

OpenSEO is an open-source SEO research and visibility suite, used through its web app or by AI agents. The user-facing workflow is to select a project and run focused research or monitoring workflows; results are presented in feature-specific views. The README names keyword research, rank tracking, competitor insights, backlinks, site audits, and AI visibility, and documents MCP access for agents. Source excerpts show keyword-research orchestration, audit launch, app routing, and provider-aware persistence. Many feature backends are unsampled, so their internal calls are not asserted.

Main entry points: [`src/client/features/keywords/state/useKeywordResearchController.ts`](https://github.com/amitdevv/open-seo/blob/main/src/client/features/keywords/state/useKeywordResearchController.ts) (Keyword research), [`src/client/features/audit/launch/useLaunchController.ts`](https://github.com/amitdevv/open-seo/blob/main/src/client/features/audit/launch/useLaunchController.ts) (Site audits), [`src/db/index.ts`](https://github.com/amitdevv/open-seo/blob/main/src/db/index.ts) (Database access), [`src/server.ts`](https://github.com/amitdevv/open-seo/blob/main/src/server.ts) (Server entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Web application"]
  node_app_route["App route<br/>[route.tsx]"]
  node_app_shell["App shell<br/>[AppShell.tsx]"]
end

subgraph group_seo["SEO workflows"]
  node_keyword_research["Keyword research"]
  node_rank_tracking["Rank tracking"]
  node_competitor_insights["Competitor insights"]
  node_backlinks["Backlinks"]
  node_site_audits["Site audits"]
  node_ai_visibility["AI visibility"]
end

subgraph group_agent["Agent access"]
  node_mcp_server["MCP server<br/>[server.ts]"]
  node_sam_agent["SAM agent<br/>[SamChatAgent.ts]"]
end

subgraph group_platform["Platform services"]
  node_http_entry["Server entry<br/>[server.ts]"]
  node_auth_repository["Auth repository<br/>[AuthRepository.ts]"]
  node_database[("Database access<br/>[index.ts]")]
  node_batch_writes["Atomic writes<br/>[runBatch.ts]"]
  node_db_schema["Database schema<br/>[schema.ts]"]
  node_context_service["Project context"]
end

node_user(("User"))
node_agent_actor(("AI agent"))

node_user -->|"uses"| node_app_route
node_app_route -->|"renders"| node_app_shell
node_user -->|"researches"| node_keyword_research
node_user -->|"tracks"| node_rank_tracking
node_user -->|"compares"| node_competitor_insights
node_user -->|"analyzes"| node_backlinks
node_user -->|"audits"| node_site_audits
node_user -->|"measures"| node_ai_visibility
node_agent_actor -->|"uses SEO data"| node_mcp_server
node_http_entry -->|"routes to"| node_mcp_server
node_http_entry -->|"loads sessions"| node_sam_agent
node_auth_repository -->|"queries"| node_database
node_auth_repository -->|"uses tables"| node_db_schema
node_database -->|"selects provider schema"| node_db_schema
node_context_service -->|"runs writes"| node_batch_writes
node_context_service -->|"reads and writes"| node_database
node_keyword_research -->|"orchestrates data hooks"| node_keyword_research
node_site_audits -->|"loads history and launches"| node_site_audits

click node_app_route "https://github.com/amitdevv/open-seo/blob/main/src/routes/_app/route.tsx"
click node_app_shell "https://github.com/amitdevv/open-seo/blob/main/src/client/layout/AppShell.tsx"
click node_keyword_research "https://github.com/amitdevv/open-seo/blob/main/src/client/features/keywords/state/useKeywordResearchController.ts"
click node_rank_tracking "https://github.com/amitdevv/open-seo/tree/main/src/client/features/rank-tracking"
click node_competitor_insights "https://github.com/amitdevv/open-seo/tree/main/src/client/features/domain"
click node_backlinks "https://github.com/amitdevv/open-seo/tree/main/src/client/features/backlinks"
click node_site_audits "https://github.com/amitdevv/open-seo/blob/main/src/client/features/audit/launch/useLaunchController.ts"
click node_ai_visibility "https://github.com/amitdevv/open-seo/tree/main/src/client/features/ai-visibility"
click node_mcp_server "https://github.com/amitdevv/open-seo/blob/main/src/server/mcp/server.ts"
click node_sam_agent "https://github.com/amitdevv/open-seo/blob/main/src/server/features/sam/SamChatAgent.ts"
click node_http_entry "https://github.com/amitdevv/open-seo/blob/main/src/server.ts"
click node_auth_repository "https://github.com/amitdevv/open-seo/blob/main/src/server/auth/repositories/AuthRepository.ts"
click node_database "https://github.com/amitdevv/open-seo/blob/main/src/db/index.ts"
click node_batch_writes "https://github.com/amitdevv/open-seo/blob/main/src/db/runBatch.ts"
click node_db_schema "https://github.com/amitdevv/open-seo/blob/main/src/db/schema.ts"
click node_context_service "https://github.com/amitdevv/open-seo/blob/main/src/server/features/project-context/services/ProjectContextService.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_route,node_app_shell,node_user toneBlue
class node_keyword_research,node_rank_tracking,node_competitor_insights,node_backlinks,node_site_audits,node_ai_visibility toneAmber
class node_mcp_server,node_sam_agent toneMint
class node_http_entry,node_auth_repository,node_database,node_batch_writes,node_db_schema,node_context_service toneRose
class node_agent_actor toneIndigo
```

## Components

### Web application

- [App route](https://github.com/amitdevv/open-seo/blob/main/src/routes/_app/route.tsx): `src/routes/_app/route.tsx`
- [App shell](https://github.com/amitdevv/open-seo/blob/main/src/client/layout/AppShell.tsx): `src/client/layout/AppShell.tsx`

### SEO workflows

- [Keyword research](https://github.com/amitdevv/open-seo/blob/main/src/client/features/keywords/state/useKeywordResearchController.ts): `src/client/features/keywords/state/useKeywordResearchController.ts`
- [Rank tracking](https://github.com/amitdevv/open-seo/tree/main/src/client/features/rank-tracking): `src/client/features/rank-tracking`
- [Competitor insights](https://github.com/amitdevv/open-seo/tree/main/src/client/features/domain): `src/client/features/domain`
- [Backlinks](https://github.com/amitdevv/open-seo/tree/main/src/client/features/backlinks): `src/client/features/backlinks`
- [Site audits](https://github.com/amitdevv/open-seo/blob/main/src/client/features/audit/launch/useLaunchController.ts): `src/client/features/audit/launch/useLaunchController.ts`
- [AI visibility](https://github.com/amitdevv/open-seo/tree/main/src/client/features/ai-visibility): `src/client/features/ai-visibility`

### Agent access

- [MCP server](https://github.com/amitdevv/open-seo/blob/main/src/server/mcp/server.ts): `src/server/mcp/server.ts`
- [SAM agent](https://github.com/amitdevv/open-seo/blob/main/src/server/features/sam/SamChatAgent.ts): `src/server/features/sam/SamChatAgent.ts`

### Platform services

- [Server entry](https://github.com/amitdevv/open-seo/blob/main/src/server.ts): `src/server.ts`
- [Auth repository](https://github.com/amitdevv/open-seo/blob/main/src/server/auth/repositories/AuthRepository.ts): `src/server/auth/repositories/AuthRepository.ts`
- [Database access](https://github.com/amitdevv/open-seo/blob/main/src/db/index.ts): `src/db/index.ts`
- [Atomic writes](https://github.com/amitdevv/open-seo/blob/main/src/db/runBatch.ts): `src/db/runBatch.ts`
- [Database schema](https://github.com/amitdevv/open-seo/blob/main/src/db/schema.ts): `src/db/schema.ts`
- [Project context](https://github.com/amitdevv/open-seo/blob/main/src/server/features/project-context/services/ProjectContextService.ts): `src/server/features/project-context/services/ProjectContextService.ts`

### Other components

- **User**
- **AI agent**

## Connections

- User → App route: uses (evidence: `README.md`)
- App route → App shell: renders (evidence: `src/routes/_app/route.tsx`)
- User → Keyword research: researches (evidence: `README.md`)
- User → Rank tracking: tracks (evidence: `README.md`)
- User → Competitor insights: compares (evidence: `README.md`)
- User → Backlinks: analyzes (evidence: `README.md`)
- User → Site audits: audits (evidence: `README.md`)
- User → AI visibility: measures (evidence: `README.md`)
- AI agent → MCP server: uses SEO data (evidence: `README.md`)
- Server entry → MCP server: routes to (evidence: `src/server.ts`)
- Server entry → SAM agent: loads sessions (evidence: `src/server.ts`)
- Auth repository → Database access: queries (evidence: `src/server/auth/repositories/AuthRepository.ts`)
- Auth repository → Database schema: uses tables (evidence: `src/server/auth/repositories/AuthRepository.ts`)
- Database access → Database schema: selects provider schema (evidence: `src/db/index.ts`)
- Project context → Atomic writes: runs writes (evidence: `src/server/features/project-context/services/ProjectContextService.ts`)
- Project context → Database access: reads and writes (evidence: `src/server/features/project-context/services/ProjectContextService.ts`)
- Keyword research → Keyword research: orchestrates data hooks (evidence: `src/client/features/keywords/state/useKeywordResearchController.ts`)
- Site audits → Site audits: loads history and launches (evidence: `src/client/features/audit/launch/useLaunchController.ts`)
