The coverage‑pass cap is set to two passes per requirement.
Kit creation runs as an async background job with frontend polling status.
A single edit or regenerate action runs synchronously within its HTTP request.
During CI, LLM and search API keys are mocked; no real keys are used.
Requirements are not editable in the builder (editable = false).
There is no undo or version history (undo_history = none).
The batch CLI runs with concurrency = 2 and a per‑case timeout of four minutes, keeping total evaluation under fifteen minutes.
I deployed the Trao Prep Kit using free‑tier services: the backend runs on Render, the frontend on Vercel, and the database on MongoDB Atlas M0.
The backend (apps/api) is hosted as a free Web Service on Render.
Render builds the backend with the command npm install --include=dev && npm run build --workspace=packages/shared && npm run build --workspace=apps/api.
The backend’s required environment variables are MONGODB_URI, JWT_SECRET, NODE_ENV=production, CORS_ORIGIN, GEMINI_API_KEY, and TAVILY_API_KEY.
The frontend (apps/web) is deployed on Vercel as a Next.js app.
Vercel sets the environment variable NEXT_PUBLIC_API_URL to the Render‑deployed backend URL.
The crawler limits the frontier to a maximum of 8 pages, as defined by CRAWL_MAX_PAGES.
Tavily provides a free tier of 1,000 credits per month.
No credit card is required to use Tavily’s free tier.
The Trao Prep Kit backend is organized into distinct service layers under apps/api/src/services/, each responsible for a single concern such as retrieval, search, LLM interaction, generation, and persistence.
- Retrieval layer (
retrieval/) handles crawling, robots.txt compliance, rate‑limiting, URL safety checks and page cleaning. - Search layer (
search/) provides integration with Tavily for public interview‑discussion searches. - LLM layer (
llm/) wraps the Gemini client and offers a JSON‑mode/repair/validate utility that returns JSON matching a Zod schema, without any kit‑specific knowledge. - Generation layer (
generation/) orchestrates requirement extraction, company brief creation, per‑category question generation, coverage checking and schedule allocation. - Kit builder (
kit-builder.ts) contains pure functions that take aKitobject and return a newKitimmutably, enabling deterministic unit tests. - Kit service (
kit.service.ts) is the single MongoDB touchpoint, wrapping the generation pipeline and kit‑builder edits, performing ownership checks and re‑validating every write against the Appendix A schema. - Routes (
kit.routes.ts,auth.routes.ts) form a thin HTTP layer that validates request bodies with Zod, invokes the service layer, and returns structured JSON errors.
These design decisions align with the project’s Section 13 requirement for clearly separated concerns, improving modularity, testability, and consistent schema validation across the stack.
I need Node.js ≥ 18.18 to run the repo.
`git clone <this repo>`
`npm install`
`npm run build --workspace=packages/shared`
I copy the example env files so that MONGODB_URI and JWT_SECRET exist, even if I only run the batch.
`npm run dev:api` # http://localhost:4000
`npm run dev:web` # http://localhost:3000
`npm run evaluate -- --input cases.json --output kits.json`
I use Google Gemini as the LLM provider because it is free, supports native JSON‑mode output, and its model name is configurable via the GEMINI_MODEL env var.
The Gemini client retries on 429, 5xx, timeouts, and network errors with exponential backoff, but it does not retry non‑rate‑limit 4xx errors to save the retry budget.
I built the trai‑prep‑kit repository as a full‑stack TypeScript app to generate interview preparation kits for Trao's assessment.
The repo started 2026-09, last updated 2026-09.
It is a full‑stack app that turns a pasted job description and a company URL into a structured, editable interview prep kit — company brief, role breakdown, categorised question bank, flashcards, and a day‑by‑day study schedule — built by genuinely researching the company (crawling its site, searching for public discussion of its interview process) rather than a single prompt.
Frontend stack: Next.js 16 (App Router) + Tailwind CSS, React 18.
Backend stack: Node.js + Express + TypeScript, MongoDB Atlas free tier (M0) via Mongoose, storing kits as Schema.Types.Mixed.
Validation: Zod schemas shared in packages/shared as single source of truth.
Auth: JWT session cookie (httpOnly) with bcrypt password hashing, no email verification or role management.
Testing: 149 Vitest + Supertest tests in apps/api.

