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.
- Dashboard calls
POST /jobson the backend. - The backend stores the job in the
jobscollection.
2. Automatic job collection (unicorn)¶
- The scheduler runs each enabled provider (Fantastic Jobs by default) on an hourly interval.
- The provider output is filtered by blocked title, company, URL keywords and "easy apply" rules.
- Jobs seen in the last 10 days are skipped.
- The rest are written to
MONGODB_DB.MONGODB_COLLECTIONwithupdate_one($setOnInsert, upsert), including the emptyassignees,applicationsandfavorited_byarrays 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)¶
- Schedulers enqueue crawl jobs on Redis (BullMQ) by hour and by day.
- Workers run Selenium, API or jobspy crawlers and normalise each result.
- Results are upserted into the aggregator's own MongoDB and enqueued for URL resolution and enrichment.
- Jobs are exported to a Google Sheet on a schedule.
No step in this flow writes to the backend.
4. Assignment and status¶
- An admin or manager calls
POST /jobs/assign(or/jobs/unassign,/jobs/bulk-status). - The backend updates the job's
applications[]entries. - Each change is also written to the work ledger, so pay is computed from it.
5. Bidder works a job in the extension¶
- The bidder logs in (
POST /auth/login), then loads assigned jobs (GET /jobs/bidder). - The extension reads the open job page and sends the form to
POST /applications/scrape, which uses OpenAI to extract the fields. - For custom questions it calls
POST /applications/custom-qato draft answers. - The bidder marks the outcome with
PUT /jobs/{id}/application-status, with a screenshot stored in Tigris.
6. Bidder request and manager confirmation¶
- A bidder can only request
request_appliedorrequest_expired. - The manager resolves it with
POST /manager/requests/resolve.
7. Auto Apply¶
- Every hour, the backend sync runs for each admin with Auto Apply enabled:
- Find jobs created since the last cursor whose titles match the admin's keywords.
- Remove jobs for companies the admin has applied to or has queued (company matching is in
company_dedup/). - Assign the rest to the admin.
- Record them in
auto_apply_jobs. - POST the job ids to the Auto Apply service's
POST /queue, with a short-lived admin token.
- The Auto Apply service opens the job page and fills the form. It calls the backend for:
POST /applications/answer-formto answer form questions,POST /applications/filesto upload the resume and cover letter,POST /auto-apply/jobs/{job_id}/resultto report the result.
- The Auto Apply service never calls
/jobs/{id}/applyor 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¶
- 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). - 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.