# CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## Project Overview **QuantEngine v0.1** β€” A comprehensive quantitative analysis and data collection system for retirement asset portfolio management. - **Architecture**: .NET 9 + C# (web UI + APIs), Python (legacy data collection/analysis) - **Web UI**: Blazor Interactive WebAssembly (MudBlazor) + ASP.NET Core Web API (API-First) - **Database**: PostgreSQL (Npgsql 8.0), single unified database - **Data Source**: KIS Open API (quotations/ranking read-only), with fallbacks - **Key Runtimes**: .NET 9, Python 3.9+, Node.js 16+ ### Migration Phases Status (2026-06-29) **Phase 1: Web UI Migration** πŸ”„ μ •μ±… μ „ν™˜ (2026-06-30) - **μ‹ κ·œ ν‘œμ€€**: Blazor **Interactive WebAssembly** λ Œλ” λͺ¨λ“œ + **MudBlazor** μ»΄ν¬λ„ŒνŠΈ + API-First - **이전 ν‘œμ€€(폐기)**: Fluent UI Blazor v5 / InteractiveServer λ Œλ” λͺ¨λ“œλŠ” 더 이상 μ‚¬μš©ν•˜μ§€ μ•ŠμŒ - Pages: Home, Workspace, Collection, Tables, MainLayout - μ½”λ“œ μ „ν™˜ μž‘μ—…μ€ `docs/WBS_10_DOTNET_MIGRATION_HARDENING_2026_06_30.md` 의 **WBS-A7** 둜 좔적 **Phase 2: KIS Data Collection Pipeline** βœ… 95% COMPLETE - βœ… KIS API Client: Full implementation complete - IKisApiClient interface (5 quotation methods) - KisApiClient with real HTTP implementation + token caching - All governance rules enforced (no trading APIs) - Windows env var + registry fallback for credentials - Build: 0 errors, 0 warnings - βœ… PostgreSQL Infrastructure: Complete - PostgresTokenCache (token management, 10-min skew) - CollectionRepository (full CRUD + dashboard aggregations) - Auto-creates kis_tokens, kis_collection_runs, kis_collection_snapshots, kis_collection_errors - Dapper ORM + parameterized SQL (injection-proof) - βœ… Web API Endpoints: Complete - CollectionEndpoints (6 endpoints: state, runs, snapshots, errors, latest, start) - ApiClient for Blazor consumption - βœ… Blazor UI: Complete - Collection.razor dashboard with real-time monitoring - Summary cards, recent errors table, runs history - Start/refresh functionality - FluentSkeleton loading states - πŸ”„ Pipeline Orchestration: Pending - Python `kis_data_collection_v1.py` β†’ .NET (data fetching + validation) - Real KIS API data collection workflow integration - E2E test: API β†’ DB β†’ UI validation **Phase 3: Node.jsβ†’.NET CLI Tools** πŸ“‹ PLANNED - Makefile created (npm β†’ make mappings) - np operations documented **Status Summary**: - Python codebase: Operational (1,140 files) - .NET 9 coverage: Core (βœ…), Infrastructure (βœ…), API (βœ…), Web UI (βœ…) - Database: PostgreSQL fully migrated - Release gates: Python gates remain authority until Phase 2 integration testing complete ## Deployment & Operations **Production Server**: Hetzner Cloud `178.104.200.7` (kjh2064@178.104.200.7) Projects on server: 1. **TaxBaik** (ν™ˆνŽ˜μ΄μ§€) β€” Nginx location `/taxbaik` 2. **QuantEngine** (데이터 μˆ˜μ§‘/뢄석) β€” Nginx location `/quantengine` See [Temp/DEPLOYMENT_GUIDE.md](Temp/DEPLOYMENT_GUIDE.md) for deployment procedures. ### Quick Deploy (QuantEngine) ```powershell ssh kjh2064@178.104.200.7 systemctl status quantengine-api journalctl -u quantengine-api -f sudo systemctl restart quantengine-api ``` ### Git Repository **Gitea Server** (동일 호슀트): - **HTTP**: `http://178.104.200.7/kjh2064/QuantEngineByItz.git` - **SSH**: `git@178.104.200.7:2222/...` ## UI Design Principles (2026-06-29) ### Framework & Design System - **Primary Framework**: [MudBlazor](https://mudblazor.com/) - **Design System**: Material Design (MudBlazor), 고밀도/λŒ€λŸ‰ 데이터 μ„±λŠ₯ μš°μ„  - **Render Mode**: **Interactive WebAssembly** λ₯Ό κΈ°λ³Έ λ Œλ” λͺ¨λ“œλ‘œ ν•œλ‹€ (API-First). InteractiveServer λŠ” μ‚¬μš©ν•˜μ§€ μ•ŠλŠ”λ‹€. - **Deprecation**: **Fluent UI Blazor v5 λŠ” 폐기**ν•œλ‹€. κΈ°μ‘΄ Fluent UI νŽ˜μ΄μ§€λŠ” MudBlazor 둜 점진 μ΄μ „ν•œλ‹€. ### Component Development Rules 1. **All UI Development** (New + Refactored): - Use **MudBlazor** components exclusively - Fall back to pure HTML/CSS if MudBlazor doesn't provide - **Never introduce Fluent UI components** (deprecated) - Progressively migrate existing Fluent UI to MudBlazor - **API-First**: UI λŠ” DB/λΉ„μ¦ˆλ‹ˆμŠ€ λ‘œμ§μ— 직접 κ²°ν•©ν•˜μ§€ μ•Šκ³  μΆ”μƒν™”λœ API ν΄λΌμ΄μ–ΈνŠΈ(HTTP)둜만 톡신 (AGENTS.md Β§5b μ€€μˆ˜) 2. **Loading States** (Priority order): - `` β€” **Default** for lists, cards, dashboards, detail pages - Pure HTML `
` β€” For custom layouts - `` / `` β€” λͺ…μ‹œμ  μ§„ν–‰ ν‘œμ‹œκ°€ ν•„μš”ν•œ 경우 - Blocking spinners β€” **Avoid** 3. **Data Rendering Pattern**: - First render: Skeleton placeholders only - On data arrival: Replace skeleton with actual UI - Never show blank states while loading 4. **Component Mapping** (MudBlazor): | UI Element | MudBlazor Component | Alternative | |-----------|-------------------|-------------| | Button | `` | - | | Input field | `` | HTML `` | | Dropdown | `` | HTML `