How keejung7/aritziapricetracker works
Aritzia Price Tracker collects product listings and price/availability observations, stores them in PostgreSQL, and serves a catalog and product-history experience through a Next.js app. The main workflow runs from scraping through raw-data loading and catalog snapshot refresh, then shoppers browse/filter products and inspect price and size history. The README documents the collection and refresh sequence; sampled source confirms key API, service, and UI calls. Some unsampled integrations are therefore omitted rather than inferred.
Main entry points: db.js Raw data loader · CatalogExplorer.tsx Catalog explorer · ProductPriceHistoryExplorer.tsx History explorer · route.ts History API
Components 30
Data collection
- URL scraper
scraper.js - Detail scraper
details_scraper.js - HTML data view
generate_view.js
Database and catalog
- Raw data loader
db/db.js - Artifact parser
db/parser.js - Catalog refresh
db/catalogReadModel.js - Refresh command
db/refresh_catalog_read_model.js - PostgreSQL
- Catalog queries
db/catalogQueries.js - History queries
db/queries.js
Catalog browsing
- Catalog page
app/page.tsx - Catalog entry
app/components/LatestProductsExplorer.tsx - Catalog explorer
app/components/catalog/CatalogExplorer.tsx - Catalog filters
app/components/catalog/CatalogFilters.tsx - Catalog data hook
app/components/catalog/useCatalogProducts.ts - Catalog API
app/api/catalog/products/route.ts - Catalog service
app/services/catalogService.ts - Product cards
app/components/catalog/ProductCard.tsx - Color swatches
app/components/catalog/ColorSwatches.tsx - Available sizes
app/components/catalog/AvailableSizes.tsx
Product history
- Product page
app/products/[productNo]/page.tsx - History explorer
app/components/ProductPriceHistoryExplorer.tsx - History API
app/api/products/[productNo]/price-history/route.ts - Date price API
app/api/products/[productNo]/prices/[date]/route.ts - History formatter
app/services/priceHistoryService.ts - Chart history logic
app/services/productChartService.ts - Price chart
app/components/product/PriceHistoryChart.tsx - Availability chart
app/components/product/AvailabilityHistoryChart.tsx
Other components
- Aritzia site
- Shopper
Connections 35
- URL scraper → Aritzia site: scrapes categories
- Detail scraper → Aritzia site: scrapes products
- URL scraper → Detail scraper: provides product links
- Detail scraper → Raw data loader: provides JSONL
- Raw data loader → Artifact parser: parses input
db/db.js - Raw data loader → PostgreSQL: upserts observations
- Raw data loader → Catalog refresh: refreshes catalog
db/db.js - Refresh command → Catalog refresh: runs refresh
db/refresh_catalog_read_model.js - Catalog refresh → PostgreSQL: builds snapshots
- Catalog queries → PostgreSQL: reads snapshot
- History queries → PostgreSQL: reads history
- Shopper → Catalog page: opens catalog
- Catalog page → Catalog entry: renders
app/page.tsx - Catalog entry → Catalog explorer: renders
app/components/LatestProductsExplorer.tsx - Catalog explorer → Catalog filters: renders
app/components/catalog/CatalogExplorer.tsx - Catalog explorer → Product cards: renders
app/components/catalog/CatalogExplorer.tsx - Catalog explorer → Catalog data hook: uses
app/components/catalog/CatalogExplorer.tsx - Catalog filters → Catalog data hook: updates filters
app/components/catalog/CatalogFilters.tsx - Catalog data hook → Catalog API: fetches pages
app/components/catalog/useCatalogProducts.ts - Catalog API → Catalog service: calls
app/api/catalog/products/route.ts - Catalog service → Catalog queries: queries products
app/services/catalogService.ts - Product cards → Color swatches: renders
app/components/catalog/ProductCard.tsx - Product cards → Available sizes: renders
app/components/catalog/ProductCard.tsx - Shopper → Product page: opens product
- Product page → History explorer: renders
app/products/[productNo]/page.tsx - History explorer → History API: loads history
- History API → History queries: queries prices
app/api/products/[productNo]/price-history/route.ts - History API → History formatter: formats rows
app/api/products/[productNo]/price-history/route.ts - History API → Chart history logic: builds chart data
app/api/products/[productNo]/price-history/route.ts - Date price API → History queries: queries date
app/api/products/[productNo]/prices/[date]/route.ts - Date price API → History formatter: formats rows
app/api/products/[productNo]/prices/[date]/route.ts - Chart history logic → History formatter: uses history types
app/services/productChartService.ts - History explorer → Price chart: renders
app/components/ProductPriceHistoryExplorer.tsx - History explorer → Availability chart: renders
app/components/ProductPriceHistoryExplorer.tsx - HTML data view → Detail scraper: reads JSONL output