Skip to content

Feature/resume upload - 이력서 레포 등록 및 분석 결과 조회 #27

Merged
i3months merged 6 commits into
devfrom
feature/sprint1-resume-upload
May 27, 2026
Merged

Feature/resume upload - 이력서 레포 등록 및 분석 결과 조회 #27
i3months merged 6 commits into
devfrom
feature/sprint1-resume-upload

Conversation

@i3months

@i3months i3months commented May 23, 2026

Copy link
Copy Markdown
Member

변경 사항

이 PR로 스프린트1에 대해서는 프론트 작업만 남습니다.
프론트는 코어서버만 봅니다 그러니 백엔드 Swagger 참고해서 작업 진행해주세요.

PR 머지 시 배포도 알아서 됩니다.

i3months added 5 commits May 23, 2026 09:23
- POST /api/resumes (multipart) — 파일 검증 → S3(MinIO) PUT → DB row INSERT(PENDING)
  → ResumeUploadedEvent 발행
- GET /api/resumes — 사용자별 목록
- GET /api/resumes/{id} — 단건
- DELETE /api/resumes/{id} — soft delete

도메인 간 결합 분리:
- resume → document 직접 호출 대신 ResumeUploadedEvent(record) 발행
- document.application.ResumeAnalysisEventListener 가 받아 AnalysisRequestService 호출
  → 기존 AFTER_COMMIT 분기로 analyze.resume RabbitMQ 발행 흐름 재사용
- ArchUnit top_level_domain_slices_are_free_of_cycles 통과 (document → resume 단방향 유지)

SSE:
- AnalysisCallbackService 가 publishToDocument 에 더해 publishToUser 도 호출
  → 프론트가 documentId 사전 인지 없이 /api/stream/me 로 분석 완료/실패 수신 가능
## github 도메인 — 레포 등록 진입점
- POST /api/repositories — 후보 중 선택 등록. GitHub API 로 메타 재확인 후 INSERT.
  중복(REPO_ALREADY_REGISTERED), 미존재(REPO_NOT_FOUND), 비공개 접근불가(REPO_PRIVATE_NO_ACCESS) 분기.
- GET /api/repositories — 등록된 레포 목록
- GET /api/repositories/github?page=&perPage= — GitHub 의 사용자 레포 후보 페이지 (alreadyRegistered 플래그)
- GET /api/repositories/{id} — 단건
- DELETE /api/repositories/{id} — soft delete

추가 인프라:
- GithubApiHttpClient.getRepository, listUserRepositories (RestClient HttpExchange)
- GithubApiClient: 위 두 메서드 + 4xx 상세 분기 (404 → REPO_NOT_FOUND, 403 → REPO_PRIVATE_NO_ACCESS)
- GithubRepository.create 정적 팩토리
- GithubRepositoryRepository: findByUser_IdAndGithubRepoIdAndDeletedFalse,
  findByUser_IdAndGithubRepoIdInAndDeletedFalse (후보 목록의 alreadyRegistered 계산용)
- application/event/RepositoryRegisteredEvent + document/application/RepositoryAnalysisEventListener
  → resume 와 동일한 이벤트 디커플 패턴 (github → document 직접 의존 회피)

## document 도메인 — US-12 결과 조회
- GET /api/documents — 사용자 보유 전체 (filter: resumeId | repositoryId 옵션)
- GET /api/documents/{id} — 상세 + presigned S3 다운로드 URL (10분 TTL)
- AnalyzedDocumentQueryService: tech_stack JSON → List<String> 역직렬화
- AnalyzedDocumentRepository: JPQL 4개 추가 — findActive{ByOwner,ByIdAndOwner,
  ByResumeIdAndOwner,ByRepositoryIdAndOwner} (deleted=false + owner 검증 단일 쿼리)

빌드/테스트: ./gradlew test BUILD SUCCESSFUL (ArchUnit 포함)
브라우저 EventSource 가 Authorization 헤더를 못 보내는 한계 해소.

- StreamTokenAuthenticationFilter: /api/stream/** 경로 한정으로 ?token=
  query parameter 를 StreamTokenProvider 로 검증 (scope=SSE_CONNECT 강제)
- SecurityConfig: 위 필터를 JwtAuthenticationFilter 앞에 등록
- 일반 경로는 그대로 통과 → Authorization 헤더 경로(JWT) 영향 없음

흐름:
1. 프론트가 POST /api/auth/stream-token (JWT 헤더) → STREAM 토큰 발급
2. new EventSource("/api/stream/me?token={STREAM}")
3. 필터가 query token 검증 → UserPrincipal 주입 → SSE 통과
@vercel

vercel Bot commented May 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stackup Ready Ready Preview, Comment May 23, 2026 4:46am

…ealthy/secrets 보강

dev 푸시 시 backend 도 함께 자동 빌드·재시작.

## docker-compose.yml
- backend 서비스 정식 추가 (build context ./backend, port 38010, depends_on postgres/rabbitmq/minio healthy)
- 환경변수 ${VAR:-default} 패턴 — 비밀값은 .env / GitHub Secrets 로 주입, 미설정 시 application-local.yml 의 dev default 적용
- healthcheck: curl /actuator/health (보강된 Dockerfile 의 curl 사용)
- AI 의 CORE_INTERNAL_BASE_URL 기본값을 http://host.docker.internal:38010 → http://backend:38010 으로 변경 (같은 compose 네트워크)

## backend/Dockerfile
- eclipse-temurin:21-jre-jammy 에 curl 설치 — compose healthcheck 용

## .github/workflows/deploy-app.yml
- paths 트리거에 backend/** 추가
- timeout 20m → 30m (Spring 부팅 시간 여유)
- Secrets 다중 주입: JWT_SECRET, ENCRYPTION_KEY, CORE_INTERNAL_API_KEY, GH_OAUTH_CLIENT_ID/SECRET
  (LLM_API_KEY 기존 패턴을 upsert_env 헬퍼로 일반화. 값 비면 skip → .env 기존 값 유지)
- docker compose up -d --build 에 backend 포함
- healthy 대기 루프에 backend 추가
- 5/22 임시 docker-compose.override.yml 명시 제거 (backend 가 정식 compose 로 들어와 불필요)

## .env.example
- backend 비밀값 dev 기본값 명시 (JWT_SECRET, ENCRYPTION_KEY, CORE_INTERNAL_API_KEY)
  → 운영은 반드시 GitHub Secrets 로 덮어쓸 것을 주석으로 안내

## 필요한 GitHub Secrets (Settings → Secrets and variables → Actions)
필수가 아닌, 운영에서 dev default 를 교체하고 싶을 때만 설정:
- JWT_SECRET, ENCRYPTION_KEY, CORE_INTERNAL_API_KEY (모두 base64)
- LLM_API_KEY
- GH_OAUTH_CLIENT_ID, GH_OAUTH_CLIENT_SECRET
@i3months i3months merged commit 236ce7a into dev May 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant