# atehe/acdc_scrapy architecture

> Architecture diagram of the GitHub repository atehe/acdc_scrapy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/atehe/acdc_scrapy
- Repository: https://github.com/atehe/acdc_scrapy

## Overview

ACDC Scrapy collects marketplace data through Scrapy spiders, using spreadsheet or other configured inputs, then saves crawl outputs and tracks completion. A separate command parses archived ZIP downloads into CSV and records the result. The README documents TikTok, Lazada, and Shopee coverage; the tree shows provider-specific TikTok spiders and parsers, with Lazada and Shopee spider packages present. The graph follows documented or indexed relationships; unsampled subsystem internals and framework wiring are not inferred.

Main entry points: [`acdc_scrapy/spiders/base_spider.py`](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/spiders/base_spider.py) (Base spider), [`acdc_scrapy/parsers/config.py`](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/parsers/config.py) (Provider parsers), [`acdc_scrapy/parsers/base.py`](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/parsers/base.py) (ZIP parser base), [`acdc_scrapy/integrations/s3_handler.py`](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/integrations/s3_handler.py) (Amazon S3)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_crawl["Crawl orchestration"]
  node_spiders["Marketplace spiders"]
  node_base_spider["Base spider<br/>[base_spider.py]"]
  node_input_data["Input loading<br/>[input.py]"]
  node_tiktok_spiders["TikTok spiders"]
  node_lazada_spiders["Lazada spiders"]
  node_shopee_spiders["Shopee spiders"]
end

subgraph group_parse["Provider parsing"]
  node_provider_parsers["Provider parsers<br/>[config.py]"]
  node_parser_base["ZIP parser base<br/>[base.py]"]
  node_tokapi_parser["TokAPI parser<br/>[tokapi.py]"]
  node_echotik_parser["Echotik parser<br/>[echotik.py]"]
  node_fastmoss_parser["FastMoss parser<br/>[fastmoss.py]"]
  node_zip_command["ZIP parse command"]
end

subgraph group_outputs["Output processing"]
  node_raw_item["Raw response item<br/>[core.py]"]
  node_item_pipeline["Core item pipeline<br/>[core.py]"]
  node_jsonl_pipeline["JSONL aggregation<br/>[json_agg.py]"]
  node_metadata_pipeline["Metadata pipeline<br/>[metadata.py]"]
  node_jsonl_tools["JSONL utilities<br/>[jsonl.py]"]
end

subgraph group_integrations["Storage and tracking"]
  node_s3[("Amazon S3<br/>[s3_handler.py]")]
  node_sheets[("Google Sheets<br/>[gsheet_handler.py]")]
  node_completion["Download completion<br/>[core.py]"]
  node_signals["Crawl signals<br/>[signals.py]"]
  node_logging["Logging formatter<br/>[logging.py]"]
end

node_operator(("Crawl operator"))

node_operator -->|"starts crawl"| node_spiders
node_spiders -.->|"shares behavior"| node_base_spider
node_base_spider -->|"loads input"| node_input_data
node_tiktok_spiders -->|"inherits"| node_base_spider
node_lazada_spiders -.-> node_base_spider
node_shopee_spiders -.-> node_base_spider
node_zip_command -->|"selects parser"| node_provider_parsers
node_provider_parsers -->|"registers"| node_tokapi_parser
node_provider_parsers -->|"registers"| node_echotik_parser
node_provider_parsers -->|"registers"| node_fastmoss_parser
node_tokapi_parser -->|"inherits"| node_parser_base
node_echotik_parser -->|"inherits"| node_parser_base
node_fastmoss_parser -->|"inherits"| node_parser_base
node_parser_base -->|"downloads archives"| node_s3
node_zip_command -->|"uploads CSV"| node_s3
node_zip_command -->|"records parse"| node_sheets
node_item_pipeline -->|"processes"| node_raw_item
node_jsonl_pipeline -->|"aggregates items"| node_raw_item
node_jsonl_pipeline -->|"uploads files"| node_s3
node_metadata_pipeline -->|"adds metadata"| node_raw_item
node_metadata_pipeline -->|"uses metadata"| node_jsonl_tools
node_completion -->|"registers close hook"| node_signals
node_completion -->|"archives crawl"| node_s3
node_completion -->|"updates tracker"| node_sheets

