# mudaeng/incomefront architecture

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

- Interactive diagram: https://gitdiagram.com/mudaeng/incomefront
- Repository: https://github.com/mudaeng/incomefront

## Overview

incomefront is a Korean-language frontend for managing a KRW/USD dividend portfolio. Users sign in, choose an account, and review holdings, returns, and dividends; they can manage accounts and trades, inspect securities, or import broker history. Admin screens cover batch, price-search, client-token, and tax-free-dividend records. The graph separates routed workflows, shared UI, domain helpers, and API access. Edges reflect the shown route/import/call evidence and README descriptions; unsampled page internals are not asserted.

Main entry points: [`src/api/queries.ts`](https://github.com/mudaeng/incomefront/blob/master/src/api/queries.ts) (Query and mutation hooks), [`src/App.tsx`](https://github.com/mudaeng/incomefront/blob/master/src/App.tsx) (Routes and guards), [`src/pages/AdminLayout.tsx`](https://github.com/mudaeng/incomefront/blob/master/src/pages/AdminLayout.tsx) (Admin navigation), [`src/auth/AuthProvider.tsx`](https://github.com/mudaeng/incomefront/blob/master/src/auth/AuthProvider.tsx) (Session provider)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflows["Portfolio workflows"]
  node_dashboard["Integrated balance<br/>[DashboardPage.tsx]"]
  node_security["Security detail"]
  node_dividends["Dividend views<br/>[DividendsPage.tsx]"]
  node_returns["Period returns<br/>[ReturnsPage.tsx]"]
end

subgraph group_operations["Account and imports"]
  node_accounts["Account management<br/>[AccountsPage.tsx]"]
  node_toss["Toss import<br/>[TossImportPage.tsx]"]
  node_brokerflow["Broker import flow"]
end

subgraph group_admin["Administration"]
  node_adminlayout["Admin navigation<br/>[AdminLayout.tsx]"]
  node_adminbatch["Batch history<br/>[AdminBatchPage.tsx]"]
  node_adminprices["Price searches"]
  node_admintokens["Client tokens"]
  node_admintax["Tax-free dividends"]
end

subgraph group_shared["Shared application"]
  node_app["Routes and guards<br/>[App.tsx]"]
  node_login["Login and callback<br/>[LoginPage.tsx]"]
  node_authcallback["Auth callback"]
  node_auth["Session provider<br/>[AuthProvider.tsx]"]
  node_layout["Navigation layout<br/>[Layout.tsx]"]
  node_accountselect["Account selector<br/>[AccountSelect.tsx]"]
  node_securitysearch["Security search<br/>[SecuritySearch.tsx]"]
end

subgraph group_data["API and domain"]
  node_queries["Query and mutation hooks<br/>[queries.ts]"]
  node_client["HTTP and token client<br/>[client.ts]"]
  node_types["API data types<br/>[types.ts]"]
  node_accountlib["Account rules<br/>[account.ts]"]
  node_companylib["Broker labels<br/>[securityCompany.ts]"]
  node_dividendtax["Dividend tax rules<br/>[dividendTax.ts]"]
  node_brokerlib["Broker import parsing<br/>[brokerImport.ts]"]
end

node_user(("Portfolio user"))
node_backend{{"Income portfolio API"}}
node_google{{"Google sign-in"}}

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_security
node_app -->|"routes to"| node_dividends
node_app -->|"routes to"| node_returns
node_app -->|"routes to"| node_accounts
node_app -->|"routes to"| node_toss
node_app -.->|"provides session"| node_auth
node_app -->|"wraps routes"| node_layout
node_user -->|"signs in"| node_login
node_google -->|"initiates login"| node_client
node_authcallback -->|"completes login"| node_auth
node_auth -->|"issues token"| node_client
node_auth -->|"loads profile"| node_queries
node_dashboard -->|"loads balance"| node_queries
node_security -->|"loads security data"| node_queries
node_dividends -->|"loads dividends"| node_queries
node_returns -->|"loads returns"| node_queries
node_accounts -->|"manages accounts"| node_queries
node_toss -->|"uses import flow"| node_brokerflow
node_brokerflow -->|"submits trades"| node_queries
node_brokerflow -->|"parses history"| node_brokerlib
node_dashboard -->|"selects account"| node_accountselect
node_security -->|"searches securities"| node_securitysearch
node_dividends -->|"applies tax mode"| node_dividendtax
node_adminlayout -->|"routes to"| node_adminbatch
node_adminlayout -->|"routes to"| node_adminprices
node_adminlayout -->|"routes to"| node_admintokens
node_adminlayout -->|"routes to"| node_admintax
node_adminprices -->|"loads records"| node_queries
node_admintokens -->|"manages tokens"| node_queries
node_queries -->|"sends requests"| node_client
node_client -->|"calls API"| node_backend
node_securitysearch -->|"searches API"| node_queries
node_accountlib -->|"uses labels"| node_companylib

click node_app "https://github.com/mudaeng/incomefront/blob/master/src/App.tsx"
click node_dashboard "https://github.com/mudaeng/incomefront/blob/master/src/pages/DashboardPage.tsx"
click node_security "https://github.com/mudaeng/incomefront/blob/master/src/pages/SecurityDetailPage.tsx"
click node_dividends "https://github.com/mudaeng/incomefront/blob/master/src/pages/DividendsPage.tsx"
click node_returns "https://github.com/mudaeng/incomefront/blob/master/src/pages/ReturnsPage.tsx"
click node_accounts "https://github.com/mudaeng/incomefront/blob/master/src/pages/AccountsPage.tsx"
click node_toss "https://github.com/mudaeng/incomefront/blob/master/src/pages/TossImportPage.tsx"
click node_brokerflow "https://github.com/mudaeng/incomefront/blob/master/src/components/BrokerImportFlow.tsx"
click node_login "https://github.com/mudaeng/incomefront/blob/master/src/pages/LoginPage.tsx"
click node_authcallback "https://github.com/mudaeng/incomefront/blob/master/src/pages/AuthCallbackPage.tsx"
click node_auth "https://github.com/mudaeng/incomefront/blob/master/src/auth/AuthProvider.tsx"
click node_layout "https://github.com/mudaeng/incomefront/blob/master/src/components/Layout.tsx"
click node_accountselect "https://github.com/mudaeng/incomefront/blob/master/src/components/AccountSelect.tsx"
click node_securitysearch "https://github.com/mudaeng/incomefront/blob/master/src/components/SecuritySearch.tsx"
click node_adminlayout "https://github.com/mudaeng/incomefront/blob/master/src/pages/AdminLayout.tsx"
click node_adminbatch "https://github.com/mudaeng/incomefront/blob/master/src/pages/AdminBatchPage.tsx"
click node_adminprices "https://github.com/mudaeng/incomefront/blob/master/src/pages/AdminPriceSearchPage.tsx"
click node_admintokens "https://github.com/mudaeng/incomefront/blob/master/src/pages/AdminClientTokenPage.tsx"
click node_admintax "https://github.com/mudaeng/incomefront/blob/master/src/pages/AdminTaxFreeDividendPage.tsx"
click node_queries "https://github.com/mudaeng/incomefront/blob/master/src/api/queries.ts"
click node_client "https://github.com/mudaeng/incomefront/blob/master/src/api/client.ts"
click node_types "https://github.com/mudaeng/incomefront/blob/master/src/api/types.ts"
click node_accountlib "https://github.com/mudaeng/incomefront/blob/master/src/lib/account.ts"
click node_companylib "https://github.com/mudaeng/incomefront/blob/master/src/lib/securityCompany.ts"
click node_dividendtax "https://github.com/mudaeng/incomefront/blob/master/src/lib/dividendTax.ts"
click node_brokerlib "https://github.com/mudaeng/incomefront/blob/master/src/lib/brokerImport.ts"

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_dashboard,node_security,node_dividends,node_returns,node_user toneBlue
class node_accounts,node_toss,node_brokerflow toneAmber
class node_adminlayout,node_adminbatch,node_adminprices,node_admintokens,node_admintax,node_backend toneMint
class node_app,node_login,node_authcallback,node_auth,node_layout,node_accountselect,node_securitysearch toneRose
class node_queries,node_client,node_types,node_accountlib,node_companylib,node_dividendtax,node_brokerlib,node_google toneIndigo
```

## Components

### Portfolio workflows

- [Integrated balance](https://github.com/mudaeng/incomefront/blob/master/src/pages/DashboardPage.tsx): `src/pages/DashboardPage.tsx`
- [Security detail](https://github.com/mudaeng/incomefront/blob/master/src/pages/SecurityDetailPage.tsx): `src/pages/SecurityDetailPage.tsx`
- [Dividend views](https://github.com/mudaeng/incomefront/blob/master/src/pages/DividendsPage.tsx): `src/pages/DividendsPage.tsx`
- [Period returns](https://github.com/mudaeng/incomefront/blob/master/src/pages/ReturnsPage.tsx): `src/pages/ReturnsPage.tsx`

### Account and imports

- [Account management](https://github.com/mudaeng/incomefront/blob/master/src/pages/AccountsPage.tsx): `src/pages/AccountsPage.tsx`
- [Toss import](https://github.com/mudaeng/incomefront/blob/master/src/pages/TossImportPage.tsx): `src/pages/TossImportPage.tsx`
- [Broker import flow](https://github.com/mudaeng/incomefront/blob/master/src/components/BrokerImportFlow.tsx): `src/components/BrokerImportFlow.tsx`

### Administration

- [Admin navigation](https://github.com/mudaeng/incomefront/blob/master/src/pages/AdminLayout.tsx): `src/pages/AdminLayout.tsx`
- [Batch history](https://github.com/mudaeng/incomefront/blob/master/src/pages/AdminBatchPage.tsx): `src/pages/AdminBatchPage.tsx`
- [Price searches](https://github.com/mudaeng/incomefront/blob/master/src/pages/AdminPriceSearchPage.tsx): `src/pages/AdminPriceSearchPage.tsx`
- [Client tokens](https://github.com/mudaeng/incomefront/blob/master/src/pages/AdminClientTokenPage.tsx): `src/pages/AdminClientTokenPage.tsx`
- [Tax-free dividends](https://github.com/mudaeng/incomefront/blob/master/src/pages/AdminTaxFreeDividendPage.tsx): `src/pages/AdminTaxFreeDividendPage.tsx`

### Shared application

- [Routes and guards](https://github.com/mudaeng/incomefront/blob/master/src/App.tsx): `src/App.tsx`
- [Login and callback](https://github.com/mudaeng/incomefront/blob/master/src/pages/LoginPage.tsx): `src/pages/LoginPage.tsx`
- [Auth callback](https://github.com/mudaeng/incomefront/blob/master/src/pages/AuthCallbackPage.tsx): `src/pages/AuthCallbackPage.tsx`
- [Session provider](https://github.com/mudaeng/incomefront/blob/master/src/auth/AuthProvider.tsx): `src/auth/AuthProvider.tsx`
- [Navigation layout](https://github.com/mudaeng/incomefront/blob/master/src/components/Layout.tsx): `src/components/Layout.tsx`
- [Account selector](https://github.com/mudaeng/incomefront/blob/master/src/components/AccountSelect.tsx): `src/components/AccountSelect.tsx`
- [Security search](https://github.com/mudaeng/incomefront/blob/master/src/components/SecuritySearch.tsx): `src/components/SecuritySearch.tsx`

### API and domain

- [Query and mutation hooks](https://github.com/mudaeng/incomefront/blob/master/src/api/queries.ts): `src/api/queries.ts`
- [HTTP and token client](https://github.com/mudaeng/incomefront/blob/master/src/api/client.ts): `src/api/client.ts`
- [API data types](https://github.com/mudaeng/incomefront/blob/master/src/api/types.ts): `src/api/types.ts`
- [Account rules](https://github.com/mudaeng/incomefront/blob/master/src/lib/account.ts): `src/lib/account.ts`
- [Broker labels](https://github.com/mudaeng/incomefront/blob/master/src/lib/securityCompany.ts): `src/lib/securityCompany.ts`
- [Dividend tax rules](https://github.com/mudaeng/incomefront/blob/master/src/lib/dividendTax.ts): `src/lib/dividendTax.ts`
- [Broker import parsing](https://github.com/mudaeng/incomefront/blob/master/src/lib/brokerImport.ts): `src/lib/brokerImport.ts`

### Other components

- **Portfolio user**
- **Income portfolio API**
- **Google sign-in**

## Connections

- Portfolio user → Routes and guards: uses (evidence: `README.md`)
- Routes and guards → Integrated balance: routes to (evidence: `src/App.tsx`)
- Routes and guards → Security detail: routes to (evidence: `README.md`)
- Routes and guards → Dividend views: routes to (evidence: `README.md`)
- Routes and guards → Period returns: routes to (evidence: `README.md`)
- Routes and guards → Account management: routes to (evidence: `src/App.tsx`)
- Routes and guards → Toss import: routes to (evidence: `src/App.tsx`)
- Routes and guards → Session provider: provides session (evidence: `src/App.tsx`)
- Routes and guards → Navigation layout: wraps routes (evidence: `src/App.tsx`)
- Portfolio user → Login and callback: signs in (evidence: `README.md`)
- Google sign-in → HTTP and token client: initiates login (evidence: `src/api/client.ts`)
- Auth callback → Session provider: completes login (evidence: `src/pages/AuthCallbackPage.tsx`)
- Session provider → HTTP and token client: issues token (evidence: `src/auth/AuthProvider.tsx`)
- Session provider → Query and mutation hooks: loads profile (evidence: `src/auth/AuthProvider.tsx`)
- Integrated balance → Query and mutation hooks: loads balance (evidence: `src/pages/DashboardPage.tsx`)
- Security detail → Query and mutation hooks: loads security data (evidence: `src/pages/SecurityDetailPage.tsx`)
- Dividend views → Query and mutation hooks: loads dividends (evidence: `src/pages/DividendsPage.tsx`)
- Period returns → Query and mutation hooks: loads returns (evidence: `src/pages/ReturnsPage.tsx`)
- Account management → Query and mutation hooks: manages accounts (evidence: `src/pages/AccountsPage.tsx`)
- Toss import → Broker import flow: uses import flow (evidence: `src/pages/TossImportPage.tsx`)
- Broker import flow → Query and mutation hooks: submits trades (evidence: `src/components/BrokerImportFlow.tsx`)
- Broker import flow → Broker import parsing: parses history (evidence: `src/components/BrokerImportFlow.tsx`)
- Integrated balance → Account selector: selects account (evidence: `src/pages/DashboardPage.tsx`)
- Security detail → Security search: searches securities (evidence: `src/pages/SecurityDetailPage.tsx`)
- Dividend views → Dividend tax rules: applies tax mode (evidence: `src/pages/DividendsPage.tsx`)
- Admin navigation → Batch history: routes to (evidence: `README.md`)
- Admin navigation → Price searches: routes to (evidence: `README.md`)
- Admin navigation → Client tokens: routes to (evidence: `README.md`)
- Admin navigation → Tax-free dividends: routes to (evidence: `README.md`)
- Price searches → Query and mutation hooks: loads records (evidence: `src/pages/AdminPriceSearchPage.tsx`)
- Client tokens → Query and mutation hooks: manages tokens (evidence: `src/pages/AdminClientTokenPage.tsx`)
- Query and mutation hooks → HTTP and token client: sends requests (evidence: `src/api/queries.ts`)
- HTTP and token client → Income portfolio API: calls API (evidence: `src/api/client.ts`)
- Security search → Query and mutation hooks: searches API (evidence: `src/components/SecuritySearch.tsx`)
- Account rules → Broker labels: uses labels (evidence: `src/lib/account.ts`)
