Skip to content

Seed Scripts ​

Seeds populate the system-level data that drives the platform. All seeds are idempotent — safe to re-run.


Running Seeds ​

bash
cd API-honeyhimself

# Run all seeds (in dependency order)
npm run seed:all

# Or individually:
npm run seed:plans
npm run seed:stage-types
npm run seed:screening-questions
npm run seed:dev-org

Scripts use npx tsx (not ts-node). seed:all delegates to a master script (seedAll.ts) that runs in dependency order:

json
{
  "scripts": {
    "seed:plans": "npx tsx src/scripts/seedPlans.ts",
    "seed:stage-types": "npx tsx src/scripts/seedStageTypes.ts",
    "seed:screening-questions": "npx tsx src/scripts/seedScreeningQuestions.ts",
    "seed:dev-org": "npx tsx src/scripts/seedDevOrg.ts",
    "seed:all": "npx tsx src/scripts/seedAll.ts",
    "seed:interview-questions": "npx tsx src/scripts/seedInterviewQuestions.ts"
  }
}

Note: seed:interview-questions is defined but NOT included in seed:all — deferred to Phase 1B. seed:dsa-problems and seed:scenario-questions are similarly deferred to their respective phases.


seedPlans.ts ​

Inserts 4 Plan documents. Uses upsert on key to remain idempotent.

PlanmaxActiveJobsmaxCandidatesmaxInterviews/moPremium
free11030—
starter550200—
pro202001 000analytics, branding
enterprise-1-1-1all

(-1 = unlimited)


seedStageTypes.ts ​

Inserts 6 StageTypeConfig documents. These drive all frontend dropdowns and form rendering logic. Uses upsert on key.

See StageTypeConfig docs for full config for each stage type.


seedScreeningQuestions.ts ​

Inserts 22 ScreeningQuestion documents with source: 'system'. Questions grouped by category:

  • Work Authorization
  • Availability
  • Salary Expectations
  • Remote Work
  • Notice Period
  • Experience Level
  • Technical Skills
  • Communication

Uses content hash dedup (findOneAndUpdate with $setOnInsert).


seedDevOrg.ts ​

Dev-only one-time script. For each existing User that has no organizationId, creates an Organization doc and sets User.organizationId. Idempotent — skips if org already exists.

Requires seed:plans to have run first (org is created on the free plan).


seedInterviewQuestions.ts (Phase 1B — not in seed:all) ​

Inserts ~30 InterviewQuestion docs with source: 'system'. Categories:

  • Behavioral (behavioral)
  • Technical (technical)
  • Culture Fit (culture_fit)
  • Situational (situational)

Run manually when starting Phase 1B work. Will be added to seed:all in Phase 1B.


seedDsaProblems.ts (Phase 3 — not in seed:all) ​

Inserts 20+ DSAProblem docs with source: 'system'. Distribution:

  • 8 easy
  • 8 medium
  • 4 hard

Topics: arrays, hash maps, trees, graphs, dynamic programming, binary search, sorting.

Each problem includes:

  • Full problem statement
  • 2–3 visible examples
  • 5–10 test cases (mix of visible and hidden)
  • Starter code in JS, Python, Java, C++
  • Time + memory limits

seedScenarioQuestions.ts (Phase 4 — not in seed:all) ​

Inserts system ScenarioQuestion docs across:

  • system_design
  • api_design
  • behavioral
  • sales
  • marketing
  • product

Each includes evaluationRubric and followUpGuide for the AI interviewer.