daily report

Daily Work Report - 2026-01-15

Beauty Insight Editor

📅 Daily Work Report: K-Beauty Export Tracker Construction

🔑 Key Takeaways (핵심 요약)

  • AI 예측 엔진 탑재: Meta의 Prophet 모델을 백엔드에 성공적으로 이식하여, 단순 통계가 아닌 '계절성(Seasonality)'과 '외부 변수(거시경제)'를 반영한 수출 예측이 가능해졌습니다.
  • 데이터 파이프라인 확장: 관세청 무역통계(36개월) + FRED 거시경제 지표(환율, 심리지수) + 구글 트렌드 데이터를 통합하는 Multi-Source Data Loader를 구축했습니다.
  • UX 고도화: 예측 신뢰도(MAPE) 시각화, 투명한 모델 설명(How It Works), 그리고 사용자 관심 기반의 Trend Radar로 대시보드의 깊이를 더했습니다.

1. Executive Summary

Today, we successfully transitioned the K-Beauty Export Tracker from a data realization MVP to an AI-powered Analytic Dashboard. The most significant milestone was the end-to-end integration of the Prophet Forecasting Engine, enabling real-time future export predictions based on 3 years of historical data and macroeconomic indicators.

  • Milestone: Deployed /api/v1/predict and /api/v1/macro endpoints.
  • Key Feature: Implemented TrendsChart with visual forecasting confidence intervals and interactive "How It Works" documentation.
  • User Engagement: Upgraded TrendRadar to track and display real-time user interest patterns.

2. Technical Implementation

🛠 Backend (FastAPI + Python)

The backend was significantly refactored to support advanced analytics.

  • Forecasting Module (src/forecasting/):
    • engine.py: Integrated Prophet with yearly_seasonality=True and mcmc_samples=0 (for speed). Added regressor support for Exchange Rates and Search Trends.
    • data_loader.py: Implemented a robust recursive fetcher for Korea Customs API to guarantee 36 months of training data, handling API pagination and messy XML responses.
    • fred.py: Created a client for Federal Reserve Economic Data (FRED) to fetch DEXKOUS (KRW/USD) and UMCSENT (Consumer Sentiment).
  • API Router:
    • POST /predict: Accepts history + HS Code, returns 6-month forecast with MAPE metrics.
    • GET /macro: Exposes real-time economic indicators for the frontend.

💻 Frontend (Next.js 16 + TypeScript)

The frontend moved beyond simple data display to interactive storytelling.

  • TrendsChart.tsx:
    • Visual Distinction: Differentiated historical data (solid) from forecast (dashed) with a vertical "Forecasting Start" reference line.
    • Confidence Intervals: Visualized the 80% likely range using shaded Area charts (fillOpacity: 0.2).
    • Transparency: Added a modal explaining the model's logic (Seasonality + Drivers).
  • MacroIndicatorCard.tsx:
    • New component replacing static placeholders. Displays real-time sparklines for Exchange Rates and Sentiment.
  • TrendRadar.tsx:
    • Refactored to use useUserTracking hook. Now visualizes Top 5 user interests via a Horizontal Bar Chart with one-click filtering capability.
  • Data Integrity:
    • Updated korea-customs.ts to fetch 3 full years of data to match the backend's training requirements.

3. Troubleshooting Log

🔴 Critical Issues & Solutions

Error TypeRoot CauseSolution
405 Method Not AllowedUser accessed @router.post("/predict") via Browser Address Bar (which sends GET).Clarified usage: Endpoints must be consumed via Dashboard (Client) or Swagger UI (/docs).
Lint Error: Duplicate PropertycountryCode was defined twice in an object literal during a refactor.Removed the duplicate key in lib/api/korea-customs.ts via replace_file_content.
Import ErrorfetchMacroIndicators was not exported from lib/api/indicators.ts but imported in components.Added the missing export statement to the API library file.
Data InsufficiencyProphet required min 2 data points, but API occasionally returned sparse data for specific regions.Implemented a "Relaxed Checking" logic in TrendsChart and added a fallback to render available series even if one is missing.

4. Key Learnings & Decisions

  • Prophet on Windows: We encountered no major compilation issues today, but deploying to a Linux-based cloud (e.g., Render/Vercel) will require ensuring gcc and pystan compatibility.
  • Hybrid Data Fetching: We decided to fetch 36 months of data on the Frontend and pass it to the Backend for prediction (instead of Backend fetching everything).
    • Reason: Reliability. If the Backend fetch fails, the Frontend can still show historical data. The Backend augments the data with Forecasts only when asked.
  • UX Transparency: Users trust AI more when they understand "Why". Adding the "How It Works" modal directly on the chart significantly increases perceived reliability compared to a "Black Box" number.

Prepared by: Senior Engineering Lead, Beauty Inside Lab Inc.

Beauty Insight Editor

Sharing insights on K-Beauty trends and data-driven export strategies. We help brands expand globally with the power of AI.