# rohannimje/portfolio architecture

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

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

## Overview

This is a personal portfolio website with an embedded AI assistant. Visitors browse the portfolio’s project, experience, certification, and honors content, open detailed media modals, or ask the assistant questions; assistant requests are streamed through a server proxy to Gemini with fallback-model handling. The excerpts show the UI, data, chat, and server paths, but do not expose every rendering call or AI-context wiring, so uncertain links are omitted. Major portfolio sections and the AI assistant’s local FAQ, contextual answers, navigation actions, and project-modal actions are represented.

Main entry points: [`js/ai/ai-service.js`](https://github.com/rohannimje/portfolio/blob/main/js/ai/ai-service.js) (Chat and response handling), [`js/data.js`](https://github.com/rohannimje/portfolio/blob/main/js/data.js) (Portfolio content), [`js/main.js`](https://github.com/rohannimje/portfolio/blob/main/js/main.js) (UI interactions), [`index.html`](https://github.com/rohannimje/portfolio/blob/main/index.html) (Portfolio page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portfolio["Portfolio experience"]
  node_site["Portfolio page<br/>[index.html]"]
  node_ui["UI interactions<br/>[main.js]"]
  node_content["Portfolio content<br/>[data.js]"]
  node_projects["Project showcases<br/>[data.js]"]
  node_experience["Experience and skills<br/>[data.js]"]
  node_credentials["Certifications and honors<br/>[data.js]"]
  node_media["Project and award modals<br/>[main.js]"]
end

subgraph group_assistant["AI assistant"]
  node_assistant_ui["Assistant interface<br/>[main.js]"]
  node_assistant_service["Chat and response handling<br/>[ai-service.js]"]
  node_local_answers["FAQ and navigation<br/>[ai-service.js]"]
  node_context["Assistant knowledge<br/>[ai-context.js]"]
  node_proxy_config["Proxy compatibility config<br/>[config.js]"]
end

subgraph group_backend["Chat backend"]
  node_local_server["Local Express server<br/>[server.js]"]
  node_chat_handler["Chat API handler<br/>[chat.js]"]
end

node_visitor(("Portfolio visitor"))
node_model_service{{"Gemini streaming API"}}

node_visitor -->|"opens"| node_site
node_site -->|"loads interface"| node_ui
node_ui -.->|"renders portfolio data"| node_content
node_content -->|"defines"| node_projects
node_content -->|"defines"| node_experience
node_content -->|"defines"| node_credentials
node_ui -->|"opens and closes"| node_media
node_visitor -->|"asks questions"| node_assistant_ui
node_assistant_ui -.->|"sends chat"| node_assistant_service
node_assistant_service -->|"handles common questions"| node_local_answers
node_assistant_service -.->|"builds prompt from"| node_context
node_assistant_service -.->|"checks compatibility"| node_proxy_config
node_assistant_service -->|"posts stream request"| node_chat_handler
node_chat_handler -->|"streams and fails over"| node_model_service
node_local_server -->|"routes chat request"| node_chat_handler
node_local_server -->|"serves static files"| node_site
node_assistant_service -.->|"triggers project modal"| node_media

click node_site "https://github.com/rohannimje/portfolio/blob/main/index.html"
click node_ui "https://github.com/rohannimje/portfolio/blob/main/js/main.js"
click node_content "https://github.com/rohannimje/portfolio/blob/main/js/data.js"
click node_projects "https://github.com/rohannimje/portfolio/blob/main/js/data.js"
click node_experience "https://github.com/rohannimje/portfolio/blob/main/js/data.js"
click node_credentials "https://github.com/rohannimje/portfolio/blob/main/js/data.js"
click node_media "https://github.com/rohannimje/portfolio/blob/main/js/main.js"
click node_assistant_ui "https://github.com/rohannimje/portfolio/blob/main/js/main.js"
click node_assistant_service "https://github.com/rohannimje/portfolio/blob/main/js/ai/ai-service.js"
click node_local_answers "https://github.com/rohannimje/portfolio/blob/main/js/ai/ai-service.js"
click node_context "https://github.com/rohannimje/portfolio/blob/main/js/ai/ai-context.js"
click node_proxy_config "https://github.com/rohannimje/portfolio/blob/main/js/ai/config.js"
click node_local_server "https://github.com/rohannimje/portfolio/blob/main/server.js"
click node_chat_handler "https://github.com/rohannimje/portfolio/blob/main/api/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_site,node_ui,node_content,node_projects,node_experience,node_credentials,node_media toneBlue
class node_assistant_ui,node_assistant_service,node_local_answers,node_context,node_proxy_config toneAmber
class node_local_server,node_chat_handler,node_model_service toneMint
class node_visitor toneIndigo
```

## Components

### Portfolio experience

- [Portfolio page](https://github.com/rohannimje/portfolio/blob/main/index.html): `index.html`
- [UI interactions](https://github.com/rohannimje/portfolio/blob/main/js/main.js): `js/main.js`
- [Portfolio content](https://github.com/rohannimje/portfolio/blob/main/js/data.js): `js/data.js`
- [Project showcases](https://github.com/rohannimje/portfolio/blob/main/js/data.js): `js/data.js`
- [Experience and skills](https://github.com/rohannimje/portfolio/blob/main/js/data.js): `js/data.js`
- [Certifications and honors](https://github.com/rohannimje/portfolio/blob/main/js/data.js): `js/data.js`
- [Project and award modals](https://github.com/rohannimje/portfolio/blob/main/js/main.js): `js/main.js`

### AI assistant

- [Assistant interface](https://github.com/rohannimje/portfolio/blob/main/js/main.js): `js/main.js`
- [Chat and response handling](https://github.com/rohannimje/portfolio/blob/main/js/ai/ai-service.js): `js/ai/ai-service.js`
- [FAQ and navigation](https://github.com/rohannimje/portfolio/blob/main/js/ai/ai-service.js): `js/ai/ai-service.js`
- [Assistant knowledge](https://github.com/rohannimje/portfolio/blob/main/js/ai/ai-context.js): `js/ai/ai-context.js`
- [Proxy compatibility config](https://github.com/rohannimje/portfolio/blob/main/js/ai/config.js): `js/ai/config.js`

### Chat backend

- [Local Express server](https://github.com/rohannimje/portfolio/blob/main/server.js): `server.js`
- [Chat API handler](https://github.com/rohannimje/portfolio/blob/main/api/chat.js): `api/chat.js`

### Other components

- **Portfolio visitor**
- **Gemini streaming API**

## Connections

- Portfolio visitor → Portfolio page: opens
- Portfolio page → UI interactions: loads interface
- UI interactions → Portfolio content: renders portfolio data
- Portfolio content → Project showcases: defines (evidence: `js/data.js`)
- Portfolio content → Experience and skills: defines (evidence: `js/data.js`)
- Portfolio content → Certifications and honors: defines (evidence: `js/data.js`)
- UI interactions → Project and award modals: opens and closes (evidence: `js/main.js`)
- Portfolio visitor → Assistant interface: asks questions
- Assistant interface → Chat and response handling: sends chat
- Chat and response handling → FAQ and navigation: handles common questions (evidence: `js/ai/ai-service.js`)
- Chat and response handling → Assistant knowledge: builds prompt from
- Chat and response handling → Proxy compatibility config: checks compatibility
- Chat and response handling → Chat API handler: posts stream request (evidence: `js/ai/ai-service.js`)
- Chat API handler → Gemini streaming API: streams and fails over (evidence: `api/chat.js`)
- Local Express server → Chat API handler: routes chat request (evidence: `server.js`)
- Local Express server → Portfolio page: serves static files (evidence: `server.js`)
- Chat and response handling → Project and award modals: triggers project modal
