중국(1688/타오바오) 소싱 → 마진 분석 → 쿠팡 리스팅 자동화 시스템
이 플랫폼은 중국 도매 플랫폼(1688, 타오바오)에서 상품을 소싱하여 마진을 자동 분석하고, 수익성 있는 상품을 쿠팡에 자동으로 리스팅하는 엔드투엔드 자동화 시스템입니다.
- 소싱 자동화: 1688/타오바오 상품 검색 및 데이터 수집
- 마진 분석: 쿠팡 수수료/배송비/관세 고려한 수익성 자동 계산
- 리스팅 자동화: 한국어 번역, 이미지 처리, 쿠팡 상품 등록
- 주문 모니터링: 실시간 주문 알림(텔레그램/슬랙) 및 일별/주간 리포트
- 이상 감지: 비정상 주문 패턴 감지 및 즉시 알림
- Backend: FastAPI, Python 3.11+
- Task Queue: Celery + Redis
- Database: PostgreSQL + SQLAlchemy (Alembic 마이그레이션)
- Infrastructure: Docker + Docker Compose
- Python 3.11+
- Docker & Docker Compose
- PostgreSQL 15+
- Redis 7+
git clone https://github.com/ivelly42/coupang-sourcing-platform.git
cd coupang-sourcing-platformcp sourcing_platform/.env.example sourcing_platform/.env
# .env 파일을 열어 필요한 값 입력python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e "sourcing_platform[dev]"pip install pre-commit
pre-commit installcd sourcing_platform
docker-compose up -d서비스 구성:
- PostgreSQL (포트 5432)
- Redis (포트 6379)
- API 서버 (포트 8000)
- Celery Worker (백그라운드)
- DB 마이그레이션 (자동 실행)
# 1. 인프라 시작
cd sourcing_platform
docker-compose up -d postgres redis
# 2. DB 마이그레이션 실행
alembic upgrade head
# 3. API 서버 실행
uvicorn main:app --reload --host 0.0.0.0 --port 8000
# 4. Celery Worker 실행 (별도 터미널)
celery -A core.celery_app worker --loglevel=info서버 실행 후 아래 URL에서 확인:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
| 모듈 | 엔드포인트 | 설명 |
|---|---|---|
| 소싱 | POST /api/v1/sourcing/search |
1688 상품 검색 |
| 소싱 | POST /api/v1/sourcing/extract |
상품 상세 수집 |
| 마진 | POST /api/v1/margin/calculate |
마진 계산 |
| 마진 | GET /api/v1/margin/profitable |
수익성 상품 목록 |
| 리스팅 | POST /api/v1/listing/create |
쿠팡 상품 등록 |
| 리스팅 | GET /api/v1/listing/status/{id} |
등록 상태 확인 |
| 주문 | GET /api/v1/orders |
주문 목록 |
| 주문 | POST /api/v1/orders/sync |
주문 동기화 |
cd sourcing_platform
pytest tests/ -v
# 커버리지 포함
pytest tests/ -v --cov=. --cov-report=htmlsourcing_platform/
├── api/ # FastAPI 라우터
│ └── v1/
├── core/ # 설정, Celery, 로깅
├── db/ # 모델, 마이그레이션
│ └── migrations/
│ └── versions/
├── sourcing/ # 소싱 모듈
├── margin/ # 마진 분석 모듈
├── listing/ # 쿠팡 리스팅 모듈
├── orders/ # 주문 모니터링 모듈
├── tests/ # 테스트
├── scripts/ # 유틸리티 스크립트
├── main.py # 앱 진입점
├── docker-compose.yml
├── Dockerfile
└── pyproject.toml
주요 환경 변수 목록 (.env.example 참조):
| 변수 | 설명 | 예시 |
|---|---|---|
DATABASE_URL |
PostgreSQL 연결 URL | postgresql+asyncpg://... |
REDIS_URL |
Redis 연결 URL | redis://localhost:6379/0 |
COUPANG_ACCESS_KEY |
쿠팡 API 접근 키 | ... |
COUPANG_SECRET_KEY |
쿠팡 API 시크릿 키 | ... |
TELEGRAM_BOT_TOKEN |
텔레그램 봇 토큰 | ... |
SLACK_WEBHOOK_URL |
슬랙 웹훅 URL | https://hooks.slack.com/... |
MIT License