Feature/resume upload - 이력서 레포 등록 및 분석 결과 조회 #27
Merged
Conversation
- 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 통과
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경 사항
이 PR로 스프린트1에 대해서는 프론트 작업만 남습니다.
프론트는 코어서버만 봅니다 그러니 백엔드 Swagger 참고해서 작업 진행해주세요.
PR 머지 시 배포도 알아서 됩니다.