# davipeter07/portfolio-davi-peterson architecture

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

- Interactive diagram: https://gitdiagram.com/davipeter07/portfolio-davi-peterson
- Repository: https://github.com/davipeter07/portfolio-davi-peterson

## Overview

This is a multilingual personal portfolio website with a visitor-facing AI assistant. The main workflow is locale page → portfolio composition → profile sections, with project and repository data presented to visitors. The assistant submits chat requests to a server route, which builds a prompt from personal, résumé, and GitHub context and streams a response from an external model provider. The graph reflects sampled source and SOURCE INDEX references; some layout and section wiring is unsampled, so unsupported links are omitted.

Main entry points: [`src/app/api/chat/route.ts`](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/app/api/chat/route.ts) (Chat API route), [`src/sections/index.ts`](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/sections/index.ts) (Portfolio sections), [`src/components/portfolio-page.tsx`](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/components/portfolio-page.tsx) (Portfolio composition), [`src/lib/github-repos.ts`](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/lib/github-repos.ts) (GitHub repository service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Portfolio experience"]
  node_locale_page["Locale page<br/>[page.tsx]"]
  node_portfolio["Portfolio composition<br/>[portfolio-page.tsx]"]
  node_header["Navigation header<br/>[header.tsx]"]
  node_footer["Footer<br/>[footer.tsx]"]
end

subgraph group_content["Portfolio content"]
  node_sections["Portfolio sections<br/>[index.ts]"]
  node_about["About and experience<br/>[about.tsx]"]
  node_experience["Experience section<br/>[experience.tsx]"]
  node_technologies["Technology section<br/>[technologies.tsx]"]
  node_projects["Project showcase<br/>[projects.tsx]"]
  node_contact["Contact section<br/>[contact.tsx]"]
  node_hero["Hero section<br/>[hero.tsx]"]
  node_project_data["Project catalog<br/>[projects.ts]"]
  node_experience_data["Experience catalog<br/>[experiences.ts]"]
  node_technology_data["Technology catalog<br/>[technologies.ts]"]
end

subgraph group_assistant["AI assistant"]
  node_chat_widget["Chat assistant widget<br/>[ai-assistant.tsx]"]
  node_chat_route["Chat API route<br/>[route.ts]"]
  node_chat_request["Request validation<br/>[chat-request.ts]"]
  node_personal_skill["Personal context<br/>[personal.ts]"]
  node_github_skill["GitHub context<br/>[github.ts]"]
  node_resume_skill["Résumé context<br/>[resume.ts]"]
  node_faq["FAQ fallback<br/>[chat-faq.ts]"]
end

subgraph group_shared["Shared services"]
  node_repo_service["GitHub repository service<br/>[github-repos.ts]"]
  node_i18n["Translation service<br/>[i18n.ts]"]
end

node_visitor(("Visitor"))
node_provider["Language model provider"]
node_github["GitHub API"]

node_visitor -->|"opens"| node_locale_page
node_locale_page -->|"renders"| node_portfolio
node_portfolio -->|"renders"| node_header
node_portfolio -->|"renders"| node_footer
node_portfolio -->|"renders"| node_sections
node_portfolio -->|"renders"| node_chat_widget
node_sections -->|"exports"| node_hero
node_sections -->|"exports"| node_about
node_sections -->|"exports"| node_experience
node_sections -->|"exports"| node_technologies
node_sections -->|"exports"| node_projects
node_sections -->|"exports"| node_contact
node_experience -->|"reads"| node_experience_data
node_about -->|"reads"| node_experience_data
node_technologies -->|"reads"| node_technology_data
node_projects -->|"reads"| node_project_data
node_projects -->|"displays repos"| node_repo_service
node_locale_page -->|"loads repos"| node_repo_service
node_repo_service -->|"fetches"| node_github
node_chat_widget -->|"sends chat"| node_chat_route
node_chat_widget -->|"uses fallback"| node_faq
node_chat_route -->|"validates request"| node_chat_request
node_chat_route -->|"adds context"| node_personal_skill
node_chat_route -->|"adds context"| node_github_skill
node_chat_route -->|"adds context"| node_resume_skill
node_chat_route -->|"loads repositories"| node_repo_service
node_chat_route -->|"streams prompt"| node_provider
node_repo_service -->|"matches projects"| node_project_data
node_header -->|"uses translations"| node_i18n
node_chat_widget -->|"uses translations"| node_i18n
node_chat_route -->|"uses locale config"| node_i18n

click node_locale_page "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/app/%5Blocale%5D/page.tsx"
click node_portfolio "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/components/portfolio-page.tsx"
click node_header "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/components/header.tsx"
click node_footer "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/components/footer.tsx"
click node_sections "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/sections/index.ts"
click node_about "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/sections/about.tsx"
click node_experience "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/sections/experience.tsx"
click node_technologies "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/sections/technologies.tsx"
click node_projects "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/sections/projects.tsx"
click node_contact "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/sections/contact.tsx"
click node_hero "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/sections/hero.tsx"
click node_project_data "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/constants/projects.ts"
click node_experience_data "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/constants/experiences.ts"
click node_technology_data "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/constants/technologies.ts"
click node_repo_service "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/lib/github-repos.ts"
click node_chat_widget "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/components/ai-assistant.tsx"
click node_chat_route "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/app/api/chat/route.ts"
click node_chat_request "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/lib/chat-request.ts"
click node_personal_skill "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/ai-skills/personal.ts"
click node_github_skill "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/ai-skills/github.ts"
click node_resume_skill "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/ai-skills/resume.ts"
click node_faq "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/lib/chat-faq.ts"
click node_i18n "https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/lib/i18n.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_locale_page,node_portfolio,node_header,node_footer toneBlue
class node_sections,node_about,node_experience,node_technologies,node_projects,node_contact,node_hero,node_project_data,node_experience_data,node_technology_data toneAmber
class node_chat_widget,node_chat_route,node_chat_request,node_personal_skill,node_github_skill,node_resume_skill,node_faq,node_github toneMint
class node_repo_service,node_i18n toneRose
class node_visitor,node_provider toneIndigo
```

## Components

### Portfolio experience

- [Locale page](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/app/%5Blocale%5D/page.tsx): `src/app/[locale]/page.tsx`
- [Portfolio composition](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/components/portfolio-page.tsx): `src/components/portfolio-page.tsx`
- [Navigation header](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/components/header.tsx): `src/components/header.tsx`
- [Footer](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/components/footer.tsx): `src/components/footer.tsx`

### Portfolio content

- [Portfolio sections](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/sections/index.ts): `src/sections/index.ts`
- [About and experience](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/sections/about.tsx): `src/sections/about.tsx`
- [Experience section](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/sections/experience.tsx): `src/sections/experience.tsx`
- [Technology section](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/sections/technologies.tsx): `src/sections/technologies.tsx`
- [Project showcase](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/sections/projects.tsx): `src/sections/projects.tsx`
- [Contact section](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/sections/contact.tsx): `src/sections/contact.tsx`
- [Hero section](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/sections/hero.tsx): `src/sections/hero.tsx`
- [Project catalog](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/constants/projects.ts): `src/constants/projects.ts`
- [Experience catalog](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/constants/experiences.ts): `src/constants/experiences.ts`
- [Technology catalog](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/constants/technologies.ts): `src/constants/technologies.ts`

### AI assistant

- [Chat assistant widget](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/components/ai-assistant.tsx): `src/components/ai-assistant.tsx`
- [Chat API route](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/app/api/chat/route.ts): `src/app/api/chat/route.ts`
- [Request validation](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/lib/chat-request.ts): `src/lib/chat-request.ts`
- [Personal context](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/ai-skills/personal.ts): `src/ai-skills/personal.ts`
- [GitHub context](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/ai-skills/github.ts): `src/ai-skills/github.ts`
- [Résumé context](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/ai-skills/resume.ts): `src/ai-skills/resume.ts`
- [FAQ fallback](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/lib/chat-faq.ts): `src/lib/chat-faq.ts`

### Shared services

- [GitHub repository service](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/lib/github-repos.ts): `src/lib/github-repos.ts`
- [Translation service](https://github.com/davipeter07/portfolio-davi-peterson/blob/main/src/lib/i18n.ts): `src/lib/i18n.ts`

### Other components

- **Visitor**
- **Language model provider**
- **GitHub API**

## Connections

- Visitor → Locale page: opens (evidence: `src/app/[locale]/page.tsx`)
- Locale page → Portfolio composition: renders (evidence: `src/app/[locale]/page.tsx`)
- Portfolio composition → Navigation header: renders (evidence: `src/components/portfolio-page.tsx`)
- Portfolio composition → Footer: renders (evidence: `src/components/portfolio-page.tsx`)
- Portfolio composition → Portfolio sections: renders (evidence: `src/components/portfolio-page.tsx`)
- Portfolio composition → Chat assistant widget: renders (evidence: `src/components/portfolio-page.tsx`)
- Portfolio sections → Hero section: exports (evidence: `src/sections/index.ts`)
- Portfolio sections → About and experience: exports (evidence: `src/sections/index.ts`)
- Portfolio sections → Experience section: exports (evidence: `src/sections/index.ts`)
- Portfolio sections → Technology section: exports (evidence: `src/sections/index.ts`)
- Portfolio sections → Project showcase: exports (evidence: `src/sections/index.ts`)
- Portfolio sections → Contact section: exports (evidence: `src/sections/index.ts`)
- Experience section → Experience catalog: reads (evidence: `src/sections/experience.tsx`)
- About and experience → Experience catalog: reads (evidence: `src/sections/about.tsx`)
- Technology section → Technology catalog: reads (evidence: `src/sections/technologies.tsx`)
- Project showcase → Project catalog: reads (evidence: `src/sections/projects.tsx`)
- Project showcase → GitHub repository service: displays repos (evidence: `src/sections/projects.tsx`)
- Locale page → GitHub repository service: loads repos (evidence: `src/app/[locale]/page.tsx`)
- GitHub repository service → GitHub API: fetches (evidence: `src/lib/github-repos.ts`)
- Chat assistant widget → Chat API route: sends chat (evidence: `src/components/ai-assistant.tsx`)
- Chat assistant widget → FAQ fallback: uses fallback (evidence: `src/components/ai-assistant.tsx`)
- Chat API route → Request validation: validates request (evidence: `src/app/api/chat/route.ts`)
- Chat API route → Personal context: adds context (evidence: `src/app/api/chat/route.ts`)
- Chat API route → GitHub context: adds context (evidence: `src/app/api/chat/route.ts`)
- Chat API route → Résumé context: adds context (evidence: `src/app/api/chat/route.ts`)
- Chat API route → GitHub repository service: loads repositories (evidence: `src/app/api/chat/route.ts`)
- Chat API route → Language model provider: streams prompt (evidence: `src/app/api/chat/route.ts`)
- GitHub repository service → Project catalog: matches projects (evidence: `src/lib/github-repos.ts`)
- Navigation header → Translation service: uses translations (evidence: `src/components/header.tsx`)
- Chat assistant widget → Translation service: uses translations (evidence: `src/components/ai-assistant.tsx`)
- Chat API route → Translation service: uses locale config (evidence: `src/app/api/chat/route.ts`)
