# abhishal-ks/yu-kan architecture

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

- Interactive diagram: https://gitdiagram.com/abhishal-ks/yu-kan
- Repository: https://github.com/abhishal-ks/yu-kan

## Overview

YuKan is a creator-facing YouTube analytics and AI-insights app. A creator signs in through Google OAuth, views a channel profile, requests a recent-upload/90-day analytics report, and can ask follow-up questions grounded in those metrics. The server-side analysis and question routes fetch YouTube data and call Gemini; the dashboard renders the results. The graph also shows policy pages and shared OAuth support. Some route and UI internals were not excerpted, so those links rely on README documentation rather than claims about unsampled implementation details.

Main entry points: [`src/features/dashboard/dashboard-workspace.tsx`](https://github.com/abhishal-ks/yu-kan/blob/main/src/features/dashboard/dashboard-workspace.tsx) (Dashboard workspace), [`src/lib/google-oauth.ts`](https://github.com/abhishal-ks/yu-kan/blob/main/src/lib/google-oauth.ts) (OAuth helpers), [`src/app/api/analyze/route.ts`](https://github.com/abhishal-ks/yu-kan/blob/main/src/app/api/analyze/route.ts) (Analysis route), [`src/app/api/ask/route.ts`](https://github.com/abhishal-ks/yu-kan/blob/main/src/app/api/ask/route.ts) (Question route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Creator experience"]
  node_landing["Landing page<br/>[landing-page.tsx]"]
  node_workspace["Dashboard workspace"]
  node_chat["Analytics chat<br/>[analytics-chat.tsx]"]
  node_report["Analysis results"]
  node_footer["Site footer<br/>[site-footer.tsx]"]
end

subgraph group_identity["Google identity"]
  node_login["OAuth login route<br/>[route.ts]"]
  node_callback["OAuth callback route<br/>[route.ts]"]
  node_channel["Channel profile route<br/>[route.ts]"]
  node_logout["Logout route<br/>[route.ts]"]
  node_oauth["OAuth helpers<br/>[google-oauth.ts]"]
end

subgraph group_insights["Analytics and insights"]
  node_analyze["Analysis route<br/>[route.ts]"]
  node_ask["Question route<br/>[route.ts]"]
  node_types["Analytics types<br/>[types.ts]"]
end

subgraph group_policies["Policies"]
  node_legal["Policy pages<br/>[legal-page.tsx]"]
  node_privacy["Privacy page<br/>[page.tsx]"]
  node_terms["Terms page<br/>[page.tsx]"]
end

node_creator(("Creator"))
node_youtube{{"YouTube APIs"}}
node_gemini{{"Gemini API"}}
node_google{{"Google OAuth"}}

node_creator -->|"opens app"| node_landing
node_landing -->|"starts sign-in"| node_login
node_login -->|"starts OAuth"| node_google
node_login -->|"uses helpers"| node_oauth
node_google -->|"returns authorization"| node_callback
node_callback -->|"exchanges code"| node_oauth
node_callback -->|"redirects after sign-in"| node_workspace
node_workspace -->|"loads profile"| node_channel
node_channel -->|"uses helpers"| node_oauth
node_channel -->|"fetches channel"| node_youtube
node_workspace -->|"requests analysis"| node_analyze
node_workspace -->|"renders chat"| node_chat
node_workspace -->|"renders report"| node_report
node_workspace -->|"requests answers"| node_ask
node_analyze -->|"uses helpers"| node_oauth
node_analyze -->|"fetches uploads and metrics"| node_youtube
node_analyze -->|"generates insights"| node_gemini
node_analyze -->|"returns report data"| node_types
node_ask -->|"uses helpers"| node_oauth
node_ask -->|"fetches uploads and metrics"| node_youtube
node_ask -->|"generates answers"| node_gemini
node_report -->|"renders typed results"| node_types
node_workspace -->|"renders footer"| node_footer
node_landing -->|"renders footer"| node_footer
node_privacy -->|"renders policy"| node_legal
node_terms -->|"renders policy"| node_legal
node_legal -->|"renders footer"| node_footer
node_creator -->|"disconnects account"| node_logout
node_logout -->|"uses cookie rules"| node_oauth

click node_landing "https://github.com/abhishal-ks/yu-kan/blob/main/src/features/landing/landing-page.tsx"
click node_workspace "https://github.com/abhishal-ks/yu-kan/blob/main/src/features/dashboard/dashboard-workspace.tsx"
click node_chat "https://github.com/abhishal-ks/yu-kan/blob/main/src/features/chat/analytics-chat.tsx"
click node_report "https://github.com/abhishal-ks/yu-kan/blob/main/src/features/analytics/analysis-results.tsx"
click node_footer "https://github.com/abhishal-ks/yu-kan/blob/main/src/components/site-footer.tsx"
click node_login "https://github.com/abhishal-ks/yu-kan/blob/main/src/app/api/auth/login/route.ts"
click node_callback "https://github.com/abhishal-ks/yu-kan/blob/main/src/app/api/auth/callback/route.ts"
click node_channel "https://github.com/abhishal-ks/yu-kan/blob/main/src/app/api/auth/channel/route.ts"
click node_logout "https://github.com/abhishal-ks/yu-kan/blob/main/src/app/api/auth/logout/route.ts"
click node_oauth "https://github.com/abhishal-ks/yu-kan/blob/main/src/lib/google-oauth.ts"
click node_analyze "https://github.com/abhishal-ks/yu-kan/blob/main/src/app/api/analyze/route.ts"
click node_ask "https://github.com/abhishal-ks/yu-kan/blob/main/src/app/api/ask/route.ts"
click node_types "https://github.com/abhishal-ks/yu-kan/blob/main/src/features/analytics/types.ts"
click node_legal "https://github.com/abhishal-ks/yu-kan/blob/main/src/features/legal/legal-page.tsx"
click node_privacy "https://github.com/abhishal-ks/yu-kan/blob/main/src/app/privacy/page.tsx"
click node_terms "https://github.com/abhishal-ks/yu-kan/blob/main/src/app/terms/page.tsx"

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_landing,node_workspace,node_chat,node_report,node_footer toneBlue
class node_login,node_callback,node_channel,node_logout,node_oauth toneAmber
class node_analyze,node_ask,node_types,node_youtube,node_gemini toneMint
class node_legal,node_privacy,node_terms toneRose
class node_creator,node_google toneIndigo
```

## Components

### Creator experience

- [Landing page](https://github.com/abhishal-ks/yu-kan/blob/main/src/features/landing/landing-page.tsx): `src/features/landing/landing-page.tsx`
- [Dashboard workspace](https://github.com/abhishal-ks/yu-kan/blob/main/src/features/dashboard/dashboard-workspace.tsx): `src/features/dashboard/dashboard-workspace.tsx`
- [Analytics chat](https://github.com/abhishal-ks/yu-kan/blob/main/src/features/chat/analytics-chat.tsx): `src/features/chat/analytics-chat.tsx`
- [Analysis results](https://github.com/abhishal-ks/yu-kan/blob/main/src/features/analytics/analysis-results.tsx): `src/features/analytics/analysis-results.tsx`
- [Site footer](https://github.com/abhishal-ks/yu-kan/blob/main/src/components/site-footer.tsx): `src/components/site-footer.tsx`

### Google identity

- [OAuth login route](https://github.com/abhishal-ks/yu-kan/blob/main/src/app/api/auth/login/route.ts): `src/app/api/auth/login/route.ts`
- [OAuth callback route](https://github.com/abhishal-ks/yu-kan/blob/main/src/app/api/auth/callback/route.ts): `src/app/api/auth/callback/route.ts`
- [Channel profile route](https://github.com/abhishal-ks/yu-kan/blob/main/src/app/api/auth/channel/route.ts): `src/app/api/auth/channel/route.ts`
- [Logout route](https://github.com/abhishal-ks/yu-kan/blob/main/src/app/api/auth/logout/route.ts): `src/app/api/auth/logout/route.ts`
- [OAuth helpers](https://github.com/abhishal-ks/yu-kan/blob/main/src/lib/google-oauth.ts): `src/lib/google-oauth.ts`

### Analytics and insights

- [Analysis route](https://github.com/abhishal-ks/yu-kan/blob/main/src/app/api/analyze/route.ts): `src/app/api/analyze/route.ts`
- [Question route](https://github.com/abhishal-ks/yu-kan/blob/main/src/app/api/ask/route.ts): `src/app/api/ask/route.ts`
- [Analytics types](https://github.com/abhishal-ks/yu-kan/blob/main/src/features/analytics/types.ts): `src/features/analytics/types.ts`

### Policies

- [Policy pages](https://github.com/abhishal-ks/yu-kan/blob/main/src/features/legal/legal-page.tsx): `src/features/legal/legal-page.tsx`
- [Privacy page](https://github.com/abhishal-ks/yu-kan/blob/main/src/app/privacy/page.tsx): `src/app/privacy/page.tsx`
- [Terms page](https://github.com/abhishal-ks/yu-kan/blob/main/src/app/terms/page.tsx): `src/app/terms/page.tsx`

### Other components

- **Creator**
- **YouTube APIs**
- **Gemini API**
- **Google OAuth**

## Connections

- Creator → Landing page: opens app (evidence: `README.md`)
- Landing page → OAuth login route: starts sign-in (evidence: `src/features/landing/landing-page.tsx`)
- OAuth login route → Google OAuth: starts OAuth (evidence: `README.md`)
- OAuth login route → OAuth helpers: uses helpers (evidence: `src/app/api/auth/login/route.ts`)
- Google OAuth → OAuth callback route: returns authorization (evidence: `README.md`)
- OAuth callback route → OAuth helpers: exchanges code (evidence: `src/app/api/auth/callback/route.ts`)
- OAuth callback route → Dashboard workspace: redirects after sign-in (evidence: `src/app/api/auth/callback/route.ts`)
- Dashboard workspace → Channel profile route: loads profile (evidence: `src/features/dashboard/dashboard-workspace.tsx`)
- Channel profile route → OAuth helpers: uses helpers (evidence: `src/app/api/auth/channel/route.ts`)
- Channel profile route → YouTube APIs: fetches channel (evidence: `src/app/api/auth/channel/route.ts`)
- Dashboard workspace → Analysis route: requests analysis (evidence: `README.md`)
- Dashboard workspace → Analytics chat: renders chat (evidence: `src/features/dashboard/dashboard-workspace.tsx`)
- Dashboard workspace → Analysis results: renders report (evidence: `src/features/dashboard/dashboard-workspace.tsx`)
- Dashboard workspace → Question route: requests answers (evidence: `README.md`)
- Analysis route → OAuth helpers: uses helpers (evidence: `src/app/api/analyze/route.ts`)
- Analysis route → YouTube APIs: fetches uploads and metrics (evidence: `src/app/api/analyze/route.ts`)
- Analysis route → Gemini API: generates insights (evidence: `src/app/api/analyze/route.ts`)
- Analysis route → Analytics types: returns report data (evidence: `src/features/analytics/types.ts`)
- Question route → OAuth helpers: uses helpers (evidence: `src/app/api/ask/route.ts`)
- Question route → YouTube APIs: fetches uploads and metrics (evidence: `src/app/api/ask/route.ts`)
- Question route → Gemini API: generates answers (evidence: `src/app/api/ask/route.ts`)
- Analysis results → Analytics types: renders typed results (evidence: `src/features/analytics/analysis-results.tsx`)
- Dashboard workspace → Site footer: renders footer (evidence: `src/features/dashboard/dashboard-workspace.tsx`)
- Landing page → Site footer: renders footer (evidence: `src/features/landing/landing-page.tsx`)
- Privacy page → Policy pages: renders policy (evidence: `src/app/privacy/page.tsx`)
- Terms page → Policy pages: renders policy (evidence: `src/app/terms/page.tsx`)
- Policy pages → Site footer: renders footer (evidence: `src/features/legal/legal-page.tsx`)
- Creator → Logout route: disconnects account (evidence: `README.md`)
- Logout route → OAuth helpers: uses cookie rules (evidence: `src/app/api/auth/logout/route.ts`)
