Simplified FSD (4-Layer) 기반 아키텍처 설계
Self 리뷰 완료 + IA-FINAL 통합
프로젝트 규모와 팀 상황에 맞춘 실용적 선택
entities/widgets 생략, app→pages→features→shared 4개 레이어만 사용. 20페이지 규모에 최적화.
페이지 내 구현 → 2+ 페이지 사용 시에만 features/ 추출. 과도한 추상화 방지.
기존 3개 IA 문서를 단일 IA-FINAL.md로 통합. 버전 분리 없이 페이지별 final 정리.
4개 레이어만 사용하여 복잡도를 낮추고, Self 피드백을 반영한 최종 구조
IA-FINAL 기반 8개 카테고리, TypeScript Props 정의 완료
| Component | Reusability | Usage | Key Props |
|---|---|---|---|
| MetricCard | HIGH | Dashboard, RAG, Embedding | label, value, change, icon, color, size |
| StatusBadge | HIGH | All Admin pages | status, label, animated, withIcon |
| DataTable | HIGH | Users, Excel, RAG | columns, data, selectable, stickyHeader |
| FilterPanel | MEDIUM-HIGH | Users, RAG, Excel | filters, values, onChange, collapsible |
| WidgetCard | MEDIUM-HIGH | Dashboard | title, icon, link, span |
| ChartCard | MEDIUM | Dashboard, RAG | title, tabs, legend, children |
| SummaryStats | MEDIUM-HIGH | RAG, Embedding | stats, direction, dividers |
| ActivityFeed | MEDIUM | Dashboard | items, maxItems, timeFormat |
| Pagination | HIGH | All list pages | currentPage, totalPages, onPageChange |
| Modal | HIGH | All pages | open, onClose, title, size, children |
Server State와 Client State를 명확히 분리, Token은 tokenService가 단일 소스
| State Type | Owner | Scope | Persistence |
|---|---|---|---|
| Server Data | TanStack Query | Request-scoped cache | Memory (staleTime/gcTime) |
| Auth Tokens | tokenService | App-scoped | localStorage (single source) |
| URL State | React Router | Route-scoped | URL params |
| Form State | React Hook Form | Component-scoped | None |
| UI State (cross) | Zustand | App-scoped | Memory only |
| UI State (local) | useState | Component-scoped | None |
Token Refresh Queue + ApiError 클래스로 견고한 에러 처리
401 발생 시 대기 큐 사용. 실패 시 큐 전체 reject + _retry 마커로 무한루프 방지
API 응답을 런타임에 검증하여 타입 안전성 확보. safeParse로 graceful 처리
6개 핸들러 그룹으로 백엔드 없이 개발. fixtures로 다양한 시나리오 테스트
| Handler Group | Endpoints | Features |
|---|---|---|
| auth.handlers | login, logout, refresh, me | Token management, session |
| chat.handlers | conversations, messages, feedback | SSE streaming simulation |
| admin-users.handlers | list, detail, update, delete, export | Pagination, filtering, bulk ops |
| admin-embedding.handlers | settings, status, jobs, rerun | Idempotency key, job queue |
| admin-rag.handlers | dashboard, questions, review, golden-set | Metrics, approval workflow |
| admin-excel.handlers | parsers, glossary, routines, history | Bulk operations, scheduling |
ROI 기반 단계별 구현 계획
MetricCard, StatusBadge, DataTable, FilterPanel, Modal, Pagination, Button, Input, Select, Toast
WidgetCard, SummaryStats, ChartCard, MessageBubble, ChatInput, FileUpload, DateRangePicker...
Domain-specific components, Charts, Advanced features...
app/providers, shared/api, shared/stores, shared/ui
Dashboard, Users List/Detail, layouts, navigation
Settings, Status, Jobs List/Detail
Dashboard, Questions, Review, Golden Set, Settings
Excel Admin (4), Chat UI (1)
7개 핵심 문서로 구성된 아키텍처 문서 세트
20페이지 통합 IA
72개 컴포넌트 집계
메인 설계 문서
Self 피드백 반영
72개 컴포넌트
TypeScript Props 정의
6개 핸들러 그룹
MSW + Fixtures
FSD 선택 근거
~350 lines
FSD 운영 가이드
~450 lines
이 문서
발표용 요약