尚未检测到更新。GitHub 发布版本后会显示在这里。
Fix it or Replace that appliance calculator.
翻译准备中
正在加载完整 README。
查看完整 README ↗RepairOrReplace is a Next.js web app that answers a deceptively hard household question: when a major appliance breaks, is it economically rational to pay for the repair, or to replace the unit? Instead of the usual folk heuristics ("if the repair costs more than half of a new one, replace it"), it runs a transparent financial model — a Weibull reliability estimate of remaining useful life, a risk-adjusted expected repair cost, a localized energy sub-model, and an equivalent-service Net Present Cost comparison — then returns a plain-English verdict with every number sourced and shown. It refuses to fake precision: vague inputs lower a confidence score, and predatory quotes suppress the verdict entirely in favor of "get a second opinion."
Canonical origin: https://www.repair-or-replace.net, defined once in
lib/site.ts.
Appliance repair-or-replace advice is dominated by rules of thumb that ignore the factors that actually decide the math:
RepairOrReplace models all of these and presents the result with full provenance, so a homeowner (and, later, a landlord or a technician) can make the call with evidence rather than a guess.
repair, replace, or uncertain, with a
headline, a plain-English explanation, and a 0–100 gauge position.| Layer | Choice |
|---|---|
| Framework | Next.js 16, App Router |
| UI | React 19, Server Components by default |
| Styling | Tailwind CSS 4 (CSS-first config, design tokens in app/globals.css) |
| Language | TypeScript 5.7, strict |
| API | Next.js Route Handlers under app/api/ |
| Data | In-code TypeScript modules under src/data/ — no database |
| Tests | Vitest (node environment) |
| Runtime | Node.js ≥ 22 |
The calculation core in src/core/ is plain, portable TypeScript with no
framework, DOM, or platform dependencies. The same functions run in Vitest and
in the Route Handlers, so a passing test is a real guarantee about the API.
Every reference figure — lifespans, labor multipliers, energy rates, component
cost bands, ancillary costs — is read from a TypeScript module in src/data/
that is compiled into the bundle. There is no SQL, no key-value cache, and no
object store in the request path. The only network call the app makes is the
optional CPSC recall lookup, and that is best-effort.
Nothing is written to disk, and no request payload, result, or identifier is
retained. The one piece of per-client state anywhere in the app is the
in-memory rate-limit counter in POST /api/calculate — an IP string and the
timestamps of its last few requests, held in a module-level Map inside a
single server instance, dropped once those timestamps age out of the 60-second
window, and only recorded at all when the deployment sets
TRUST_PROXY_HEADER=1. See Guards below.
以上为 README 的开头部分。其余内容请阅读原文。 查看完整 README ↗