click node_spiders "https://github.com/atehe/acdc_scrapy/tree/main/acdc_scrapy/spiders"
click node_base_spider "https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/spiders/base_spider.py"
click node_input_data "https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/utils/input.py"
click node_tiktok_spiders "https://github.com/atehe/acdc_scrapy/tree/main/acdc_scrapy/spiders/tiktok"
click node_lazada_spiders "https://github.com/atehe/acdc_scrapy/tree/main/acdc_scrapy/spiders/lazada"
click node_shopee_spiders "https://github.com/atehe/acdc_scrapy/tree/main/acdc_scrapy/spiders/shopee"
click node_provider_parsers "https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/parsers/config.py"
click node_parser_base "https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/parsers/base.py"
click node_tokapi_parser "https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/parsers/tiktok/tokapi.py"
click node_echotik_parser "https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/parsers/tiktok/echotik.py"
click node_fastmoss_parser "https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/parsers/tiktok/fastmoss.py"
click node_zip_command "https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/commands/parse_zip_download.py"
click node_raw_item "https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/items/core.py"
click node_item_pipeline "https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/pipelines/core.py"
click node_jsonl_pipeline "https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/pipelines/json_agg.py"
click node_metadata_pipeline "https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/pipelines/metadata.py"
click node_jsonl_tools "https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/utils/jsonl.py"
click node_s3 "https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/integrations/s3_handler.py"
click node_sheets "https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/integrations/gsheet_handler.py"
click node_completion "https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/extensions/core.py"
click node_signals "https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/signals.py"
click node_logging "https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/logging.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_spiders,node_base_spider,node_input_data,node_tiktok_spiders,node_lazada_spiders,node_shopee_spiders toneBlue
class node_provider_parsers,node_parser_base,node_tokapi_parser,node_echotik_parser,node_fastmoss_parser,node_zip_command toneAmber
class node_raw_item,node_item_pipeline,node_jsonl_pipeline,node_metadata_pipeline,node_jsonl_tools toneMint
class node_s3,node_sheets,node_completion,node_signals,node_logging toneRose
class node_operator toneIndigo
```

## Components

### Crawl orchestration

- [Marketplace spiders](https://github.com/atehe/acdc_scrapy/tree/main/acdc_scrapy/spiders): `acdc_scrapy/spiders`
- [Base spider](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/spiders/base_spider.py): `acdc_scrapy/spiders/base_spider.py`
- [Input loading](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/utils/input.py): `acdc_scrapy/utils/input.py`
- [TikTok spiders](https://github.com/atehe/acdc_scrapy/tree/main/acdc_scrapy/spiders/tiktok): `acdc_scrapy/spiders/tiktok`
- [Lazada spiders](https://github.com/atehe/acdc_scrapy/tree/main/acdc_scrapy/spiders/lazada): `acdc_scrapy/spiders/lazada`
- [Shopee spiders](https://github.com/atehe/acdc_scrapy/tree/main/acdc_scrapy/spiders/shopee): `acdc_scrapy/spiders/shopee`

### Provider parsing

- [Provider parsers](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/parsers/config.py): `acdc_scrapy/parsers/config.py`
- [ZIP parser base](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/parsers/base.py): `acdc_scrapy/parsers/base.py`
- [TokAPI parser](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/parsers/tiktok/tokapi.py): `acdc_scrapy/parsers/tiktok/tokapi.py`
- [Echotik parser](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/parsers/tiktok/echotik.py): `acdc_scrapy/parsers/tiktok/echotik.py`
- [FastMoss parser](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/parsers/tiktok/fastmoss.py): `acdc_scrapy/parsers/tiktok/fastmoss.py`
- [ZIP parse command](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/commands/parse_zip_download.py): `acdc_scrapy/commands/parse_zip_download.py`

### Output processing

- [Raw response item](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/items/core.py): `acdc_scrapy/items/core.py`
- [Core item pipeline](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/pipelines/core.py): `acdc_scrapy/pipelines/core.py`
- [JSONL aggregation](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/pipelines/json_agg.py): `acdc_scrapy/pipelines/json_agg.py`
- [Metadata pipeline](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/pipelines/metadata.py): `acdc_scrapy/pipelines/metadata.py`
- [JSONL utilities](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/utils/jsonl.py): `acdc_scrapy/utils/jsonl.py`

### Storage and tracking

- [Amazon S3](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/integrations/s3_handler.py): `acdc_scrapy/integrations/s3_handler.py`
- [Google Sheets](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/integrations/gsheet_handler.py): `acdc_scrapy/integrations/gsheet_handler.py`
- [Download completion](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/extensions/core.py): `acdc_scrapy/extensions/core.py`
- [Crawl signals](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/signals.py): `acdc_scrapy/signals.py`
- [Logging formatter](https://github.com/atehe/acdc_scrapy/blob/main/acdc_scrapy/logging.py): `acdc_scrapy/logging.py`

### Other components

- **Crawl operator**

## Connections

- Crawl operator → Marketplace spiders: starts crawl (evidence: `README.md`)
- Marketplace spiders → Base spider: shares behavior (evidence: `acdc_scrapy/spiders/tiktok/tiktok_tokapi.py`)
- Base spider → Input loading: loads input (evidence: `acdc_scrapy/spiders/base_spider.py`)
- TikTok spiders → Base spider: inherits (evidence: `acdc_scrapy/spiders/tiktok/tiktok_kratos.py`)
- Lazada spiders → Base spider
- Shopee spiders → Base spider
- ZIP parse command → Provider parsers: selects parser (evidence: `acdc_scrapy/commands/parse_zip_download.py`)
- Provider parsers → TokAPI parser: registers (evidence: `acdc_scrapy/parsers/config.py`)
- Provider parsers → Echotik parser: registers (evidence: `acdc_scrapy/parsers/config.py`)
- Provider parsers → FastMoss parser: registers (evidence: `acdc_scrapy/parsers/config.py`)
- TokAPI parser → ZIP parser base: inherits (evidence: `acdc_scrapy/parsers/tiktok/tokapi.py`)
- Echotik parser → ZIP parser base: inherits (evidence: `acdc_scrapy/parsers/tiktok/echotik.py`)
- FastMoss parser → ZIP parser base: inherits (evidence: `acdc_scrapy/parsers/tiktok/fastmoss.py`)
- ZIP parser base → Amazon S3: downloads archives (evidence: `acdc_scrapy/parsers/base.py`)
- ZIP parse command → Amazon S3: uploads CSV (evidence: `acdc_scrapy/commands/parse_zip_download.py`)
- ZIP parse command → Google Sheets: records parse (evidence: `acdc_scrapy/commands/parse_zip_download.py`)
- Core item pipeline → Raw response item: processes (evidence: `acdc_scrapy/pipelines/core.py`)
- JSONL aggregation → Raw response item: aggregates items (evidence: `acdc_scrapy/pipelines/json_agg.py`)
- JSONL aggregation → Amazon S3: uploads files (evidence: `acdc_scrapy/pipelines/json_agg.py`)
- Metadata pipeline → Raw response item: adds metadata (evidence: `acdc_scrapy/pipelines/metadata.py`)
- Metadata pipeline → JSONL utilities: uses metadata (evidence: `acdc_scrapy/pipelines/metadata.py`)
- Download completion → Crawl signals: registers close hook (evidence: `acdc_scrapy/extensions/core.py`)
- Download completion → Amazon S3: archives crawl (evidence: `acdc_scrapy/extensions/core.py`)
- Download completion → Google Sheets: updates tracker (evidence: `acdc_scrapy/extensions/core.py`)
