# dongwook32/codelog architecture

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

- Interactive diagram: https://gitdiagram.com/dongwook32/codelog
- Repository: https://github.com/dongwook32/codelog

## Overview

CodeLog turns a user’s GitHub repositories and recent commits into activity analytics, AI-generated developer insights, and a shareable public portfolio. The main workflow is GitHub OAuth and data synchronization, followed by persisted activity data, analysis, and dashboard or portfolio presentation. The graph also includes profile/settings and public sharing. Edges reflect the supplied excerpts, SOURCE INDEX references, or README statements; unsampled implementation details are not assumed.

Main entry points: [`utils/supabase/server.ts`](https://github.com/dongwook32/codelog/blob/main/utils/supabase/server.ts) (Server Supabase client), [`app/portfolio/page.tsx`](https://github.com/dongwook32/codelog/blob/main/app/portfolio/page.tsx) (Portfolio editor), [`app/[username]/page.tsx`](https://github.com/dongwook32/codelog/blob/main/app/%5Busername%5D/page.tsx) (Public portfolio), [`lib/analyze-portfolio.ts`](https://github.com/dongwook32/codelog/blob/main/lib/analyze-portfolio.ts) (AI analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_login["GitHub login<br/>[page.tsx]"]
  node_dashboard["Activity dashboard<br/>[page.tsx]"]
  node_analytics["Activity analytics<br/>[page.tsx]"]
  node_portfolio_page["Portfolio editor<br/>[page.tsx]"]
  node_public_portfolio["Public portfolio<br/>[page.tsx]"]
  node_sync_setup["Initial sync<br/>[page.tsx]"]
end

subgraph group_domain["Activity and portfolio"]
  node_sync_action["Sync action<br/>[sync.ts]"]
  node_sync_user["Per-user sync<br/>[sync-for-user.ts]"]
  node_cron_sync["Scheduled sync<br/>[route.ts]"]
  node_portfolio_analysis["Portfolio analysis"]
  node_portfolio_utils["Portfolio metrics<br/>[portfolio-utils.ts]"]
  node_public_data["Public portfolio data"]
  node_ai_analysis["AI analysis"]
  node_server_actions["Account and portfolio actions<br/>[actions.ts]"]
end

subgraph group_platform["Data and integrations"]
  node_supabase_server["Server Supabase client<br/>[server.ts]"]
  node_supabase_client["Browser Supabase client<br/>[client.ts]"]
  node_database_types["Database schema types<br/>[database.types.ts]"]
  node_supabase_admin["Admin Supabase client<br/>[admin.ts]"]
  node_supabase[("Supabase database and auth")]
  node_github["GitHub API"]
  node_gemini["Google Gemini"]
  node_openai["OpenAI"]
end

subgraph group_operations["Account operations"]
  node_profile["Profile settings<br/>[page.tsx]"]
  node_settings["Account settings<br/>[page.tsx]"]
  node_admin["Admin tools<br/>[page.tsx]"]
end

node_developer(("Developer"))

node_developer -->|"signs in"| node_login
node_login -->|"authenticates with"| node_supabase_client
node_supabase_client -->|"connects to"| node_supabase
node_developer -->|"starts sync"| node_sync_setup
node_sync_setup -->|"invokes"| node_sync_action
node_sync_action -.->|"imports GitHub data"| node_github
node_cron_sync -->|"dispatches"| node_sync_user
node_sync_user -.->|"imports GitHub data"| node_github
node_cron_sync -->|"uses"| node_supabase_admin
node_sync_user -.->|"persists activity"| node_supabase
node_dashboard -->|"loads user data"| node_supabase_server
node_analytics -->|"loads analytics data"| node_supabase_server
node_portfolio_page -->|"loads portfolio data"| node_supabase_server
node_public_portfolio -->|"loads public data"| node_supabase_server
node_supabase_server -->|"connects to"| node_supabase
node_supabase_server -->|"uses schema types"| node_database_types
node_supabase_client -->|"uses schema types"| node_database_types
node_supabase_admin -.->|"connects to"| node_supabase
node_portfolio_page -->|"requests analysis"| node_portfolio_analysis
node_public_portfolio -->|"requests analysis"| node_portfolio_analysis
node_public_portfolio -->|"imports"| node_public_data
node_portfolio_analysis -->|"uses analysis"| node_ai_analysis
node_portfolio_page -->|"imports metrics"| node_portfolio_utils
node_public_portfolio -->|"imports metrics"| node_portfolio_utils
node_dashboard -.->|"requests insights"| node_ai_analysis
node_ai_analysis -.->|"analyzes activity"| node_gemini
node_ai_analysis -.->|"fallback analysis"| node_openai
node_portfolio_page -->|"uses portfolio actions"| node_server_actions
node_settings -->|"uses settings actions"| node_server_actions
node_server_actions -->|"queries and updates"| node_supabase_server
node_developer -->|"edits profile"| node_profile
node_developer -->|"configures account"| node_settings
node_admin -->|"loads admin page data"| node_supabase_server
node_admin -.->|"admin operations"| node_supabase

click node_login "https://github.com/dongwook32/codelog/blob/main/app/login/page.tsx"
click node_dashboard "https://github.com/dongwook32/codelog/blob/main/app/dashboard/page.tsx"
click node_analytics "https://github.com/dongwook32/codelog/blob/main/app/analytics/page.tsx"
click node_portfolio_page "https://github.com/dongwook32/codelog/blob/main/app/portfolio/page.tsx"
click node_public_portfolio "https://github.com/dongwook32/codelog/blob/main/app/%5Busername%5D/page.tsx"
click node_sync_setup "https://github.com/dongwook32/codelog/blob/main/app/setup/sync/page.tsx"
click node_sync_action "https://github.com/dongwook32/codelog/blob/main/app/actions/sync.ts"
click node_sync_user "https://github.com/dongwook32/codelog/blob/main/lib/sync-for-user.ts"
click node_cron_sync "https://github.com/dongwook32/codelog/blob/main/app/api/cron/sync-commits/route.ts"
click node_portfolio_analysis "https://github.com/dongwook32/codelog/blob/main/lib/portfolio-analysis.ts"
click node_portfolio_utils "https://github.com/dongwook32/codelog/blob/main/lib/portfolio-utils.ts"
click node_public_data "https://github.com/dongwook32/codelog/blob/main/lib/public-portfolio.ts"
click node_ai_analysis "https://github.com/dongwook32/codelog/blob/main/lib/analyze-portfolio.ts"
click node_server_actions "https://github.com/dongwook32/codelog/blob/main/lib/actions.ts"
click node_supabase_server "https://github.com/dongwook32/codelog/blob/main/utils/supabase/server.ts"
click node_supabase_client "https://github.com/dongwook32/codelog/blob/main/utils/supabase/client.ts"
click node_database_types "https://github.com/dongwook32/codelog/blob/main/types/database.types.ts"
click node_supabase_admin "https://github.com/dongwook32/codelog/blob/main/utils/supabase/admin.ts"
click node_profile "https://github.com/dongwook32/codelog/blob/main/app/me/page.tsx"
click node_settings "https://github.com/dongwook32/codelog/blob/main/app/settings/page.tsx"
click node_admin "https://github.com/dongwook32/codelog/blob/main/app/admin/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_login,node_dashboard,node_analytics,node_portfolio_page,node_public_portfolio,node_sync_setup toneBlue
class node_sync_action,node_sync_user,node_cron_sync,node_portfolio_analysis,node_portfolio_utils,node_public_data,node_ai_analysis,node_server_actions toneAmber
class node_supabase_server,node_supabase_client,node_database_types,node_supabase_admin,node_supabase,node_github,node_gemini,node_openai toneMint
class node_profile,node_settings,node_admin toneRose
class node_developer toneIndigo
```

## Components

### User experience

- [GitHub login](https://github.com/dongwook32/codelog/blob/main/app/login/page.tsx): `app/login/page.tsx`
- [Activity dashboard](https://github.com/dongwook32/codelog/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Activity analytics](https://github.com/dongwook32/codelog/blob/main/app/analytics/page.tsx): `app/analytics/page.tsx`
- [Portfolio editor](https://github.com/dongwook32/codelog/blob/main/app/portfolio/page.tsx): `app/portfolio/page.tsx`
- [Public portfolio](https://github.com/dongwook32/codelog/blob/main/app/%5Busername%5D/page.tsx): `app/[username]/page.tsx`
- [Initial sync](https://github.com/dongwook32/codelog/blob/main/app/setup/sync/page.tsx): `app/setup/sync/page.tsx`

### Activity and portfolio

- [Sync action](https://github.com/dongwook32/codelog/blob/main/app/actions/sync.ts): `app/actions/sync.ts`
- [Per-user sync](https://github.com/dongwook32/codelog/blob/main/lib/sync-for-user.ts): `lib/sync-for-user.ts`
- [Scheduled sync](https://github.com/dongwook32/codelog/blob/main/app/api/cron/sync-commits/route.ts): `app/api/cron/sync-commits/route.ts`
- [Portfolio analysis](https://github.com/dongwook32/codelog/blob/main/lib/portfolio-analysis.ts): `lib/portfolio-analysis.ts`
- [Portfolio metrics](https://github.com/dongwook32/codelog/blob/main/lib/portfolio-utils.ts): `lib/portfolio-utils.ts`
- [Public portfolio data](https://github.com/dongwook32/codelog/blob/main/lib/public-portfolio.ts): `lib/public-portfolio.ts`
- [AI analysis](https://github.com/dongwook32/codelog/blob/main/lib/analyze-portfolio.ts): `lib/analyze-portfolio.ts`
- [Account and portfolio actions](https://github.com/dongwook32/codelog/blob/main/lib/actions.ts): `lib/actions.ts`

### Data and integrations

- [Server Supabase client](https://github.com/dongwook32/codelog/blob/main/utils/supabase/server.ts): `utils/supabase/server.ts`
- [Browser Supabase client](https://github.com/dongwook32/codelog/blob/main/utils/supabase/client.ts): `utils/supabase/client.ts`
- [Database schema types](https://github.com/dongwook32/codelog/blob/main/types/database.types.ts): `types/database.types.ts`
- [Admin Supabase client](https://github.com/dongwook32/codelog/blob/main/utils/supabase/admin.ts): `utils/supabase/admin.ts`
- **Supabase database and auth**
- **GitHub API**
- **Google Gemini**
- **OpenAI**

### Account operations

- [Profile settings](https://github.com/dongwook32/codelog/blob/main/app/me/page.tsx): `app/me/page.tsx`
- [Account settings](https://github.com/dongwook32/codelog/blob/main/app/settings/page.tsx): `app/settings/page.tsx`
- [Admin tools](https://github.com/dongwook32/codelog/blob/main/app/admin/page.tsx): `app/admin/page.tsx`

### Other components

- **Developer**

## Connections

- Developer → GitHub login: signs in
- GitHub login → Browser Supabase client: authenticates with (evidence: `app/login/page.tsx`)
- Browser Supabase client → Supabase database and auth: connects to (evidence: `utils/supabase/client.ts`)
- Developer → Initial sync: starts sync
- Initial sync → Sync action: invokes (evidence: `app/setup/sync/page.tsx`)
- Sync action → GitHub API: imports GitHub data
- Scheduled sync → Per-user sync: dispatches (evidence: `app/api/cron/sync-commits/route.ts`)
- Per-user sync → GitHub API: imports GitHub data
- Scheduled sync → Admin Supabase client: uses (evidence: `app/api/cron/sync-commits/route.ts`)
- Per-user sync → Supabase database and auth: persists activity
- Activity dashboard → Server Supabase client: loads user data (evidence: `app/dashboard/page.tsx`)
- Activity analytics → Server Supabase client: loads analytics data (evidence: `app/analytics/page.tsx`)
- Portfolio editor → Server Supabase client: loads portfolio data (evidence: `app/portfolio/page.tsx`)
- Public portfolio → Server Supabase client: loads public data (evidence: `app/[username]/page.tsx`)
- Server Supabase client → Supabase database and auth: connects to (evidence: `utils/supabase/server.ts`)
- Server Supabase client → Database schema types: uses schema types (evidence: `utils/supabase/server.ts`)
- Browser Supabase client → Database schema types: uses schema types (evidence: `utils/supabase/client.ts`)
- Admin Supabase client → Supabase database and auth: connects to
- Portfolio editor → Portfolio analysis: requests analysis (evidence: `app/portfolio/page.tsx`)
- Public portfolio → Portfolio analysis: requests analysis (evidence: `app/[username]/page.tsx`)
- Public portfolio → Public portfolio data: imports (evidence: `app/[username]/page.tsx`)
- Portfolio analysis → AI analysis: uses analysis (evidence: `lib/portfolio-analysis.ts`)
- Portfolio editor → Portfolio metrics: imports metrics (evidence: `app/portfolio/page.tsx`)
- Public portfolio → Portfolio metrics: imports metrics (evidence: `app/[username]/page.tsx`)
- Activity dashboard → AI analysis: requests insights
- AI analysis → Google Gemini: analyzes activity
- AI analysis → OpenAI: fallback analysis
- Portfolio editor → Account and portfolio actions: uses portfolio actions (evidence: `app/portfolio/page.tsx`)
- Account settings → Account and portfolio actions: uses settings actions (evidence: `app/settings/page.tsx`)
- Account and portfolio actions → Server Supabase client: queries and updates (evidence: `lib/actions.ts`)
- Developer → Profile settings: edits profile (evidence: `app/me/page.tsx`)
- Developer → Account settings: configures account (evidence: `app/settings/page.tsx`)
- Admin tools → Server Supabase client: loads admin page data (evidence: `app/admin/page.tsx`)
- Admin tools → Supabase database and auth: admin operations
