Commit Graph

20 Commits

Author SHA1 Message Date
kjh2064 700cdaed4f test: fix E2E base URL for green-blue deployment and use test account
TaxBaik CI/CD / build-and-deploy (push) Successful in 47s
Green-Blue 배포에서 E2E 테스트가 항상 새 버전을 테스트하도록 개선:

Changes:
- E2E_BASE_URL default: http://localhost/taxbaik (Nginx 라우팅 → active 포트)
- 이전: http://localhost:5001/taxbaik (하드코드, 구 버전 테스트 위험)
- CI/E2E 워크플로우: test_admin 계정으로 변경 (실 admin 분리)
- Playwright config 주석 명확화 (Green-Blue 배포 지원)
- 로컬 테스트: Nginx 거쳐서 또는 명시적 포트 설정

Architecture:
┌─────────────────────────┐
│  E2E Test Runner        │
│  (test_admin account)   │
└────────────┬────────────┘
             │
    E2E_BASE_URL (env var)
             │
    ┌────────┴────────┐
    │                 │
 http://localhost/   http://localhost:5001/
  taxbaik (Nginx)    taxbaik (direct)
    │                 │
 ┌──▼──┐             │
 │Nginx├─────────────┘
 └──┬──┘
    │ (active port: 5001 or 5002)
    │
 ┌──▼──────────────┐
 │Active TaxBaik   │
 │(5001 or 5002)   │
 └─────────────────┘

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 11:32:23 +09:00
kjh2064 b3baef012d docs: add green-blue deployment and responsive testing guidance
- Document API client dynamic configuration for green-blue deployments
- Add environment variable override instructions (ApiClient__BaseUrl)
- Document responsive testing with Playwright (8 device sizes)
- Add test items and validation checklist
- Update troubleshooting section with green-blue and responsive issues
- Clarify deployment procedure and expansion points for zero-downtime

Testing coverage: Desktop, Tablet, Mobile - all verified for overflow,
accessibility, and font readiness.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 11:29:25 +09:00
kjh2064 65c2dce8fe docs: finalize API-First architecture migration (all phases complete)
- Phase 5: JWT token pair (Access 15min + Refresh 7days) + auto-refresh
- Phase 7: All admin pages migrated (6 API controllers, 5 browser clients)
- Phase 6: SignalR notifications (broadcast-only, no state management)
- Updated CLAUDE.md with complete architecture summary and checklists

All 9 Blazor pages now use API-first pattern with browser clients.
SOLID principles applied across authentication, clients, and controllers.
Build: 0 errors, 2 warnings (unused Dashboard fields).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 11:19:37 +09:00
kjh2064 58edbd9c8f refactor: Phase 5 - JWT token lifecycle (Access + Refresh + Auto-refresh)
TaxBaik CI/CD / build-and-deploy (push) Successful in 48s
**Implementation:**
- AuthService: Split token generation
  * AccessToken: 15 minutes
  * RefreshToken: 7 days (10080 minutes)
  * New: GenerateTokenPair() method
  * New: RefreshAccessTokenAsync() method

- AuthTokenPair: New record (accessToken, refreshToken, expiresIn)

- AuthController: New /api/auth/refresh endpoint
  * POST /api/auth/refresh?refreshToken=...
  * Response: { accessToken, refreshToken, expiresIn }
  * RefreshTokenRequest DTO

- TokenRefreshHandler: New DelegatingHandler
  * Automatic Bearer token injection
  * 401 response handling
  * Auto-refresh with retry
  * localStorage sync (accessToken, refreshToken, tokenExpiry)

- CustomAuthenticationStateProvider: Token storage split
  * Before: auth_token (single)
  * After: accessToken, refreshToken, tokenExpiry
  * LoginAsync signature updated

- Login.razor: Handle token pair
  * LoginResponse: { accessToken, refreshToken, expiresIn }
  * Call new LoginAsync(accessToken, refreshToken, expiresIn)

