Initial release: business-name finder with live domain availability
Free, no-account tool for naming a business and finding a domain you can actually register. Availability uses no paid API and no key. IANA's RDAP bootstrap maps ~1,200 TLDs to their authoritative registry servers (404 = free, 200 = taken); the handful with no RDAP at all (.io, .co, .me, .sh, .gg, .us) fall back to a DNS NS lookup and are reported as "probably free" rather than confirmed, because a registered-but-undelegated domain is indistinguishable that way. Name generation is pure, deterministic, and client-side — eight strategies over a curated word bank, ranked by a scorer that does the real quality work. Three of its guards (prefix-only hint matching, -er-only syncopation, truncation rejection) exist because of specific bad output and should not be relaxed. Optional AI suggestions use the visitor's OWN Anthropic/Gemini key from localStorage, called browser-direct, so this stays free to run. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JChWdFJPCRxMBxErb8kUVK
This commit is contained in:
60
src/lib/tlds.ts
Normal file
60
src/lib/tlds.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
// The TLDs offered in the UI.
|
||||
//
|
||||
// Deliberately curated rather than exhaustive: there are ~1,600 TLDs and
|
||||
// almost all of them are noise for someone naming a business. Each entry says
|
||||
// what the extension signals, so the picker teaches as it goes.
|
||||
//
|
||||
// `rdap` records whether IANA publishes an RDAP server for the TLD — the ones
|
||||
// marked false fall back to a DNS heuristic and can only ever report
|
||||
// "unverified" (see lib/rdap.ts). Checked against data.iana.org 2026-08-10.
|
||||
|
||||
export interface TldInfo {
|
||||
tld: string;
|
||||
note: string;
|
||||
/** Authoritative RDAP available? false ⇒ DNS heuristic only. */
|
||||
rdap: boolean;
|
||||
/** Shown selected on first load. */
|
||||
default?: boolean;
|
||||
}
|
||||
|
||||
export const TLDS: TldInfo[] = [
|
||||
{ tld: "com", note: "The default. Still what people type from memory.", rdap: true, default: true },
|
||||
{ tld: "net", note: "Old-guard fallback when the .com is gone.", rdap: true },
|
||||
{ tld: "org", note: "Non-profits, communities, open projects.", rdap: true },
|
||||
{ tld: "co", note: "Short, startup-flavoured .com stand-in.", rdap: false, default: true },
|
||||
{ tld: "io", note: "Tech default — pricey, and a ccTLD, so read the terms.", rdap: false, default: true },
|
||||
{ tld: "ai", note: "Anything machine-learning. Expensive and in demand.", rdap: true, default: true },
|
||||
{ tld: "dev", note: "Developer tools. HTTPS is enforced on the whole TLD.", rdap: true },
|
||||
{ tld: "app", note: "Software products. Also HTTPS-only.", rdap: true },
|
||||
{ tld: "shop", note: "Retail, plainly signposted.", rdap: true },
|
||||
{ tld: "store", note: "Retail alternative when .shop is taken.", rdap: true },
|
||||
{ tld: "studio", note: "Design, photo, music, makers.", rdap: true },
|
||||
{ tld: "works", note: "Trades, workshops, agencies.", rdap: true },
|
||||
{ tld: "tools", note: "Utilities and small products.", rdap: true },
|
||||
{ tld: "supply", note: "Parts, materials, trade suppliers.", rdap: true },
|
||||
{ tld: "co.uk", note: "The UK default. Registry is Nominet.", rdap: true },
|
||||
{ tld: "us", note: "US-only; requires a US presence.", rdap: false },
|
||||
{ tld: "xyz", note: "Cheap and unopinionated. Some spam reputation.", rdap: true },
|
||||
{ tld: "site", note: "Generic and widely available.", rdap: true },
|
||||
{ tld: "online", note: "Generic; usually cheap in year one only.", rdap: true },
|
||||
{ tld: "tech", note: "Technical products and consultancies.", rdap: true },
|
||||
{ tld: "live", note: "Events, streaming, hospitality.", rdap: true },
|
||||
{ tld: "team", note: "Agencies, crews, small groups.", rdap: true },
|
||||
{ tld: "build", note: "Construction and trades.", rdap: true },
|
||||
{ tld: "zone", note: "Playful and cheap.", rdap: true },
|
||||
{ tld: "me", note: "Personal sites and portfolios.", rdap: false },
|
||||
{ tld: "sh", note: "Short hacks; ccTLD for St Helena.", rdap: false },
|
||||
{ tld: "gg", note: "Gaming. Guernsey's ccTLD, priced accordingly.", rdap: false },
|
||||
{ tld: "to", note: "Link shorteners and domain hacks.", rdap: true },
|
||||
{ tld: "cc", note: "Generic short alternative.", rdap: true },
|
||||
{ tld: "tv", note: "Video and streaming.", rdap: true },
|
||||
];
|
||||
|
||||
export const DEFAULT_TLDS = TLDS.filter((t) => t.default).map((t) => t.tld);
|
||||
|
||||
export function tldInfo(tld: string): TldInfo | undefined {
|
||||
return TLDS.find((t) => t.tld === tld);
|
||||
}
|
||||
|
||||
/** TLDs the DNS heuristic has to cover — surfaced in the UI as a caveat. */
|
||||
export const UNVERIFIABLE_TLDS = TLDS.filter((t) => !t.rdap).map((t) => t.tld);
|
||||
Reference in New Issue
Block a user