- Removed manual theme switching logic and ThemeProvider - Installed and configured tailwind-scrollbar plugin - Updated FileConverter and ConversionOptions to use shadcn Input - Refactored FontSelector to use shadcn Tabs - Simplified global styles and adjusted glassmorphic effects
3.2 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project
Kit UI is a static-export toolkit (Next.js 16, React 19, TypeScript strict) with five browser-based tools: Color, Units, ASCII, Media, and Favicon. All heavy processing runs client-side via WebAssembly. Deployed at kit.pivoine.art.
Commands
pnpm dev # Dev server with Turbopack (localhost:3000)
pnpm build # Static export to /out
pnpm lint # ESLint (next/core-web-vitals)
pnpm postinstall # Copies WASM binaries to public/wasm/ (runs automatically on install)
There are no test suites. Use pnpm build to verify changes compile correctly.
Architecture
Routing (App Router)
app/
├── page.tsx # Landing page (dark mode forced)
├── (app)/layout.tsx # Wraps all tools with Providers + AppShell
├── (app)/color/ # Color manipulation (@valknarthing/pastel-wasm)
├── (app)/units/ # Unit converter (187+ units, 23 categories)
├── (app)/ascii/ # ASCII art (373 figlet fonts)
├── (app)/media/ # File converter (FFmpeg + ImageMagick WASM)
└── (app)/favicon/ # Favicon/PWA asset generator
Code Organization
Each tool follows a mirrored structure across three directories:
app/(app)/{tool}/page.tsx— Route entry pointcomponents/{tool}/— UI components for the toollib/{tool}/— Business logic, WASM wrappers, stores, and utilitiestypes/— Shared TypeScript definitions
Shared UI primitives live in components/ui/ (shadcn/ui, customized with glassmorphic styling). Layout shell in components/layout/.
State Management (three layers)
- URL params — Primary for shareable state (
useSearchParams/useRouter().push) - React Query — Async WASM computations with caching
- Zustand — Per-tool client stores in
lib/{tool}/ - localStorage — Persistence for theme, favorites, history
WASM Integration
WASM modules (FFmpeg, ImageMagick, pastel-wasm) are lazy-loaded on first use. Binaries live in public/wasm/ and are copied there by the postinstall script — don't move them manually. WASM logic is browser-only; do not attempt to run it in Node.
Conventions
'use client'only where needed (WASM, browser APIs, interactive state). Default to RSC.- Styling: Tailwind CSS 4 with CSS-first config in
app/globals.css. Usecn()fromlib/utils/cn.tsfor conditional classes. Use@utility glassfor glassmorphic effects and gradient utilities (gradient-purple-blue, etc.). - Icons: Lucide React exclusively.
- Imports: Use
@/path alias (resolves to project root). - Components: shadcn/ui from
components/ui/as building blocks. - Logic/UI separation: Business logic in
lib/, UI incomponents/. Keep them separate.
Deployment
Static export (output: 'export' in next.config.ts) served by Nginx via Docker. No Node.js runtime in production.
docker build -t kit-ui .
docker run -p 80:80 kit-ui
PWA
Service worker at public/sw.js pre-caches core assets and WASM binaries. Manifest generated from app/manifest.ts (force-static). Cache version: kit-ui-v1.