# aavoraa/seo-agent architecture

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

- Interactive diagram: https://gitdiagram.com/aavoraa/seo-agent
- Repository: https://github.com/aavoraa/seo-agent

## Overview

Phoenixx IT is an AI SEO intelligence and automation platform. Users work through the dashboard to inspect crawl and analytics findings, prioritize opportunities, review AI-assisted recommendations, approve changes, and track deployment verification and results. The API coordinates these capabilities; crawler, SEO and keyword analysis, integrations, AI generation, and reporting provide distinct domain stages. Website changes are approval-gated, with deployment and rollback handled through adapters. The README documents major capabilities beyond the sampled excerpts; uncertain implementation-level links are omitted or marked unverified.

Main entry points: [`apps/api/src/server.ts`](https://github.com/aavoraa/seo-agent/blob/main/apps/api/src/server.ts) (Fastify API), [`packages/seo-engine/src`](https://github.com/aavoraa/seo-agent/tree/main/packages/seo-engine/src) (SEO rules and scoring), [`apps/api/src/context.ts`](https://github.com/aavoraa/seo-agent/blob/main/apps/api/src/context.ts) (Application context), [`apps/dashboard/src/App.tsx`](https://github.com/aavoraa/seo-agent/blob/main/apps/dashboard/src/App.tsx) (SEO dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_dashboard["SEO dashboard<br/>[App.tsx]"]
  node_auth_ui["Dashboard authentication<br/>[auth.tsx]"]
  node_api_client["Dashboard API client<br/>[client.ts]"]
end

subgraph group_api["API and workflows"]
  node_api_server["Fastify API<br/>[server.ts]"]
  node_api_auth["Authentication and RBAC<br/>[auth.ts]"]
  node_audit_routes["Audit and deployment routes<br/>[audit-deploy.ts]"]
  node_action_routes["Recommendations and actions<br/>[actions.ts]"]
  node_data_routes["SEO data routes<br/>[data.ts]"]
  node_platform_routes["Platform routes<br/>[platform.ts]"]
  node_deployment["Website deployment<br/>[deployments.ts]"]
end

subgraph group_analysis["SEO analysis"]
  node_seo_engine["SEO rules and scoring"]
  node_keyword_engine["Keyword analysis"]
  node_backlink_analysis["Backlink monitoring<br/>[backlinks.ts]"]
  node_reporting["SEO reporting<br/>[index.ts]"]
end

subgraph group_collection["Collection and integrations"]
  node_crawl["Site crawler<br/>[crawler.ts]"]
  node_integrations["Google and site adapters"]
end

subgraph group_platform["AI and platform services"]
  node_ai_service["AI generation<br/>[service.ts]"]
  node_ai_providers["AI providers<br/>[providers.ts]"]
  node_api_context["Application context<br/>[context.ts]"]
  node_database[("Application database<br/>[db.ts]")]
  node_webhooks["Customer webhooks<br/>[webhooks.ts]"]
  node_n8n["Job automation"]
end

node_user(("SEO team"))
node_website(("Customer website"))
node_google["Google data services"]

node_user -->|"uses"| node_dashboard
node_dashboard -->|"checks session"| node_auth_ui
node_auth_ui -->|"requests identity"| node_api_client
node_dashboard -.->|"loads platform data"| node_api_client
node_api_client -.->|"sends API requests"| node_api_server
node_api_server -->|"registers routes"| node_api_auth
node_api_server -->|"registers routes"| node_audit_routes
node_api_server -->|"registers routes"| node_action_routes
node_api_server -->|"registers routes"| node_data_routes
node_api_server -->|"registers routes"| node_platform_routes
node_api_server -.->|"uses services"| node_api_context
node_api_context -->|"creates database"| node_database
node_api_context -->|"configures AI"| node_ai_service
node_ai_service -->|"calls provider"| node_ai_providers
node_api_context -->|"configures adapters"| node_integrations
node_website -->|"provides pages"| node_crawl
node_crawl -.->|"supplies crawl findings"| node_seo_engine
node_google -->|"supplies analytics data"| node_integrations
node_integrations -.->|"supplies search data"| node_seo_engine
node_seo_engine -.->|"supports keyword analysis"| node_keyword_engine
node_seo_engine -.->|"analyzes backlinks"| node_backlink_analysis
node_data_routes -.->|"serves SEO findings"| node_seo_engine
node_action_routes -.->|"requests drafts"| node_ai_service
node_action_routes -.->|"implements approved changes"| node_deployment
node_deployment -->|"deploys and verifies"| node_website
node_seo_engine -.->|"provides report findings"| node_reporting
node_platform_routes -.->|"dispatches events"| node_webhooks
node_n8n -->|"runs analysis jobs"| node_api_server

click node_dashboard "https://github.com/aavoraa/seo-agent/blob/main/apps/dashboard/src/App.tsx"
click node_auth_ui "https://github.com/aavoraa/seo-agent/blob/main/apps/dashboard/src/context/auth.tsx"
click node_api_client "https://github.com/aavoraa/seo-agent/blob/main/apps/dashboard/src/api/client.ts"
click node_api_server "https://github.com/aavoraa/seo-agent/blob/main/apps/api/src/server.ts"
click node_api_auth "https://github.com/aavoraa/seo-agent/blob/main/apps/api/src/routes/auth.ts"
click node_audit_routes "https://github.com/aavoraa/seo-agent/blob/main/apps/api/src/routes/audit-deploy.ts"
click node_action_routes "https://github.com/aavoraa/seo-agent/blob/main/apps/api/src/routes/actions.ts"
click node_data_routes "https://github.com/aavoraa/seo-agent/blob/main/apps/api/src/routes/data.ts"
click node_platform_routes "https://github.com/aavoraa/seo-agent/blob/main/apps/api/src/routes/platform.ts"
click node_crawl "https://github.com/aavoraa/seo-agent/blob/main/apps/crawler/src/crawler.ts"
click node_seo_engine "https://github.com/aavoraa/seo-agent/tree/main/packages/seo-engine/src"
click node_keyword_engine "https://github.com/aavoraa/seo-agent/tree/main/packages/keyword-engine/src"
click node_backlink_analysis "https://github.com/aavoraa/seo-agent/blob/main/packages/seo-engine/src/backlinks.ts"
click node_integrations "https://github.com/aavoraa/seo-agent/tree/main/packages/integrations/src"
click node_ai_service "https://github.com/aavoraa/seo-agent/blob/main/packages/ai-engine/src/service.ts"
click node_ai_providers "https://github.com/aavoraa/seo-agent/blob/main/packages/ai-engine/src/providers.ts"
click node_deployment "https://github.com/aavoraa/seo-agent/blob/main/apps/api/src/services/deployments.ts"
click node_reporting "https://github.com/aavoraa/seo-agent/blob/main/packages/reporting-engine/src/index.ts"
click node_api_context "https://github.com/aavoraa/seo-agent/blob/main/apps/api/src/context.ts"
click node_database "https://github.com/aavoraa/seo-agent/blob/main/packages/database/src/db.ts"
click node_webhooks "https://github.com/aavoraa/seo-agent/blob/main/apps/api/src/services/webhooks.ts"
click node_n8n "https://github.com/aavoraa/seo-agent/tree/main/n8n"

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_dashboard,node_auth_ui,node_api_client toneBlue
class node_api_server,node_api_auth,node_audit_routes,node_action_routes,node_data_routes,node_platform_routes,node_deployment toneAmber
class node_seo_engine,node_keyword_engine,node_backlink_analysis,node_reporting toneMint
class node_crawl,node_integrations toneRose
class node_ai_service,node_ai_providers,node_api_context,node_database,node_webhooks,node_n8n,node_user,node_website,node_google toneIndigo
```

## Components

### User experience

- [SEO dashboard](https://github.com/aavoraa/seo-agent/blob/main/apps/dashboard/src/App.tsx): `apps/dashboard/src/App.tsx`
- [Dashboard authentication](https://github.com/aavoraa/seo-agent/blob/main/apps/dashboard/src/context/auth.tsx): `apps/dashboard/src/context/auth.tsx`
- [Dashboard API client](https://github.com/aavoraa/seo-agent/blob/main/apps/dashboard/src/api/client.ts): `apps/dashboard/src/api/client.ts`

### API and workflows

- [Fastify API](https://github.com/aavoraa/seo-agent/blob/main/apps/api/src/server.ts): `apps/api/src/server.ts`
- [Authentication and RBAC](https://github.com/aavoraa/seo-agent/blob/main/apps/api/src/routes/auth.ts): `apps/api/src/routes/auth.ts`
- [Audit and deployment routes](https://github.com/aavoraa/seo-agent/blob/main/apps/api/src/routes/audit-deploy.ts): `apps/api/src/routes/audit-deploy.ts`
- [Recommendations and actions](https://github.com/aavoraa/seo-agent/blob/main/apps/api/src/routes/actions.ts): `apps/api/src/routes/actions.ts`
- [SEO data routes](https://github.com/aavoraa/seo-agent/blob/main/apps/api/src/routes/data.ts): `apps/api/src/routes/data.ts`
- [Platform routes](https://github.com/aavoraa/seo-agent/blob/main/apps/api/src/routes/platform.ts): `apps/api/src/routes/platform.ts`
- [Website deployment](https://github.com/aavoraa/seo-agent/blob/main/apps/api/src/services/deployments.ts): `apps/api/src/services/deployments.ts`

### SEO analysis

- [SEO rules and scoring](https://github.com/aavoraa/seo-agent/tree/main/packages/seo-engine/src): `packages/seo-engine/src`
- [Keyword analysis](https://github.com/aavoraa/seo-agent/tree/main/packages/keyword-engine/src): `packages/keyword-engine/src`
- [Backlink monitoring](https://github.com/aavoraa/seo-agent/blob/main/packages/seo-engine/src/backlinks.ts): `packages/seo-engine/src/backlinks.ts`
- [SEO reporting](https://github.com/aavoraa/seo-agent/blob/main/packages/reporting-engine/src/index.ts): `packages/reporting-engine/src/index.ts`

### Collection and integrations

- [Site crawler](https://github.com/aavoraa/seo-agent/blob/main/apps/crawler/src/crawler.ts): `apps/crawler/src/crawler.ts`
- [Google and site adapters](https://github.com/aavoraa/seo-agent/tree/main/packages/integrations/src): `packages/integrations/src`

### AI and platform services

- [AI generation](https://github.com/aavoraa/seo-agent/blob/main/packages/ai-engine/src/service.ts): `packages/ai-engine/src/service.ts`
- [AI providers](https://github.com/aavoraa/seo-agent/blob/main/packages/ai-engine/src/providers.ts): `packages/ai-engine/src/providers.ts`
- [Application context](https://github.com/aavoraa/seo-agent/blob/main/apps/api/src/context.ts): `apps/api/src/context.ts`
- [Application database](https://github.com/aavoraa/seo-agent/blob/main/packages/database/src/db.ts): `packages/database/src/db.ts`
- [Customer webhooks](https://github.com/aavoraa/seo-agent/blob/main/apps/api/src/services/webhooks.ts): `apps/api/src/services/webhooks.ts`
- [Job automation](https://github.com/aavoraa/seo-agent/tree/main/n8n): `n8n`

### Other components

- **SEO team**
- **Customer website**
- **Google data services**

## Connections

- SEO team → SEO dashboard: uses (evidence: `README.md`)
- SEO dashboard → Dashboard authentication: checks session (evidence: `apps/dashboard/src/App.tsx`)
- Dashboard authentication → Dashboard API client: requests identity (evidence: `apps/dashboard/src/context/auth.tsx`)
- SEO dashboard → Dashboard API client: loads platform data
- Dashboard API client → Fastify API: sends API requests
- Fastify API → Authentication and RBAC: registers routes (evidence: `apps/api/src/server.ts`)
- Fastify API → Audit and deployment routes: registers routes (evidence: `apps/api/src/server.ts`)
- Fastify API → Recommendations and actions: registers routes (evidence: `apps/api/src/server.ts`)
- Fastify API → SEO data routes: registers routes (evidence: `apps/api/src/server.ts`)
- Fastify API → Platform routes: registers routes (evidence: `apps/api/src/server.ts`)
- Fastify API → Application context: uses services (evidence: `apps/api/src/server.ts`)
- Application context → Application database: creates database (evidence: `apps/api/src/context.ts`)
- Application context → AI generation: configures AI (evidence: `apps/api/src/context.ts`)
- AI generation → AI providers: calls provider (evidence: `packages/ai-engine/src/service.ts`)
- Application context → Google and site adapters: configures adapters (evidence: `apps/api/src/context.ts`)
- Customer website → Site crawler: provides pages (evidence: `README.md`)
- Site crawler → SEO rules and scoring: supplies crawl findings
- Google data services → Google and site adapters: supplies analytics data (evidence: `README.md`)
- Google and site adapters → SEO rules and scoring: supplies search data
- SEO rules and scoring → Keyword analysis: supports keyword analysis
- SEO rules and scoring → Backlink monitoring: analyzes backlinks (evidence: `packages/seo-engine/src/backlinks.ts`)
- SEO data routes → SEO rules and scoring: serves SEO findings
- Recommendations and actions → AI generation: requests drafts
- Recommendations and actions → Website deployment: implements approved changes
- Website deployment → Customer website: deploys and verifies (evidence: `README.md`)
- SEO rules and scoring → SEO reporting: provides report findings
- Platform routes → Customer webhooks: dispatches events
- Job automation → Fastify API: runs analysis jobs (evidence: `README.md`)
