# kazuya-01/portofolio architecture

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

- Interactive diagram: https://gitdiagram.com/kazuya-01/portofolio
- Repository: https://github.com/kazuya-01/portofolio

## Overview

This is a static personal portfolio with an interactive browser UI and an AI chat endpoint. Visitors browse portfolio content, use project filters and certificate details, or submit a chat message; the browser chat code enforces a daily local usage limit and posts to the serverless handler, which validates requests and tries Gemini before Groq. main.js is only partially excerpted, so other portfolio interactions are represented at a broad level; no README capabilities were provided.

Main entry points: [`main.js`](https://github.com/kazuya-01/portofolio/blob/master/main.js) (Chat widget and limits), [`functions/chat.js`](https://github.com/kazuya-01/portofolio/blob/master/functions/chat.js) (Chat request handler), [`index.html`](https://github.com/kazuya-01/portofolio/blob/master/index.html) (Portfolio page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Portfolio site"]
  node_page["Portfolio page<br/>[index.html]"]
  node_ui["Portfolio interactions<br/>[main.js]"]
  node_projects["Project filtering<br/>[main.js]"]
  node_certificates["Certificate details<br/>[main.js]"]
end

subgraph group_chat["AI chat"]
  node_chatui["Chat widget and limits<br/>[main.js]"]
  node_chatapi["Chat request handler<br/>[chat.js]"]
  node_gemini{{"Gemini API"}}
  node_groq{{"Groq API"}}
  node_browserstorage[("Browser local storage")]
end

node_visitor(("Portfolio visitor"))

node_visitor -->|"opens"| node_page
node_page -.->|"loads scripts"| node_ui
node_visitor -.->|"filters projects"| node_projects
node_visitor -.->|"views details"| node_certificates
node_visitor -->|"sends message"| node_chatui
node_chatui -->|"reads and writes"| node_browserstorage
node_chatui -->|"POSTs message"| node_chatapi
node_chatapi -->|"requests response"| node_gemini
node_chatapi -->|"fallback request"| node_groq

click node_page "https://github.com/kazuya-01/portofolio/blob/master/index.html"
click node_ui "https://github.com/kazuya-01/portofolio/blob/master/main.js"
click node_projects "https://github.com/kazuya-01/portofolio/blob/master/main.js"
click node_certificates "https://github.com/kazuya-01/portofolio/blob/master/main.js"
click node_chatui "https://github.com/kazuya-01/portofolio/blob/master/main.js"
click node_chatapi "https://github.com/kazuya-01/portofolio/blob/master/functions/chat.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_page,node_ui,node_projects,node_certificates toneBlue
class node_chatui,node_chatapi,node_gemini,node_groq,node_browserstorage toneAmber
class node_visitor toneIndigo
```

## Components

### Portfolio site

- [Portfolio page](https://github.com/kazuya-01/portofolio/blob/master/index.html): `index.html`
- [Portfolio interactions](https://github.com/kazuya-01/portofolio/blob/master/main.js): `main.js`
- [Project filtering](https://github.com/kazuya-01/portofolio/blob/master/main.js): `main.js`
- [Certificate details](https://github.com/kazuya-01/portofolio/blob/master/main.js): `main.js`

### AI chat

- [Chat widget and limits](https://github.com/kazuya-01/portofolio/blob/master/main.js): `main.js`
- [Chat request handler](https://github.com/kazuya-01/portofolio/blob/master/functions/chat.js): `functions/chat.js`
- **Gemini API**
- **Groq API**
- **Browser local storage**

### Other components

- **Portfolio visitor**

## Connections

- Portfolio visitor → Portfolio page: opens
- Portfolio page → Portfolio interactions: loads scripts
- Portfolio visitor → Project filtering: filters projects
- Portfolio visitor → Certificate details: views details
- Portfolio visitor → Chat widget and limits: sends message (evidence: `main.js`)
- Chat widget and limits → Browser local storage: reads and writes (evidence: `main.js`)
- Chat widget and limits → Chat request handler: POSTs message (evidence: `main.js`)
- Chat request handler → Gemini API: requests response (evidence: `functions/chat.js`)
- Chat request handler → Groq API: fallback request (evidence: `functions/chat.js`)
