Next.js 14 Static Export
The application uses Next.js 14’soutput: 'export' mode to generate a fully static site:
- Build output:
out/directory contains pure HTML/CSS/JS - No server runtime: All pages are pre-rendered at build time
- Client-side only: All tool processing happens in the browser
- Deployment: Static files deployed to Vercel
Using static export means server-side Next.js features (API routes, server actions, SSR) are not available. All functionality is implemented client-side.
Routing Architecture
App Router Structure
The application uses Next.js 14’s App Router with a streamlined layout:Route Generation
All 47 tool routes are generated at build time usinggenerateStaticParams():
/tools/json-format-validate/tools/base64-string/tools/jwt-debugger- …and 44 more
Default Tool Redirect
The root page (app/page.tsx) redirects to the default tool:
json-format-validate
Layout & Component Structure
Unified Layout Pattern
All tool pages share a single unified layout — there are no per-tool page components. The entire UI is managed byAppShell.tsx:
AppShell.tsx is the top-level client component that renders:
- Sidebar — Tool navigation grouped by category
- Header — Search/command palette trigger
- Workbench — Unified tool UI (input/output/actions)
- Command Palette — Quick tool switching (Cmd+K)
Client-Side Rendering
The application is entirely client-side rendered:app/layout.tsx→ Minimal HTML shell with fonts and theme CSScomponents/layout/AppShell.tsx→ Full interactive UI (marked'use client')components/tools/ToolWorkbench.tsx→ Tool execution UI (marked'use client')
Core Pattern: Registry → Engine → Workbench
The entire tool system follows a three-file pattern:- Registry (
lib/tools/registry.ts) — Defines all 51 tools - Engine (
lib/tools/engine.ts) — Processes tool logic - Workbench (
components/tools/ToolWorkbench.tsx) — Unified UI
Key Dependencies
Core Framework
next@14— App Router, static exportreact@18— UI frameworktailwindcss— Styling with CSS custom properties
Tool Libraries
crypto-js— Hash generation (MD5, SHA-256, etc.)terser— JavaScript minificationjs-yaml— YAML parsing/generationpapaparse— CSV parsingsql-formatter— SQL formattingmarked/dompurify— Markdown previewqrcode/jsqr— QR code generation/decoding
State & Storage
zustand— UI state managementdexie— IndexedDB wrapper for history
All dependencies are bundled into the client-side JavaScript. The initial bundle is ~513 kB due to all tool libraries loading on every page. Dynamic imports would reduce this.
Build & Deployment
Build Process
- Next.js compiles all TypeScript to JavaScript
generateStaticParams()generates 47 tool pages- Static HTML/CSS/JS output to
out/directory - Service worker (
public/sw.js) copied for PWA support
Deployment
Deployed to Vercel with:- Headers (
vercel.json) — CSP, HSTS, security headers - PWA — Installable as standalone app
- Offline support — Service worker caches assets
Security
- CodeQL SAST — Automated code scanning
- npm audit — Dependency vulnerability checks (critical-only)
- TruffleHog — Secret scanning
- SBOM — CycloneDX software bill of materials
Performance
First Load
- JavaScript: ~513 kB (gzipped)
- CSS: ~12 kB
- Fonts: DM Sans, Playfair Display, Fira Code (preloaded)
Runtime
- Processing: All synchronous (runs on main thread)
- Storage: IndexedDB for history (max 50 entries per tool)
- Caching: Service worker caches static assets
Heavy tools (like JS minification with Terser) may block the UI thread. Input size is limited to 5 MB per field to prevent freezing.
Theming
Default theme: Solarized Light- Warm cream background (
#fdf6e3) - Gold accent (
#b58900) - CSS custom properties in
app/globals.css - Dark theme CSS exists but UI toggle not implemented
Custom Properties
Next Steps
Tool System
Learn how the registry → engine → workbench pattern works
State Management
Understand Zustand stores and localStorage persistence
Storage
Explore IndexedDB schema for history and favorites