Skip to content

Latest commit

Β 

History

34 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

dongkk-frontend

Frontend for μ²­μ‹¬ν™˜, an AI-powered FX risk diagnosis platform for small and medium-sized import/export businesses.

dongkk-frontendλŠ” 계약 정보 μž…λ ₯λΆ€ν„° ν™˜λ¦¬μŠ€ν¬ 진단, 리슀크 μ„±ν–₯ 뢄석, λŒ€μ‘ μ „λž΅ 및 κΈˆμœ΅μƒν’ˆ μΆ”μ²œ, 상담 μ‹ μ²­κΉŒμ§€μ˜ 전체 μ‚¬μš©μž κ²½ν—˜μ„ μ œκ³΅ν•˜λŠ” Next.js 기반 μ›Ή μ• ν”Œλ¦¬μΌ€μ΄μ…˜μž…λ‹ˆλ‹€.

μ‹€μ œ ν™˜μœ¨ 예츑과 κΈˆμœ΅μƒν’ˆ 검색은 AI μ„œλΉ„μŠ€μ—μ„œ μˆ˜ν–‰ν•˜λ©°, 리슀크 뢄석과 μ „λž΅ 생성은 λ°±μ—”λ“œμ—μ„œ μ²˜λ¦¬ν•©λ‹ˆλ‹€. 이 λ ˆν¬λŠ” 뢄석 κ²°κ³Όλ₯Ό μ‚¬μš©μžκ°€ μ΄ν•΄ν•˜κΈ° μ‰¬μš΄ ν˜•νƒœλ‘œ μ‹œκ°ν™”ν•˜κ³  μƒν˜Έμž‘μš©μ„ μ œκ³΅ν•©λ‹ˆλ‹€.


✨ Features

μ‚¬μš©μžλŠ” ν•˜λ‚˜μ˜ Wizard Flowλ₯Ό 따라 ν™˜λ¦¬μŠ€ν¬λ₯Ό μ§„λ‹¨ν•˜κ³  λŒ€μ‘ μ „λž΅μ„ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.

Step Description
1 νšŒμ‚¬ 및 계약 정보 μž…λ ₯
2 AI 기반 ν™˜λ¦¬μŠ€ν¬ 진단
3 κΈ°μ—… 리슀크 μ„±ν–₯ 뢄석
4 λŒ€μ‘ μ „λž΅ 및 KB κΈˆμœ΅μƒν’ˆ μΆ”μ²œ
5 상담 μ‹ μ²­
flowchart LR
    A[Company & Contract]
    --> B[Risk Assessment]
    --> C[Risk Profile]
    --> D[Strategy Recommendation]
    --> E[Consultation]
Loading

πŸ—οΈ Architecture

μ„œλΉ„μŠ€λŠ” μ„Έ 개의 λ ˆν¬μ§€ν† λ¦¬λ‘œ κ΅¬μ„±λ˜μ–΄ 있으며, 이 λ ˆν¬λŠ” μ‚¬μš©μžμ™€ 직접 μƒν˜Έμž‘μš©ν•˜λŠ” ν”„λ‘ νŠΈμ—”λ“œμž…λ‹ˆλ‹€.

flowchart LR

    subgraph Frontend
        FE["dongkk-frontend"]
    end

    subgraph Backend
        SERVER["dongkk-server"]
    end

    subgraph AI["dongkk-ai"]
        FORECAST["fx-chronos<br/>Exchange Rate Forecast"]
        RAG["financial-product-rag<br/>Financial Product Retrieval"]
    end

    FE -->|REST API| SERVER
    SERVER -->|Exchange Forecast| FORECAST
    SERVER -->|Product Retrieval| RAG
Loading

Responsibilities

