The source of jsonpilot.com: 44 free, private JSON tools that run in your browser.
Live site · About JSONPilot · Report a bug or suggest a tool · Contributing
Validator, formatter, repair, viewers, converters, code generators and more. Built with Next.js 16 (App Router) + TypeScript, exported as a static site. All JSON processing happens in the browser; there is no backend.
Requires Node.js 26 (the current LTS; see .nvmrc). With nvm: nvm install 26 && nvm use.
| Command | What it does |
|---|---|
npm install |
Install dependencies |
npm run dev |
Dev server at http://localhost:3000 with hot reload |
npm run build |
Production build → static files in out/ |
npm start |
Serve out/ at http://127.0.0.1:4173 (same URL rules as .htaccess) |
npm run check |
Typecheck + lint + unit tests (run before committing) |
npm run typecheck / lint / test |
The individual checks (test:watch for watch mode) |
npm run test:e2e |
Browser tests against out/ (run npm run build first; uses installed Google Chrome) |
The site deploys to Vercel from GitHub: every push to main goes live, every pull request gets
its own preview URL, and GitHub Actions runs the full test suite on both. The same code can also be
uploaded to any static host (Apache) — see the end of this section.
-
On github.com, create a new empty repository (for example
jsonpilot; private is fine). Don't add a README,.gitignoreor licence — the project already has them. -
In this folder, merge the work into
mainand push:git checkout main git merge improvements git remote add origin https://github.com/<your-account>/jsonpilot.git git push -u origin main
-
Open the repository's Actions tab: the CI workflow (typecheck, lint, unit tests, build, browser tests) should go green in about 5 minutes.
- Sign in at vercel.com with GitHub → Add New… → Project → Import the repository (allow the Vercel GitHub app to access it when asked).
- Leave the detected settings as they are: Framework Next.js, default build and output settings,
no environment variables. Node.js 26 is picked up from
package.json(engines.node). - Click Deploy. When it finishes, open the
*.vercel.appURL and check a few tools.
- In the Vercel project: Settings → Domains → add
jsonpilot.com, then addwww.jsonpilot.comand choose Redirect to jsonpilot.com (permanent). - At your domain registrar, create the DNS records Vercel shows on that page — usually an
Arecord for@and aCNAMEforwww. Use the exact values Vercel displays. - Vercel issues the HTTPS certificate automatically once DNS has updated (minutes to a few hours). Keep the old host running until then so there is no downtime.
- Afterwards, check:
http://andwww.both end up onhttps://jsonpilot.com,/about.phpredirects to/about, and/sitemap.xmlloads. Then submit the sitemap in Google Search Console (the verification file inpublic/keeps the property verified).
- Change something: work on a branch, push, open a pull request. Vercel comments with a preview
URL and CI runs the tests. Merge when both are green — Vercel deploys
mainto production. - Roll back: in Vercel → Deployments, open an earlier deployment → Promote to Production.
- Google Analytics only runs on
jsonpilot.com, so previews never pollute your statistics. - The CSP blocks Vercel's comment toolbar on preview deployments. If you want it, add
https://vercel.livetoscript-src,connect-srcand aframe-srcinnext.config.ts.
Vercel (VERCEL=1 during the build) |
Static export (npm run build anywhere else) |
|
|---|---|---|
| Output | Next.js on Vercel (all pages still prerendered) | Plain files in out/ |
| Security headers, redirects | next.config.ts |
public/.htaccess |
| HTTPS, www → apex | Vercel Domains settings | public/.htaccess |
Keep the security headers in next.config.ts and public/.htaccess in sync if you change them.
To try the Vercel mode locally: VERCEL=1 npm run build && VERCEL=1 npx next start.
npm run build, then upload the contents of out/ to the web root, including the hidden
.htaccess (some FTP clients skip dotfiles). It provides clean URLs, HTTPS and www redirects, 301s
from the old .php URLs, the 404 page, security headers and caching. Requires mod_rewrite and
mod_headers; mod_deflate and mod_expires are recommended.
Bump VERSION in public/sw.js only if you change the service worker's caching rules — page and
asset updates are picked up automatically.
- One registry drives everything.
lib/tools.tslists every tool: id (= URL slug), group, menu label, and its page copy (title, SEO description, how-to, notes). The header menus, footer,/toolshub, related-tool cards, sitemap and per-tool Open Graph images are all generated from it. - One route renders every tool.
app/[tool]/page.tsxstatically generates a page per registry entry.components/tools/ToolRenderer.tsxpicks the UI and loads it withnext/dynamic, so each page only downloads the code for its own tool. - Most tools are converters.
components/tools/converters.tsdefines input/output editors, options and arun()for each;ConverterTool.tsxis the shared two-pane UI. Engines inlib/convert/are imported lazily insiderun(). - Exact numbers.
lib/json.tsis a strict JSON parser/serializer that keeps numbers thatJSON.parsewould change (12345678901234567890,1.10) asLosslessNumber, and reports duplicate keys. Use itsparse/stringifyinstead of theJSONbuilt-ins when handling user data.
app/
├── layout.tsx <html>, fonts, default metadata, header/footer, analytics, service worker
├── page.tsx home: editor, all tools, features, FAQ (+ Organization/WebSite/FAQ JSON-LD)
├── [tool]/page.tsx every tool page (generateStaticParams over lib/tools.ts)
├── [tool]/opengraph-image.tsx 1200×630 social image per tool
├── tools/page.tsx /tools hub (all tools by group)
├── about/ contact/ terms/ privacy-policy/
├── opengraph-image.tsx default social image
├── not-found.tsx 404 page
└── sitemap.ts robots.ts manifest.ts globals.css
components/
├── Header.tsx Footer.tsx Breadcrumbs.tsx ToolPage.tsx ToolCards.tsx ToolDirectory.tsx
├── Analytics.tsx CookieSettings.tsx Google Analytics, loaded only after consent
├── ServiceWorker.tsx registers public/sw.js (offline support) in production
├── json-tool/ main editor: JsonTool.tsx, editor.ts (CodeMirror), JsonTree.tsx,
│ jsonOps.ts + json.worker.ts (large files are processed in a worker)
└── tools/ ConverterTool + converters.ts, DiffTool, MergeTool, SchemaTool,
TableTool, ExcelTool, ToolRenderer, CodeEditor, Pane, Options, Status
lib/
├── tools.ts tool registry (see above)
├── json.ts lossless JSON parser/serializer
├── convert/ pure engines: csv, xml, yaml, sql, excel, markdown, flatten, diff, merge,
│ schema (Ajv), schema-gen, codegen, repair (+ JSONC/JSON5), query (JSONPath),
│ encode (escape/Base64/JWT), size, tokens, table, analyze
├── share.ts compressed share links (#json=…, never sent to the server)
├── consent.ts analytics consent storage
├── og.tsx metadata.ts site.ts content.ts browser.ts
public/ .htaccess, sw.js, icons, images, browserconfig, Google verification
tests/unit/ Vitest tests for lib/ (npm test)
tests/e2e/ Playwright tests + a static server that mirrors .htaccess
.github/workflows/ci.yml CI on every push / pull request (typecheck, lint, tests, build, e2e)
next.config.ts Vercel headers/redirects, or static export everywhere else
- New tool: add an entry to
TOOLSinlib/tools.ts. If it is a converter, add a definition with the same id toconverters.tsand it is rendered automatically; otherwise add a case toToolRenderer.tsx. The menu, footer,/tools, sitemap and OG image pick it up. - Header dropdowns:
NAV_MENUSinlib/tools.ts. - Social links:
SOCIAL_LINKSinlib/site.ts(entries with an emptyhrefare hidden). - New static page: create
app/<slug>/page.tsx, exportmetadata = pageMeta({...}), and add it toPAGESinlib/site.tsfor the sitemap. - FAQ / features:
lib/content.ts(the FAQ JSON-LD updates automatically).
