Skip to content

aggregator-2

Role. Job aggregator #1: a large crawler. It visits about 45 job sources (using a browser, APIs and jobspy) and stores the results in its own database. Results are exported to a Google Sheet. It has no verified link to the backend.

Stack. A monorepo.

  • backend/: Node with Express, BullMQ on Redis, Selenium WebDriver, Mongoose, optional Postgres (Drizzle), bull-board for queue monitoring.
  • python-scraper/: FastAPI service around python-jobspy.
  • chrome/: a Selenium browser container for crawls that need one.

Local runs use compose.yaml (backend, MongoDB, Redis, the browser and the scraper) and a Makefile.

Entry points

  • backend/server.js starts the API on port 7001 and the queues. Queue monitor at /admin/queues.
  • backend/bin/cron-crawl.js is the hourly job Railway runs. It waits for the browser and scraper, queues the hour's crawls, drains the queues and exits.
  • backend/bin/crawl.js runs one crawler for testing.
  • python-scraper/main.py serves on port 9000.

Schedules

Set in backend/config/queue.js:

  • Browser-based crawls hourly (skipping some night hours) and a daily batch at 04:00.
  • API and jobspy crawls hourly.
  • Sheet export hourly, in New York time.
  • Retries: 3, with exponential backoff from 30 seconds.

Layout (backend)

  • config/ — queue settings, title filters, redirect domains.
  • crawlers/selenium/, crawlers/api/ — the crawlers.
  • workers/ — normalize.js (dedupe, title filter, upsert), queue workers, the Sheets worker.
  • routes/ — the HTTP API. Express routes are listed without their /api mount; see API catalog.

Documentation and CI

  • README.md, CLAUDE.md and AGENTS.md describe crawler conventions and how to add one. These disagree in places (queue names, crawler counts, whether Apify is active). The code is the reference.
  • No CI workflow in this repository.

Known issues

  • A service-account key file is tracked in backend/config/. See risks.
  • Development database credentials are hard-coded in compose.yaml.
  • The HTTP API has no authentication.