# neharoy3/github-card-generator architecture

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

- Interactive diagram: https://gitdiagram.com/neharoy3/github-card-generator
- Repository: https://github.com/neharoy3/github-card-generator

## Overview

GitHub Card Generator accepts a username, gathers public GitHub profile and repository data, analyzes it, and dynamically returns a themed HTML card without storing it. The API first tries its ADK agent pipeline and falls back to direct card building if that fails; the card URL is served separately. The README documents browser preview and URL-copy features, but the frontend source was not sampled, so those links are documented at a high level. Relationships within the backend are supported by excerpts; frontend behavior and integrations are limited to README evidence.

Main entry points: [`backend/main.py`](https://github.com/neharoy3/github-card-generator/blob/main/backend/main.py) (FastAPI routes), [`backend/agent.py`](https://github.com/neharoy3/github-card-generator/blob/main/backend/agent.py) (Card agent), [`frontend/index.html`](https://github.com/neharoy3/github-card-generator/blob/main/frontend/index.html) (Card interface), [`backend/mcp_server.py`](https://github.com/neharoy3/github-card-generator/blob/main/backend/mcp_server.py) (Profile fetch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Browser interface"]
  node_frontend_ui["Card interface<br/>[index.html]"]
end

subgraph group_api["API and orchestration"]
  node_api_app["FastAPI routes<br/>[main.py]"]
  node_adk_runner["ADK runner<br/>[main.py]"]
  node_agent["Card agent<br/>[agent.py]"]
end

subgraph group_generation["Card generation"]
  node_mcp_tools["MCP tools<br/>[mcp_server.py]"]
  node_github_fetch["Profile fetch<br/>[mcp_server.py]"]
  node_profile_analysis["Profile analysis<br/>[mcp_server.py]"]
  node_html_render["HTML rendering<br/>[mcp_server.py]"]
end

node_user(("Username visitor"))
node_github["GitHub API"]
node_gemini["Gemini API"]
node_browser(("Card browser"))

node_user -->|"enters username"| node_frontend_ui
node_frontend_ui -->|"requests generation"| node_api_app
node_api_app -->|"runs agent"| node_adk_runner
node_adk_runner -->|"dispatches"| node_agent
node_agent -->|"uses toolset"| node_mcp_tools
node_agent -->|"requests scrape"| node_github_fetch
node_agent -->|"requests analysis"| node_profile_analysis
node_agent -->|"requests rendering"| node_html_render
node_github_fetch -->|"fetches profile and repos"| node_github
node_profile_analysis -->|"analyzes profile"| node_gemini
node_api_app -->|"fallback builds card"| node_github_fetch
node_api_app -->|"fallback builds card"| node_profile_analysis
node_api_app -->|"fallback builds card"| node_html_render
node_api_app -->|"serves card HTML"| node_html_render
node_api_app -->|"returns card URL"| node_frontend_ui
node_frontend_ui -->|"previews card"| node_browser

click node_frontend_ui "https://github.com/neharoy3/github-card-generator/blob/main/frontend/index.html"
click node_api_app "https://github.com/neharoy3/github-card-generator/blob/main/backend/main.py"
click node_adk_runner "https://github.com/neharoy3/github-card-generator/blob/main/backend/main.py"
click node_agent "https://github.com/neharoy3/github-card-generator/blob/main/backend/agent.py"
click node_mcp_tools "https://github.com/neharoy3/github-card-generator/blob/main/backend/mcp_server.py"
click node_github_fetch "https://github.com/neharoy3/github-card-generator/blob/main/backend/mcp_server.py"
click node_profile_analysis "https://github.com/neharoy3/github-card-generator/blob/main/backend/mcp_server.py"
click node_html_render "https://github.com/neharoy3/github-card-generator/blob/main/backend/mcp_server.py"

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_frontend_ui,node_user,node_browser toneBlue
class node_api_app,node_adk_runner,node_agent toneAmber
class node_mcp_tools,node_github_fetch,node_profile_analysis,node_html_render,node_github,node_gemini toneMint
```

## Components

### Browser interface

- [Card interface](https://github.com/neharoy3/github-card-generator/blob/main/frontend/index.html): `frontend/index.html`

### API and orchestration

- [FastAPI routes](https://github.com/neharoy3/github-card-generator/blob/main/backend/main.py): `backend/main.py`
- [ADK runner](https://github.com/neharoy3/github-card-generator/blob/main/backend/main.py): `backend/main.py`
- [Card agent](https://github.com/neharoy3/github-card-generator/blob/main/backend/agent.py): `backend/agent.py`

### Card generation

- [MCP tools](https://github.com/neharoy3/github-card-generator/blob/main/backend/mcp_server.py): `backend/mcp_server.py`
- [Profile fetch](https://github.com/neharoy3/github-card-generator/blob/main/backend/mcp_server.py): `backend/mcp_server.py`
- [Profile analysis](https://github.com/neharoy3/github-card-generator/blob/main/backend/mcp_server.py): `backend/mcp_server.py`
- [HTML rendering](https://github.com/neharoy3/github-card-generator/blob/main/backend/mcp_server.py): `backend/mcp_server.py`

### Other components

- **Username visitor**
- **GitHub API**
- **Gemini API**
- **Card browser**

## Connections

- Username visitor → Card interface: enters username (evidence: `README.md`)
- Card interface → FastAPI routes: requests generation (evidence: `README.md`)
- FastAPI routes → ADK runner: runs agent (evidence: `backend/main.py`)
- ADK runner → Card agent: dispatches (evidence: `backend/main.py`)
- Card agent → MCP tools: uses toolset (evidence: `backend/agent.py`)
- Card agent → Profile fetch: requests scrape (evidence: `backend/agent.py`)
- Card agent → Profile analysis: requests analysis (evidence: `backend/agent.py`)
- Card agent → HTML rendering: requests rendering (evidence: `backend/agent.py`)
- Profile fetch → GitHub API: fetches profile and repos (evidence: `backend/mcp_server.py`)
- Profile analysis → Gemini API: analyzes profile (evidence: `backend/mcp_server.py`)
- FastAPI routes → Profile fetch: fallback builds card (evidence: `backend/main.py`)
- FastAPI routes → Profile analysis: fallback builds card (evidence: `backend/main.py`)
- FastAPI routes → HTML rendering: fallback builds card (evidence: `backend/main.py`)
- FastAPI routes → HTML rendering: serves card HTML (evidence: `backend/main.py`)
- FastAPI routes → Card interface: returns card URL (evidence: `README.md`)
- Card interface → Card browser: previews card (evidence: `README.md`)