Component Responsibility
dongkk-frontend UI, Wizard Flow, Result Visualization
dongkk-server REST API, Domain Logic, Strategy Rules
fx-chronos Exchange Rate Forecasting & Hedge Simulation
financial-product-rag Financial Product Retrieval & Matching
  • Strategy generation (hedging strategy and allocation ratio) is implemented by rule-based logic in dongkk-server.
  • AI services are responsible for exchange rate forecasting and financial product retrieval.
  • Browser requests are proxied through Next.js Rewrite (/backend-api/*) to avoid CORS issues.

πŸ”„ Request Flow

sequenceDiagram
    participant User
    participant Frontend
    participant Server
    participant Forecast
    participant RAG

    User->>Frontend: Enter company & contract
    Frontend->>Server: Submit diagnosis request

    Server->>Forecast: Forecast exchange rate
    Forecast-->>Server: Forecast result

    Server->>RAG: Retrieve financial products
    RAG-->>Server: Matching products

    Server-->>Frontend: Risk analysis + Strategy + Products
    Frontend-->>User: Display result
Loading

πŸ› οΈ Tech Stack

Category Technology
Framework Next.js 16 (App Router)
Language TypeScript, React 19
Styling Tailwind CSS v4
State Management React Context (WizardProvider)
Charts Recharts
Testing Vitest

πŸš€ Quick Start

Install

npm install

Configure Environment

cp .env.example .env.local
Variable Description
BACKEND_API_URL Backend endpoint used by Next.js Rewrite
NEXT_PUBLIC_API_BASE_URL Client API base path (default: /backend-api)

Run

npm run dev

Build

npm run build
npm run start

πŸ“‚ Project Structure

src/
β”œβ”€β”€ app/                 # App Router pages
β”œβ”€β”€ components/          # Shared UI components
β”œβ”€β”€ context/             # Wizard state management
β”œβ”€β”€ hooks/               # Custom hooks
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ api/             # API layer
β”‚   β”œβ”€β”€ risk.ts          # Risk formatting utilities
β”‚   β”œβ”€β”€ date.ts
β”‚   β”œβ”€β”€ countries.ts
β”‚   └── types.ts

πŸ”„ State Management

Wizard μƒνƒœλŠ” WizardProviderλ₯Ό 톡해 κ΄€λ¦¬ν•©λ‹ˆλ‹€.

κ΄€λ¦¬λ˜λŠ” μ£Όμš” λ°μ΄ν„°λŠ” λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€.

  • Company information
  • Contract information
  • Risk assessment result
  • Risk profile result
  • Strategy recommendation
  • Financial product recommendation
  • Consultation request

μƒνƒœλŠ” React Context에 μ €μž₯되며 λ³„λ„μ˜ μ˜μ†ν™”λŠ” ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. λ”°λΌμ„œ μƒˆλ‘œκ³ μΉ¨ν•˜λ©΄ WizardλŠ” μ²˜μŒλΆ€ν„° λ‹€μ‹œ μ‹œμž‘λ©λ‹ˆλ‹€.


πŸ”Œ API Layer

λͺ¨λ“  API ν˜ΈμΆœμ€ src/lib/api μ•„λž˜μ—μ„œ κ΄€λ¦¬ν•©λ‹ˆλ‹€.

File Responsibility
client.ts Fetch wrapper & error handling
mappers.ts snake_case ↔ camelCase mapping
labels.ts Enum/code β†’ Display label mapping
types.ts Request & Response types

이 ꡬ쑰λ₯Ό 톡해 화면은 API κ΅¬ν˜„ 세뢀사항과 λΆ„λ¦¬λ˜μ–΄ 있으며, λ°±μ—”λ“œ 응닡 ν˜•μ‹μ΄ λ³€κ²½λ˜λ”λΌλ„ UI λ³€κ²½ λ²”μœ„λ₯Ό μ΅œμ†Œν™”ν•  수 μžˆμŠ΅λ‹ˆλ‹€.


πŸ§ͺ Testing

Vitestλ₯Ό μ‚¬μš©ν•˜μ—¬ 순수 ν•¨μˆ˜ μ€‘μ‹¬μ˜ μœ λ‹› ν…ŒμŠ€νŠΈλ₯Ό μˆ˜ν–‰ν•©λ‹ˆλ‹€.

npm run test

ν˜„μž¬ ν…ŒμŠ€νŠΈ λŒ€μƒ

  • API Mapping
  • Risk Aggregation
  • Formatting Utilities

UIλŠ” λ°±μ—”λ“œμ™€ μ—°λ™ν•˜μ—¬ μ‹€μ œ Wizard Flowλ₯Ό μ‹€ν–‰ν•˜λ©° κ²€μ¦ν•©λ‹ˆλ‹€.


πŸ“œ Available Scripts

Command Description
npm run dev Start development server
npm run build Production build
npm run start Start production server
npm run lint Run ESLint
npm run test Run Vitest

πŸ“„ License

Private project.

About

πŸ’± λ³΅μž‘ν•œ ν™˜λ¦¬μŠ€ν¬λ₯Ό 쉽고 λ˜‘λ˜‘ν•˜κ²Œ! 계약 정보 μž…λ ₯λΆ€ν„° AI ν™˜λ¦¬μŠ€ν¬ 진단 κ²°κ³Ό μ‹œκ°ν™”, 리슀크 μ„±ν–₯ 뢄석, λŒ€μ‘ μ „λž΅ 및 κΈˆμœ΅μƒν’ˆ μΆ”μ²œ, 상담 μ‹ μ²­κΉŒμ§€μ˜ 전체 μ‚¬μš©μž κ²½ν—˜μ„ μ œκ³΅ν•˜λŠ” μ›Ή μ• ν”Œλ¦¬μΌ€μ΄μ…˜, μ²­μ‹¬ν™˜ - ν”„λ‘ νŠΈμ—”λ“œ

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages