feat: implement API-first architecture Phase 1 - Dashboard API

**Architecture Refactor (SOLID Principles):**
- Implement AdminDashboardController (REST API)
- Add dashboard summary endpoint
- Add upcoming filings endpoint
- Add recent inquiries endpoint
- Add monthly statistics endpoint

**Database Layer (Repository Pattern):**
- Extend IInquiryRepository with date range queries
- Implement CountByDateRangeAsync
- Implement CountByStatusAndDateAsync
- Extend InquiryRepository with new methods

**Service Layer (Single Responsibility):**
- Extend AdminDashboardService with API methods
- Add GetRecentInquiriesAsync
- Add GetMonthlyStatsAsync with caching

**Test Coverage:**
- Update FakeInquiryRepository mock with new methods

**SOLID Application:**
✓ Single Responsibility: Each class has one reason to change
✓ Open/Closed: Dashboard API can be extended without modifying existing code
✓ Dependency Inversion: Service depends on Repository abstraction
✓ Interface Segregation: API endpoints are focused and specific

Status: ✓ Compiles successfully (0 errors, 0 warnings)

Next phases:
- Add remaining API controllers (Announcement, Client, FAQ, TaxFiling)
- Refactor Blazor components to use API instead of services
- Implement JWT token refresh mechanism
- Add SignalR for change notifications

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-28 10:41:33 +09:00
parent 126643665a
commit 5053245575
20 changed files with 5307 additions and 1 deletions
+52
View File
@@ -1,5 +1,57 @@
# CLAUDE.md — TaxBaik 개발 지침
## 🏗️ **아키텍처 리팩토링 (API-First 전환)**
### 핵심 원칙 (2026년 적용)
```
❌ 이전: Blazor Server (서버 상태 관리)
Blazor → Service (서버) → DB
✅ 현재: API-First (클라이언트-서버 분리)
Blazor (UI만) ← API (모든 로직) ← DB
SignalR (변경 알림만)
```
### SOLID 기반 리팩토링 로드맵
#### Phase 1: API 엔드포인트 완성 (진행중)
- [x] Auth API (JWT 토큰)
- [x] Blog API (CRUD)
- [x] Category API
- [x] Inquiry API
- [x] SiteSettings API
- [ ] Dashboard API (⭐ 추가)
- [ ] Announcement API (⭐ 추가)
- [ ] Client API (⭐ 추가)
- [ ] FAQ API (⭐ 추가)
- [ ] TaxFiling API (⭐ 추가)
#### Phase 2: Blazor UI 리팩토링
- Blazor 컴포넌트 → API 호출 기반으로 변경
- 직접 서비스 inject 제거
- APIClient 개선 (재시도, 토큰 갱신)
- 로컬 상태 관리만 남김
#### Phase 3: JWT 토큰 개선
- Access Token (15분) + Refresh Token (7일) 구현
- 토큰 만료 시 자동 갱신
- 갱신 실패 시 로그인 페이지로 리다이렉트
#### Phase 4: SignalR 통합
- 변경 알림 Hub 추가 (브로드캐스트만)
- Blazor에서 알림 구독
- 알림 후 API로 최신 데이터 검증
#### Phase 5: 테스트 & 보안
- 단위 테스트 (Controller, Service)
- 통합 테스트 (API, DB)
- 아키텍처 테스트 (계층 분리 검증)
- 보안 테스트 (권한, 토큰)
#### 현재 진행: **Phase 1 완성 (부족한 API 추가)**
---
## 1. 프로젝트 개요
**클라이언트**: 백원숙 세무사 (세무사·부동산중개사·보험설계사 자격)