# nagahanuma/portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/nagahanuma/portfolio
- Repository: https://github.com/nagahanuma/portfolio

## Overview

This is a static developer portfolio with a project showcase and an interactive AI assistant. The principal workflow is a visitor viewing the portfolio, sending a chat message, and receiving either a locally generated answer or an answer from the documented AI backend. The README also describes particle and typing effects. The tree contains no FastAPI backend or model files beyond the models directory, so those documented backend stages have no repository source path; implementation links are limited to README evidence.

Main entry points: [`assets/js/chat-agent.js`](https://github.com/nagahanuma/portfolio/blob/main/assets/js/chat-agent.js) (Chat agent), [`index.html`](https://github.com/nagahanuma/portfolio/blob/main/index.html) (Portfolio home), [`projects.html`](https://github.com/nagahanuma/portfolio/blob/main/projects.html) (Project showcase), [`assets/css/style.css`](https://github.com/nagahanuma/portfolio/blob/main/assets/css/style.css) (Site styling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portfolio["Portfolio experience"]
  node_home["Portfolio home<br/>[index.html]"]
  node_showcase["Project showcase<br/>[projects.html]"]
end

subgraph group_visuals["Visual effects"]
  node_styles["Site styling<br/>[style.css]"]
  node_site_scripts["Page interactions<br/>[main.js]"]
  node_particles["Particle background<br/>[index.html]"]
  node_typing["Typing animation<br/>[index.html]"]
end

subgraph group_assistant["AI assistant"]
  node_chat_ui["Chat interface<br/>[index.html]"]
  node_chat_agent["Chat agent<br/>[chat-agent.js]"]
  node_drone["3D drone model"]
end

subgraph group_services["Backend and AI services"]
  node_interceptor{{"Local query interceptor"}}
  node_router["AI failover router"]
  node_fastapi["FastAPI backend"]
  node_groq["Groq API"]
  node_gemini["Gemini API"]
end

node_visitor(("Visitor"))

node_visitor -->|"views"| node_home
node_visitor -->|"views"| node_showcase
node_home -->|"styled by"| node_styles
node_home -.->|"uses"| node_site_scripts
node_home -->|"renders"| node_particles
node_home -->|"renders"| node_typing
node_visitor -->|"chats through"| node_chat_ui
node_chat_ui -->|"uses"| node_chat_agent
node_chat_agent -->|"controls"| node_drone
node_chat_agent -->|"posts chat"| node_fastapi
node_fastapi -->|"checks query"| node_interceptor
node_interceptor -->|"returns local reply"| node_chat_agent
node_interceptor -->|"forwards query"| node_router
node_router -->|"tries primary"| node_groq
node_router -->|"falls back"| node_gemini
node_groq -->|"returns reply"| node_chat_agent
node_gemini -->|"returns reply"| node_chat_agent

click node_home "https://github.com/nagahanuma/portfolio/blob/main/index.html"
click node_showcase "https://github.com/nagahanuma/portfolio/blob/main/projects.html"
click node_styles "https://github.com/nagahanuma/portfolio/blob/main/assets/css/style.css"
click node_site_scripts "https://github.com/nagahanuma/portfolio/blob/main/assets/js/main.js"
click node_particles "https://github.com/nagahanuma/portfolio/blob/main/index.html"
click node_typing "https://github.com/nagahanuma/portfolio/blob/main/index.html"
click node_chat_ui "https://github.com/nagahanuma/portfolio/blob/main/index.html"
click node_chat_agent "https://github.com/nagahanuma/portfolio/blob/main/assets/js/chat-agent.js"
click node_drone "https://github.com/nagahanuma/portfolio/tree/main/assets/models"

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_home,node_showcase toneBlue
class node_styles,node_site_scripts,node_particles,node_typing toneAmber
class node_chat_ui,node_chat_agent,node_drone toneMint
class node_interceptor,node_router,node_fastapi,node_groq,node_gemini toneRose
class node_visitor toneIndigo
```

## Components

### Portfolio experience

- [Portfolio home](https://github.com/nagahanuma/portfolio/blob/main/index.html): `index.html`
- [Project showcase](https://github.com/nagahanuma/portfolio/blob/main/projects.html): `projects.html`

### Visual effects

- [Site styling](https://github.com/nagahanuma/portfolio/blob/main/assets/css/style.css): `assets/css/style.css`
- [Page interactions](https://github.com/nagahanuma/portfolio/blob/main/assets/js/main.js): `assets/js/main.js`
- [Particle background](https://github.com/nagahanuma/portfolio/blob/main/index.html): `index.html`
- [Typing animation](https://github.com/nagahanuma/portfolio/blob/main/index.html): `index.html`

### AI assistant

- [Chat interface](https://github.com/nagahanuma/portfolio/blob/main/index.html): `index.html`
- [Chat agent](https://github.com/nagahanuma/portfolio/blob/main/assets/js/chat-agent.js): `assets/js/chat-agent.js`
- [3D drone model](https://github.com/nagahanuma/portfolio/tree/main/assets/models): `assets/models`

### Backend and AI services

- **Local query interceptor**
- **AI failover router**
- **FastAPI backend**
- **Groq API**
- **Gemini API**

### Other components

- **Visitor**

## Connections

- Visitor → Portfolio home: views (evidence: `README.md`)
- Visitor → Project showcase: views (evidence: `README.md`)
- Portfolio home → Site styling: styled by (evidence: `README.md`)
- Portfolio home → Page interactions: uses
- Portfolio home → Particle background: renders (evidence: `README.md`)
- Portfolio home → Typing animation: renders (evidence: `README.md`)
- Visitor → Chat interface: chats through (evidence: `README.md`)
- Chat interface → Chat agent: uses (evidence: `README.md`)
- Chat agent → 3D drone model: controls (evidence: `README.md`)
- Chat agent → FastAPI backend: posts chat (evidence: `README.md`)
- FastAPI backend → Local query interceptor: checks query (evidence: `README.md`)
- Local query interceptor → Chat agent: returns local reply (evidence: `README.md`)
- Local query interceptor → AI failover router: forwards query (evidence: `README.md`)
- AI failover router → Groq API: tries primary (evidence: `README.md`)
- AI failover router → Gemini API: falls back (evidence: `README.md`)
- Groq API → Chat agent: returns reply (evidence: `README.md`)
- Gemini API → Chat agent: returns reply (evidence: `README.md`)