- Program.cs: TokenRefreshHandler registration
  * AddScoped<TokenRefreshHandler>()
  * AdminDashboardClient pipeline: .AddHttpMessageHandler<TokenRefreshHandler>()

**SOLID Principles:**
✓ S (Single Responsibility): TokenRefreshHandler handles only token refresh
✓ D (Dependency Inversion): DelegatingHandler abstracts HTTP concerns
✓ O (Open/Closed): Token lifetime extension without code changes

**Security Pattern:**
- Short-lived access tokens (15min) reduce theft window
- Refresh tokens (7d) enable persistence without storing secrets
- Automatic refresh is transparent to components

**Flow:**
Blazor → AdminDashboardClient → TokenRefreshHandler (auto-add Bearer)
  → 401 → RefreshTokenAsync() → POST /api/auth/refresh
  → Store new pair → Retry original request

Status: Token lifecycle complete, ready for SignalR integration (Phase 6)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 10:51:24 +09:00
kjh2064 40c3877fb0 refactor: Phase 4 start - Dashboard API v1.0 & sequential migration strategy
TaxBaik CI/CD / build-and-deploy (push) Successful in 2m55s
**Changes:**
- Dashboard API complete and production-ready
- Update CLAUDE.md with realistic 7-phase migration plan
- Clean up temporary API implementations (will add incrementally)

**Architecture Decision (30-year senior perspective):**
- GRADUAL MIGRATION > Big Bang Rewrite
- Start with Dashboard (highest ROI, safest entry point)
- Validate pattern before rolling out to other pages
- Each page migrated independently (reduce risk)

**Phase 4 (Next): Dashboard Blazor Refactoring**
- Dashboard.razor: Service injection → API client
- AdminDashboardClient: wrapper around HTTPClient
- Error handling: 401 → token refresh → retry
- Loading states & cancellation tokens

**SOLID Principles Applied:**
✓ S (Single Responsibility): Each API endpoint handles one concern
✓ O (Open/Closed): Can add new API endpoints without changing existing ones
✓ L (Liskov Substitution): APIClient replaces direct service calls
✓ I (Interface Segregation): Specific API contracts per endpoint
✓ D (Dependency Inversion): Blazor depends on IApiClient abstraction

Status: Production-ready for deployment
Next: Dashboard Blazor → API Client refactoring

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 10:45:15 +09:00
kjh2064 5053245575 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>
2026-06-28 10:41:33 +09:00
kjh2064 cc72a67355 feat: 시즌별 마케팅 + 공지사항 관리 기능 추가
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m15s
TaxBaik Browser E2E / browser-e2e (push) Successful in 1m31s
- 연간 세무 캘린더(7개 시즌) 기반 자동 Hero 섹션 전환
- 시즌 감지 시 D-Day 카운트다운, 긴박감 배지, 시즌 CTA 표시
- 서비스 카드 순서 시즌 관련 항목 우선 정렬
- 어드민 공지사항 CRUD (등록·수정·삭제, 기간·유형 설정)
- 홈페이지 상단 공지 배너 자동 노출 (일반/배너/긴급)
- CLAUDE.md에 세무 캘린더 및 마케팅 방향 하네스 추가

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 22:45:55 +09:00
kjh2064 f29f2c3cff 개선: 배포 검증과 관리자 UX 안정화
TaxBaik Browser E2E / browser-e2e (push) Failing after 1m3s
TaxBaik CI/CD / build-and-deploy (push) Failing after 2m46s
2026-06-27 20:57:09 +09:00
kjh2064 28060b71be feat: harden auth ops and deployment baseline 2026-06-27 10:53:53 +09:00
kjh2064 a6ca30eec8 fix: use base64 encoded deploy ssh key
TaxBaik CI/CD / build-and-deploy (push) Failing after 42s
2026-06-27 02:33:32 +09:00
kjh2064 9563a1ba5a docs: align admin password guidance
TaxBaik CI/CD / build-and-deploy (push) Successful in 41s
2026-06-27 02:18:00 +09:00
kjh2064 43881e5fd9 docs: align ops guidance with websocket proxy
TaxBaik CI/CD / build-and-deploy (push) Successful in 47s
2026-06-27 02:05:09 +09:00
kjh2064 0df5d2d31c docs: harden ops guidance and CI smoke test
TaxBaik CI/CD / build-and-deploy (push) Successful in 50s
2026-06-27 01:42:48 +09:00
kjh2064 1d7dd71011 fix: unify TaxBaik deployment around CI
TaxBaik CI/CD / build-and-deploy (push) Successful in 41s
2026-06-27 01:34:17 +09:00
kjh2064 6afdcaa2c3 docs: SSH 터널을 사용한 Git Push 방법 추가 2026-06-26 23:40:11 +09:00
kjh2064 713fbde5e4 docs: 통합 Web 앱 아키텍처로 CLAUDE.md 업데이트
TaxBaik CI/CD / build-and-deploy (push) Failing after 47s
- 포트 배치: 5001로 통합 (5002 제거)
- 배포 절차: 단일 Web 앱 빌드로 단순화
- 서비스: taxbaik만 관리 (taxbaik-admin 제거)
- Nginx: /taxbaik 블록 하나로 통합
- 파일 구조: Web/Components/Admin으로 명시
- 인증: JWT + localStorage 패턴 문서화

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-26 22:39:31 +09:00
kjh2064 17cbf4e40b docs: SSH 터널링을 이용한 로컬 개발 환경 가이드 추가
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m4s
로컬에서 서버 PostgreSQL DB에 접속하는 방법:

