Skip to content

CobyApp/Card

Repository files navigation

Cutie Card

CUTIE STREET 토레카 분석기. 사진 한 장 업로드 → 멤버·시리즈 자동 식별 + 메르카리 시세.

🌐 Live: http://cobyserver.iptime.org:1024

스택

[ Next.js (web/) — App Router · Tailwind · TS, output: 'export' ]
                    ↓ static build (web/out)
[ FastAPI (api/) — Python ] ── 정적 + API 모두 serve, port 1024
                    ↓
[ core/ — CLIP 임베더 · 매처 · Mercari 스크래퍼 · catalog ]

로컬 실행

make        # 의존성 + Next 빌드 + master DB + uvicorn 1024

또는 분리 실행 (개발용):

make dev    # 안내 출력
# 터미널 1: uv run uvicorn api.main:app --reload --port 8000
# 터미널 2: cd web && NEXT_PUBLIC_API_BASE=http://localhost:8000 npm run dev
# → http://localhost:3000

사용 흐름

  1. UPLOAD — 카드 사진 끌어다 놓기 또는 탭
  2. MEMBER — 8명 중 선택 (한글 + 일본어, 모르겠어 가능)
  3. SERIES — 정규 / 의상 / 이벤트 탭에서 선택 (모르겠어 가능)
  4. RESULT — Top3 후보 + 메르카리 sold 시세 + 공식·Mercari 참고 링크

마스터 DB

uv run python scripts/build_master.py                 # 전체 시리즈
uv run python scripts/build_master.py --sku CS-0170   # 특정 시리즈만
uv run python scripts/build_master.py --samples 5     # 멤버당 샘플 수

자동 배포

GitHub Actions 워크플로우 두 개:

워크플로우 트리거 소요 하는 일
Deploy code git push origin main (자동) 23분 rsync + uv sync + npm install + next build + systemctl restart
Rebuild master DB 수동 (workflow_dispatch) 15~45분 Mercari 152회 스크래핑 + CLIP 임베딩 + 서비스 재시작

GitHub Secrets

레포 → Settings → Secrets and variables → Actions

Name Value
SSH_HOST cobyserver.iptime.org
SSH_USER coby
SSH_PRIVATE_KEY private key 전문
SSH_PORT (선택) 비표준 SSH 포트만
HF_TOKEN (선택) HuggingFace 토큰

서버 1회 셋업 (sudo 필요)

ssh coby@cobyserver.iptime.org

# Python deps + playwright system libs
sudo apt update && sudo apt install -y \
  libnss3 libnspr4 libatk-bridge2.0-0 libdrm2 libxkbcommon0 \
  libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 \
  libpango-1.0-0 libcairo2 libasound2 libatspi2.0-0

# Node.js (Next.js 빌드용)
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt install -y nodejs

# systemd linger (부팅 후 자동 시작)
sudo loginctl enable-linger coby

라우터 포트포워딩

iptime 관리페이지 → 외부 1024 → 내부 서버 IP : 1024

운영 명령 (서버)

systemctl --user status cutie-card
systemctl --user restart cutie-card
journalctl --user -u cutie-card -f

디렉터리

Card/
├── api/                 # FastAPI 백엔드 (core/ 래핑)
│   └── main.py          # /api/* 엔드포인트 + 정적 빌드 serve
├── web/                 # Next.js 프론트
│   ├── app/             # App Router 페이지
│   ├── components/      # 컴포넌트 + steps/
│   ├── lib/api.ts       # API 클라이언트
│   ├── tailwind.config.ts
│   └── next.config.mjs  # output: 'export'
├── core/                # Python 도메인 (UI 독립)
│   ├── models.py        # dataclass
│   ├── members.py       # 8멤버
│   ├── series_seed.py   # 시리즈 카탈로그
│   ├── catalog.py       # 로드/저장/필터
│   ├── embedder.py      # CLIP ViT-B/32 quickgelu
│   ├── matcher.py       # 코사인 Top-K
│   ├── crawler.py       # ASOBIMALL/Mercari
│   ├── price.py         # Mercari sold 24h 캐시
│   ├── noise_filter.py  # CLIP 클러스터 outlier
│   └── browser.py       # Playwright wrapper
├── scripts/build_master.py
├── deploy/              # systemd + bash 스크립트
│   ├── deploy.sh
│   ├── rebuild-master.sh
│   └── cutie-card.service
├── .github/workflows/   # 두 워크플로우
├── master/              # 생성된 마스터 (gitignored)
└── cache/               # 시세 캐시 (gitignored)

윤리

  • 스크래핑은 robots.txt 존중, 요청 간 1초 슬립
  • 마스터·시세 데이터는 로컬 분석 전용, 재배포·재판매 안 함
  • 카드 이미지 저작권은 ASOBISYSTEM. 본인 컬렉션 관리 목적의 개인 도구

설계 문서

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors