Frontend for μ²μ¬ν, an AI-powered FX risk diagnosis platform for small and medium-sized import/export businesses.
dongkk-frontendλ κ³μ½ μ 보 μ
λ ₯λΆν° ν리μ€ν¬ μ§λ¨, 리μ€ν¬ μ±ν₯ λΆμ, λμ μ λ΅ λ° κΈμ΅μν μΆμ², μλ΄ μ μ²κΉμ§μ μ 체 μ¬μ©μ κ²½νμ μ 곡νλ Next.js κΈ°λ° μΉ μ ν리μΌμ΄μ
μ
λλ€.
μ€μ νμ¨ μμΈ‘κ³Ό κΈμ΅μν κ²μμ AI μλΉμ€μμ μννλ©°, 리μ€ν¬ λΆμκ³Ό μ λ΅ μμ±μ λ°±μλμμ μ²λ¦¬ν©λλ€. μ΄ λ ν¬λ λΆμ κ²°κ³Όλ₯Ό μ¬μ©μκ° μ΄ν΄νκΈ° μ¬μ΄ ννλ‘ μκ°ννκ³ μνΈμμ©μ μ 곡ν©λλ€.
μ¬μ©μλ νλμ 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]
μλΉμ€λ μΈ κ°μ λ ν¬μ§ν λ¦¬λ‘ κ΅¬μ±λμ΄ μμΌλ©°, μ΄ λ ν¬λ μ¬μ©μμ μ§μ μνΈμμ©νλ νλ‘ νΈμλμ λλ€.
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
| 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.
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
| 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 |
npm installcp .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) |
npm run devnpm run build
npm run startsrc/
βββ 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
Wizard μνλ WizardProviderλ₯Ό ν΅ν΄ κ΄λ¦¬ν©λλ€.
κ΄λ¦¬λλ μ£Όμ λ°μ΄ν°λ λ€μκ³Ό κ°μ΅λλ€.
- Company information
- Contract information
- Risk assessment result
- Risk profile result
- Strategy recommendation
- Financial product recommendation
- Consultation request
μνλ React Contextμ μ μ₯λλ©° λ³λμ μμνλ νμ§ μμ΅λλ€. λ°λΌμ μλ‘κ³ μΉ¨νλ©΄ Wizardλ μ²μλΆν° λ€μ μμλ©λλ€.
λͺ¨λ 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 λ³κ²½ λ²μλ₯Ό μ΅μνν μ μμ΅λλ€.
Vitestλ₯Ό μ¬μ©νμ¬ μμ ν¨μ μ€μ¬μ μ λ ν μ€νΈλ₯Ό μνν©λλ€.
npm run testνμ¬ ν μ€νΈ λμ
- API Mapping
- Risk Aggregation
- Formatting Utilities
UIλ λ°±μλμ μ°λνμ¬ μ€μ Wizard Flowλ₯Ό μ€ννλ©° κ²μ¦ν©λλ€.
| 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 |
Private project.