Skip to content

Cross-repo workflows

Step-by-step flows that cross repository boundaries. Each step names the endpoint or collection involved.

1. Manual job entry

An admin adds a job in the dashboard.

  1. Dashboard calls POST /jobs on the backend.
  2. The backend stores the job in the jobs collection.

2. Automatic job collection (unicorn)

  1. The scheduler runs each enabled provider (Fantastic Jobs by default) on an hourly interval.
  2. The provider output is filtered by blocked title, company, URL keywords and "easy apply" rules.
  3. Jobs seen in the last 10 days are skipped.
  4. The rest are written to MONGODB_DB.MONGODB_COLLECTION with update_one($setOnInsert, upsert), including the empty assignees, applications and favorited_by arrays the backend expects.

Database name

The aggregator defaults to database smart-apply; the backend defaults to smart_apply. Jobs reach the backend only when both point at the same database.

3. Collection and export (aggregator-2)

  1. Schedulers enqueue crawl jobs on Redis (BullMQ) by hour and by day.
  2. Workers run Selenium, API or jobspy crawlers and normalise each result.
  3. Results are upserted into the aggregator's own MongoDB and enqueued for URL resolution and enrichment.
  4. Jobs are exported to a Google Sheet on a schedule.

No step in this flow writes to the backend.

4. Assignment and status

  1. An admin or manager calls POST /jobs/assign (or /jobs/unassign, /jobs/bulk-status).
  2. The backend updates the job's applications[] entries.
  3. Each change is also written to the work ledger, so pay is computed from it.

5. Bidder works a job in the extension

  1. The bidder logs in (POST /auth/login), then loads assigned jobs (GET /jobs/bidder).
  2. The extension reads the open job page and sends the form to POST /applications/scrape, which uses OpenAI to extract the fields.
  3. For custom questions it calls POST /applications/custom-qa to draft answers.
  4. The bidder marks the outcome with PUT /jobs/{id}/application-status, with a screenshot stored in Tigris.

6. Bidder request and manager confirmation

  1. A bidder can only request request_applied or request_expired.
  2. The manager resolves it with POST /manager/requests/resolve.

7. Auto Apply

  1. Every hour, the backend sync runs for each admin with Auto Apply enabled:
    1. Find jobs created since the last cursor whose titles match the admin's keywords.
    2. Remove jobs for companies the admin has applied to or has queued (company matching is in company_dedup/).
    3. Assign the rest to the admin.
    4. Record them in auto_apply_jobs.
    5. POST the job ids to the Auto Apply service's POST /queue, with a short-lived admin token.
  2. The Auto Apply service opens the job page and fills the form. It calls the backend for:
    • POST /applications/answer-form to answer form questions,
    • POST /applications/files to upload the resume and cover letter,
    • POST /auto-apply/jobs/{job_id}/result to report the result.
  3. The Auto Apply service never calls /jobs/{id}/apply or the status endpoint directly.

The queue lives in memory on the Auto Apply service, so the backend re-sends queued jobs every hour.

8. Pay

  1. The ledger is grouped into daily totals (bidder_daily) and weekly totals (bidder_pay_weeks), priced with the rates in effect on each day (bidder_rates).
  2. Managers review weeks and record payments. Bidders see their own summary in the extension (GET /payments/my-summary).

9. Retention

A daily job at the hour set by run_hour_utc (default 00:00 UTC) applies the policy the superadmin set. A preview endpoint shows what would be deleted before the first real run.