본문으로 건너뛰기

Crawler

범용 크롤러 플랫폼 인프라 — Laravel Crawler plugin + Python runtime adapter 계약

상태

항목
Layercore
TierL1
Statuswip
Version0.12.0
가격Free (free)
**카�
�고리**Infrastructure

개요

Crawler 는 multi-saas-kit 의 Layer 1 Core Plugin � 니다. Laravel 애플리케이� �이 외부 Python crawler runtime 과 통신하는 표준 API 계약을 제공하고, DataSource / CrawlDefinition / CrawlJob / CrawlSchedule / Channel / Item 계열의 공통 저장소 모델을 제공합니다.

0.12.0 기준 Crawler 는 세 부분으로 나뉩니다.

  1. Laravel pluginCrawlableInterface, CrawlApiClient, 표준 Eloquent 모델, 보존형 migration.
  2. Platform runtimeplatform/service/crawler-runtime 의 FastAPI + APScheduler 런타임. 기본값은 none adapter 이며 project-specific table 을 알지 않습니다.
  3. Project adapter package — 각 프로젝트가 /app/project_adapters 로 mount 하고 CRAWLER_RUNTIME_ADAPTER_FACTORY=<module>:<factory> 로 로드하는 Python 확장 패키지. scout.how 의 book/ranking/AI task 처리는 이 경계로 이동했습니다.

핵심 컴포넌트

CrawlableInterface

interface CrawlableInterface {
public function getKey();
public function getTenantId(): ?int;
public function getDisplayName(): string;
}

CrawlApiClient

  • startCrawl(CrawlableInterface): ?int — Python crawler runtime 에 작� 시작 요청, job_id 반환
  • getJobStatus(int $jobId): ?array — 진행 상황 조회
  • 5xx / 네트워크 예외 시 null 반환
  • X-API-Key 헤더로 내부 API 인증

표준 모델과 migration

Channel, DataSource, CrawlDefinition, CrawlSchedule, CrawlJob, CollectedItem, ItemType, Item 모델을 제공합니다. 기본 � �이블� 은 기존 scout.how 호환을 위해 channels, data_sources, crawl_definitions, crawl_jobs, crawl_schedules, collected_items, item_types, items 를 유지합니다.

Migration 은 기존 � �이블이 있으면 생성하지 않습니다. 플러그인이 fresh 프로젝트에서 직접 만든 � �이블에만 PostgreSQL table comment marker 를 남기며, rollback 시 그 marker 가 있는 � �이블만 삭제합니다.

Python runtime adapter 계약

공통 runtime 은 다음 env 를 기준으로 동작합니다.

CRAWLER_RUNTIME_ADAPTER=none
CRAWLER_RUNTIME_ADAPTER_FACTORY=

프로젝트 adapter 를 쓰는 경우:

CRAWLER_RUNTIME_ADAPTER=scout
CRAWLER_RUNTIME_ADAPTER_FACTORY=project_adapters.scout_runtime:create_adapter
CRAWLER_RUNTIME_ENABLE_SCOUT_AI_ROUTES=true
CRAWLER_RUNTIME_ENABLE_SCOUT_POSTPROCESSING=true

scout.how 는 workspace/scout.how/service/project_adapters/scout_runtime 패키지를 /app/project_adapters 로 mount 해 runtime 에 주� 합니다.

table map

Laravel plugin 과 Python runtime 은 같은 PLG_CRAWLER_*_TABLE 값을 공유합니다. 값은 plain table 또는 schema.table 형식을 허용하며, Python runtime 은 identifier 를 검증한 뒤 quote 해서 SQL에 삽� 합니다.

도메인 경계

Crawler plugin 이 소유하는 범위는 crawler core table 과 API 계약� 니다. books, book_keywords, keyword_rankings, keyword_ranking_items, keyword_score_tiers, daily_stats, ai_tasks 는 scout.how project adapter 의 도메인� 니다.

라이선스

MIT

데모


🛒 Plugin Store에서 보기: store.codebase.how/plugins/crawler