# mhdsamerallaham/samer-portfolyo architecture

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

- Interactive diagram: https://gitdiagram.com/mhdsamerallaham/samer-portfolyo
- Repository: https://github.com/mhdsamerallaham/samer-portfolyo

## Overview

Samer.life combines a multilingual e-commerce engineering portfolio with an autonomous SEO and AI-assisted content platform. Visitors browse localized service, case-study, blog, and FAQ pages or submit contact requests. Separately, SEO workflows gather Search Console opportunities, generate and quality-check content, then present proposed changes for approval rather than publishing AI output directly. The README documents these capabilities; sampled backend code confirms topic-intent classification and quality scoring, while the generation endpoint’s imports identify its broader orchestration. Unsampled endpoint and storage connections are omitted where their callers were not shown.

Main entry points: [`api/blog/generate.js`](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/blog/generate.js) (Blog generation), [`src/App.jsx`](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/App.jsx) (Route application), [`src/pages/admin/SeoDashboard.jsx`](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/pages/admin/SeoDashboard.jsx) (SEO dashboard), [`src/pages/ServiceDetail.jsx`](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/pages/ServiceDetail.jsx) (Service pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Public website"]
  node_app["Route application<br/>[App.jsx]"]
  node_service["Service pages<br/>[ServiceDetail.jsx]"]
  node_servicecards["Service cards<br/>[ServiceCard.jsx]"]
  node_blogpage["Blog pages<br/>[Blog.jsx]"]
  node_casepages["Case studies<br/>[CaseStudies.jsx]"]
  node_faqpages["FAQ pages<br/>[FAQ.jsx]"]
  node_contact["Contact form<br/>[ContactForm.jsx]"]
  node_seohead["SEO metadata<br/>[SEO.jsx]"]
  node_translations["Localized routes<br/>[navigation.js]"]
end

subgraph group_seo["SEO operations"]
  node_dashboard["SEO dashboard<br/>[SeoDashboard.jsx]"]
  node_diff["Change review<br/>[SeoDiffModal.jsx]"]
  node_gsc["Search Console client<br/>[GscClient.js]"]
  node_opportunities["Opportunity analysis"]
  node_actions["SEO actions<br/>[ActionManager.js]"]
end

subgraph group_content["Content intelligence"]
  node_bloggen["Blog generation<br/>[generate.js]"]
  node_discovery["Topic discovery"]
  node_intent["Intent classification"]
  node_research["Research context<br/>[ResearchEngine.js]"]
  node_quality["Content quality gate<br/>[QualityEngine.js]"]
  node_semantic["Internal linking"]
  node_structured["Structured data<br/>[SchemaEngine.js]"]
end

subgraph group_ai["AI platform"]
  node_budget["AI budget manager<br/>[AiBudgetManager.js]"]
  node_router["AI provider router<br/>[AiRouter.js]"]
  node_queue["Task queue<br/>[AiTaskQueue.js]"]
  node_cache[("AI cache<br/>[AiCache.js]")]
  node_providers["Provider manager"]
end

node_visitor(("Visitor"))
node_supabase[("Supabase database")]

node_visitor -->|"browses"| node_app
node_app -->|"routes to"| node_service
node_app -->|"routes to"| node_blogpage
node_app -->|"routes to"| node_casepages
node_app -->|"routes to"| node_faqpages
node_service -->|"renders"| node_servicecards
node_service -.->|"renders"| node_seohead
node_blogpage -->|"uses"| node_seohead
node_blogpage -->|"uses"| node_translations
node_visitor -.->|"submits inquiry"| node_contact
node_app -->|"supports localization"| node_translations
node_dashboard -->|"opens review"| node_diff
node_dashboard -.->|"requests SEO data"| node_gsc
node_gsc -.->|"supplies search rows"| node_opportunities
node_dashboard -.->|"requests approved action"| node_actions
node_actions -.->|"stores snapshot"| node_supabase
node_bloggen -->|"imports and uses"| node_discovery
node_discovery -->|"classifies topics"| node_intent
node_bloggen -->|"imports and uses"| node_intent
node_bloggen -->|"imports and uses"| node_research
node_bloggen -->|"imports and uses"| node_quality
node_bloggen -->|"imports and uses"| node_semantic
node_bloggen -.->|"adds structured data"| node_structured
node_bloggen -->|"creates provider manager"| node_providers
node_providers -.->|"configures routing"| node_router
node_router -.->|"checks capacity"| node_budget
node_bloggen -.->|"uses AI cache"| node_cache
node_queue -.->|"defers on limits"| node_budget
node_providers -.->|"records usage"| node_supabase

click node_app "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/App.jsx"
click node_service "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/pages/ServiceDetail.jsx"
click node_servicecards "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/components/ServiceCard.jsx"
click node_blogpage "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/pages/Blog.jsx"
click node_casepages "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/pages/CaseStudies.jsx"
click node_faqpages "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/pages/FAQ.jsx"
click node_contact "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/components/ContactForm.jsx"
click node_seohead "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/components/SEO.jsx"
click node_translations "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/utils/navigation.js"
click node_dashboard "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/pages/admin/SeoDashboard.jsx"
click node_diff "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/components/admin/SeoDiffModal.jsx"
click node_gsc "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/seo/GscClient.js"
click node_opportunities "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/seo/OpportunityEngine.js"
click node_actions "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/seo/ActionManager.js"
click node_bloggen "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/blog/generate.js"
click node_discovery "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/modules/discovery/TopicDiscoveryEngine.js"
click node_intent "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/modules/intent/IntentClassifierEngine.js"
click node_research "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/modules/research/ResearchEngine.js"
click node_quality "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/modules/quality/QualityEngine.js"
click node_semantic "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/modules/semantic-linking/SemanticLinkingEngine.js"
click node_structured "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/modules/structured-data/SchemaEngine.js"
click node_budget "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/ai/AiBudgetManager.js"
click node_router "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/ai/AiRouter.js"
click node_queue "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/ai/AiTaskQueue.js"
click node_cache "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/ai/AiCache.js"
click node_providers "https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/createProviderManager.js"

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_service,node_servicecards,node_blogpage,node_casepages,node_faqpages,node_contact,node_seohead,node_translations toneBlue
class node_dashboard,node_diff,node_gsc,node_opportunities,node_actions,node_supabase toneAmber
class node_bloggen,node_discovery,node_intent,node_research,node_quality,node_semantic,node_structured toneMint
class node_budget,node_router,node_queue,node_cache,node_providers toneRose
class node_visitor toneIndigo
```

## Components

### Public website

- [Route application](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/App.jsx): `src/App.jsx`
- [Service pages](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/pages/ServiceDetail.jsx): `src/pages/ServiceDetail.jsx`
- [Service cards](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/components/ServiceCard.jsx): `src/components/ServiceCard.jsx`
- [Blog pages](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/pages/Blog.jsx): `src/pages/Blog.jsx`
- [Case studies](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/pages/CaseStudies.jsx): `src/pages/CaseStudies.jsx`
- [FAQ pages](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/pages/FAQ.jsx): `src/pages/FAQ.jsx`
- [Contact form](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/components/ContactForm.jsx): `src/components/ContactForm.jsx`
- [SEO metadata](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/components/SEO.jsx): `src/components/SEO.jsx`
- [Localized routes](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/utils/navigation.js): `src/utils/navigation.js`

### SEO operations

- [SEO dashboard](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/pages/admin/SeoDashboard.jsx): `src/pages/admin/SeoDashboard.jsx`
- [Change review](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/src/components/admin/SeoDiffModal.jsx): `src/components/admin/SeoDiffModal.jsx`
- [Search Console client](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/seo/GscClient.js): `api/_lib/seo/GscClient.js`
- [Opportunity analysis](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/seo/OpportunityEngine.js): `api/_lib/seo/OpportunityEngine.js`
- [SEO actions](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/seo/ActionManager.js): `api/_lib/seo/ActionManager.js`

### Content intelligence

- [Blog generation](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/blog/generate.js): `api/blog/generate.js`
- [Topic discovery](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/modules/discovery/TopicDiscoveryEngine.js): `api/_lib/modules/discovery/TopicDiscoveryEngine.js`
- [Intent classification](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/modules/intent/IntentClassifierEngine.js): `api/_lib/modules/intent/IntentClassifierEngine.js`
- [Research context](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/modules/research/ResearchEngine.js): `api/_lib/modules/research/ResearchEngine.js`
- [Content quality gate](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/modules/quality/QualityEngine.js): `api/_lib/modules/quality/QualityEngine.js`
- [Internal linking](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/modules/semantic-linking/SemanticLinkingEngine.js): `api/_lib/modules/semantic-linking/SemanticLinkingEngine.js`
- [Structured data](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/modules/structured-data/SchemaEngine.js): `api/_lib/modules/structured-data/SchemaEngine.js`

### AI platform

- [AI budget manager](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/ai/AiBudgetManager.js): `api/_lib/ai/AiBudgetManager.js`
- [AI provider router](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/ai/AiRouter.js): `api/_lib/ai/AiRouter.js`
- [Task queue](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/ai/AiTaskQueue.js): `api/_lib/ai/AiTaskQueue.js`
- [AI cache](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/ai/AiCache.js): `api/_lib/ai/AiCache.js`
- [Provider manager](https://github.com/mhdsamerallaham/samer-portfolyo/blob/main/api/_lib/createProviderManager.js): `api/_lib/createProviderManager.js`

### Other components

- **Visitor**
- **Supabase database**

## Connections

- Visitor → Route application: browses (evidence: `src/App.jsx`)
- Route application → Service pages: routes to (evidence: `src/App.jsx`)
- Route application → Blog pages: routes to (evidence: `src/App.jsx`)
- Route application → Case studies: routes to (evidence: `src/App.jsx`)
- Route application → FAQ pages: routes to (evidence: `src/App.jsx`)
- Service pages → Service cards: renders (evidence: `src/pages/ServiceDetail.jsx`)
- Service pages → SEO metadata: renders (evidence: `src/pages/ServiceDetail.jsx`)
- Blog pages → SEO metadata: uses (evidence: `src/pages/Blog.jsx`)
- Blog pages → Localized routes: uses (evidence: `src/pages/Blog.jsx`)
- Visitor → Contact form: submits inquiry (evidence: `README.md`)
- Route application → Localized routes: supports localization (evidence: `src/App.jsx`)
- SEO dashboard → Change review: opens review (evidence: `src/pages/admin/SeoDashboard.jsx`)
- SEO dashboard → Search Console client: requests SEO data (evidence: `README.md`)
- Search Console client → Opportunity analysis: supplies search rows (evidence: `README.md`)
- SEO dashboard → SEO actions: requests approved action (evidence: `README.md`)
- SEO actions → Supabase database: stores snapshot (evidence: `README.md`)
- Blog generation → Topic discovery: imports and uses (evidence: `api/blog/generate.js`)
- Topic discovery → Intent classification: classifies topics (evidence: `api/_lib/modules/discovery/TopicDiscoveryEngine.js`)
- Blog generation → Intent classification: imports and uses (evidence: `api/blog/generate.js`)
- Blog generation → Research context: imports and uses (evidence: `api/blog/generate.js`)
- Blog generation → Content quality gate: imports and uses (evidence: `api/blog/generate.js`)
- Blog generation → Internal linking: imports and uses (evidence: `api/blog/generate.js`)
- Blog generation → Structured data: adds structured data (evidence: `README.md`)
- Blog generation → Provider manager: creates provider manager (evidence: `api/blog/generate.js`)
- Provider manager → AI provider router: configures routing (evidence: `README.md`)
- AI provider router → AI budget manager: checks capacity (evidence: `README.md`)
- Blog generation → AI cache: uses AI cache (evidence: `README.md`)
- Task queue → AI budget manager: defers on limits (evidence: `README.md`)
- Provider manager → Supabase database: records usage (evidence: `README.md`)
