Skip to content

feat: setup backend foundation and archive extractor - #1

Merged
seonghobae merged 7 commits into
masterfrom
feature/backend-setup
Apr 27, 2026
Merged

feat: setup backend foundation and archive extractor#1
seonghobae merged 7 commits into
masterfrom
feature/backend-setup

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Summary

  • Setup FastAPI backend foundation
  • Implement zip archive extractor for email backups with security measures (zip bomb protection, path traversal checks)
  • Add tests and address code review feedback

Test Plan

  • Tested manually using pytest
  • Verified edge cases and security protections

@coderabbitai

coderabbitai Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Summary by CodeRabbit

릴리즈 노트

  • New Features

    • AI Email Client 백엔드 API 서버 추가
    • 아카이브 추출 기능 구현 (파일 개수 및 크기 제한 포함)
    • CORS 설정을 통한 클라이언트 통신 지원
  • Chores

    • 백엔드 의존성 라이브러리 추가
    • 버전 관리 설정 업데이트
  • Tests

    • 백엔드 API 및 아카이브 기능 테스트 스위트 추가

Walkthrough

새로운 FastAPI 기반 AI 이메일 클라이언트 API 백엔드가 추가되었습니다. ZIP 아카이브 추출 기능과 파일 개수 및 크기 제한 안전장치, 예외 처리, 그리고 포괄적인 테스트 커버리지가 포함되어 있습니다.

Changes

Cohort / File(s) Summary
Project Setup
.gitignore, backend/requirements.txt
.gitignoresecret_fixtures/ 디렉토리 추가. fastapi, uvicorn, pytest, httpx 의존성을 requirements.txt에 명시.
FastAPI Application
backend/main.py
http://localhost:3000에서의 CORS 요청을 수락하도록 설정된 FastAPI 애플리케이션 생성. 상태 메시지를 반환하는 루트 GET / 엔드포인트 제공.
Archive Service
backend/services/archive.py, backend/services/exceptions.py
ZIP 아카이브 추출 기능 구현. 파일 개수 및 누적 크기 제한 적용, 경로 이동 공격 방지, 동기/비동기 API 모두 지원. 아카이브 관련 예외 클래스 4개 정의 (ArchiveError, InvalidArchiveError, ArchiveSizeExceededError, ArchiveFileCountExceededError).
Tests
backend/tests/test_archive.py, backend/tests/test_main.py
아카이브 추출 로직 검증 (정상 동작, 예외 처리, 경로 이동 방지 등) 및 루트 엔드포인트 HTTP 200 응답 확인.

Sequence Diagram(s)

sequenceDiagram
    actor Client
    participant API as FastAPI<br/>Server
    participant Archive as Archive<br/>Service
    participant FS as File<br/>System

    Client->>API: POST /extract (zip_path, output_dir)
    activate API
    API->>Archive: extract_backup(zip_path, output_dir)
    activate Archive
    
    Archive->>FS: Open zip file
    activate FS
    FS-->>Archive: ZipFile object
    deactivate FS
    
    Archive->>FS: Validate output directory
    activate FS
    FS-->>Archive: Directory confirmed
    deactivate FS
    
    loop For each entry in archive
        Archive->>Archive: Sanitize filename<br/>(remove traversal)
        Archive->>Archive: Check size/count limits
        Archive->>FS: Extract file
        activate FS
        FS-->>Archive: File written
        deactivate FS
    end
    
    Archive-->>API: list[Path] of extracted files
    deactivate Archive
    
    API-->>Client: JSON response with<br/>extracted file paths
    deactivate API
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Poem

🐰 한 마리 토끼가 방금 도착한 이메일 클라이언트에 환호하네,

ZIP 파일을 안전하게 풀고 경로를 지켜내며,

FastAPI의 빠른 움직임과 테스트의 든든함으로,

백엔드의 새로운 세계가 열렸구나! ✨


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Docstring Coverage ❌ Error Docstring coverage is 18.18% which is insufficient. The required threshold is 100.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title clearly summarizes the main changes: setting up FastAPI backend foundation and implementing an archive extractor, which aligns with the primary objectives of the changeset.
Description check ✅ Passed The pull request description directly relates to the changeset by describing the FastAPI setup, zip archive extractor implementation with security measures, and testing approach mentioned in the changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/backend-setup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@seonghobae
seonghobae merged commit 8055796 into master Apr 27, 2026
1 check was pending
@seonghobae
seonghobae deleted the feature/backend-setup branch April 28, 2026 01:43
This was referenced Jul 8, 2026
seonghobae added a commit that referenced this pull request Jul 11, 2026
Merge latest develop into the Project #1 product-planning spec and land with current-head checks green.
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