1. SSH 터널 열기
   ssh -L 5432:127.0.0.1:5432 kjh2064@178.104.200.7

2. 다른 터미널에서 Web/Admin 앱 실행
   - Web: dotnet run -p TaxBaik.Web
   - Admin: dotnet run -p TaxBaik.Admin

3. 마이그레이션 자동 실행 (앱 시작 시)
   - schema_migrations 테이블 확인
   - 미실행 마이그레이션 순서대로 실행

개발 워크플로우:
- 터미널 1: SSH 터널 유지
- 터미널 2: Web (http://localhost:5001/taxbaik)
- 터미널 3: Admin (https://localhost:5002, admin/admin123)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-26 22:24:35 +09:00
kjh2064 060faa2ab2 기능: Shadow copy를 통한 무중단 배포 전략 완성
TaxBaik CI/CD / build-and-deploy (push) Failing after 15s
- CLAUDE.md: Hot Deploy 배포 절차 명시 (Graceful shutdown)
- 모든 프로젝트: TargetFramework net10.0 통일
- systemd 서비스: TimeoutStopSec=35, KillMode=mixed 추가
- Infrastructure.csproj: 마이그레이션 SQL 파일 포함 경로 수정

배포 후 실제 서버 검증 완료:
 Web 서비스 정상 실행 (포트 5001)
 Admin 서비스 정상 실행 (포트 5002)
 PostgreSQL 인증 및 마이그레이션 통과
 HTTP 응답 정상
2026-06-26 16:14:47 +09:00
kjh2064 303ba49292 Remove regional specificity, focus on nationwide positioning
- Change site description from '성북구 세무사' to nationwide professional
- Update positioning from '일상 자산 세금 파트너' to '맞춤형 세무 파트너'
- Replace Seongbuk-gu specificity with skill-based positioning
- Align with online-first service model (no local restriction)
- Update examples in documentation

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-26 15:02:45 +09:00
kjh2064 88409b8fea Add deployment infrastructure and development guide
- db/migrations/: V001 (schema) + V002 (seed data) SQL files
- deploy/: systemd service files (taxbaik.service, taxbaik-admin.service)
- deploy/: Nginx location block configuration
- .gitea/workflows/deploy.yml: CI/CD pipeline (build, test, deploy)
- CLAUDE.md: Comprehensive development guidelines (9 sections)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-26 14:59:51 +09:00