Instantly convert JSON to TypeScript, Zod & Prisma schemas
JSONCraft is a fast, open-source developer tool that converts raw JSON into production-ready schemas. Paste your JSON, generate TypeScript interfaces, Zod validation schemas, and Prisma models instantly, then share with a unique link.
- TypeScript Interfaces: Generate clean, properly typed interfaces with nested object support
- Zod Schemas: Create validation schemas with type inference for runtime safety
- Prisma Models: Generate database models ready for your Prisma schema
- Smart Type Detection: Automatically infers types including integers, floats, dates, booleans, and nullables
- Permanent URLs: Share conversions with unique, permanent links (
/s/[slug]) - Read-Only Viewer: Beautiful public pages for shared conversions
- No Authentication: Zero friction - just paste, convert, and share
- Monaco Editor: Full-featured VS Code editor experience in the browser
- Dark/Light Mode: Seamless theme switching with system preference support
- Keyboard Shortcuts:
Ctrl+Enterto convert,Ctrl+Bto format JSON - Copy & Download: One-click copy to clipboard or download as files
- Real-time Validation: Instant JSON error feedback with line numbers
- Zero Configuration: No complex setup - works out of the box
- Fast Performance: Conversions in <100ms, optimized bundle size
- Responsive Design: Works perfectly on mobile, tablet, and desktop
- Open Source: MIT licensed, fully transparent codebase
| Category | Technologies |
|---|---|
| Frontend | Next.js 15 (App Router), React 19, TypeScript 5 |
| Styling | Tailwind CSS, shadcn/ui, Radix UI, Lucide Icons |
| Code Editor | Monaco Editor (VS Code engine) |
| State Management | Zustand, TanStack React Query |
| Database | Supabase (PostgreSQL) |
| Backend | Next.js API Routes, Supabase Client |
| Authentication | None (Public access) |
| Utilities | nanoid, axios, date-fns, next-themes |
- Node.js 18.x or higher
- npm or yarn or pnpm
- Supabase Account (for database and sharing features)
-
Clone the repository
git clone https://github.com/akshadjaiswal/json-craft.git cd json-craft/frontend -
Install dependencies
npm install # or yarn install # or pnpm install
-
Set up environment variables
Create a
.env.localfile in the frontend directory:# Supabase Configuration NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key # Optional: Base URL for production NEXT_PUBLIC_BASE_URL=http://localhost:3000
-
Set up Supabase Database
Run this SQL in your Supabase SQL Editor:
-- Create conversions table create table conversions ( id uuid primary key default gen_random_uuid(), slug text unique not null, json_input text not null, ts_output text not null, zod_output text not null, prisma_output text not null, created_at timestamptz not null default now() ); -- Enable Row Level Security alter table conversions enable row level security; -- Allow public read access create policy "Allow public read" on conversions for select using (true); -- Allow public insert create policy "Allow public insert" on conversions for insert with check (true);
-
Run the development server
npm run dev # or yarn dev # or pnpm dev
-
Open the app
Navigate to http://localhost:3000 in your browser.
frontend/
├── app/
│ ├── (home)/
│ │ └── page.tsx # Landing page
│ ├── editor/
│ │ └── page.tsx # Main editor interface
│ ├── s/[slug]/
│ │ └── page.tsx # Shared conversion viewer
│ ├── api/
│ │ ├── save/
│ │ │ └── route.ts # POST - Save conversion
│ │ └── shared/[slug]/
│ │ └── route.ts # GET - Fetch conversion
│ ├── layout.tsx # Root layout with providers
│ └── globals.css # Global styles & Tailwind
│
├── components/
│ ├── editor/
│ │ ├── code-editor.tsx # Monaco Editor wrapper
│ │ ├── json-input-panel.tsx # JSON input with controls
│ │ ├── output-tabs.tsx # TS/Zod/Prisma tabs
│ │ ├── editor-toolbar.tsx # Convert & Share toolbar
│ │ └── share-dialog.tsx # Share modal
│ ├── landing/
│ │ ├── hero-section.tsx # Hero with CTA
│ │ ├── features-section.tsx # 6 feature cards
│ │ ├── how-it-works.tsx # 3-step process
│ │ ├── examples-preview.tsx # Code examples
│ │ └── footer.tsx # Footer with links
│ ├── ui/ # shadcn/ui components
│ │ ├── button.tsx
│ │ ├── tabs.tsx
│ │ ├── card.tsx
│ │ ├── dialog.tsx
│ │ ├── toast.tsx
│ │ └── theme-toggle.tsx
│ └── providers/
│ └── theme-provider.tsx # next-themes wrapper
│
├── lib/
│ ├── converters/
│ │ ├── json-to-typescript.ts # TypeScript generator
│ │ ├── json-to-zod.ts # Zod schema generator
│ │ └── json-to-prisma.ts # Prisma model generator
│ ├── stores/
│ │ └── editor-store.ts # Zustand state management
│ ├── api/
│ │ └── conversions.ts # TanStack Query hooks
│ ├── utils/
│ │ ├── json-validator.ts # JSON validation
│ │ ├── slug-generator.ts # Unique slug generation
│ │ ├── keyboard-shortcuts.ts # Keyboard shortcuts hook
│ │ └── utils.ts # Utility functions
│ ├── supabase/
│ │ ├── client.ts # Browser Supabase client
│ │ └── server.ts # Server Supabase client
│ └── query-provider.tsx # TanStack Query provider
│
├── types/
│ └── conversion.ts # TypeScript type definitions
│
├── hooks/
│ └── use-toast.ts # Toast notification hook
│
├── public/ # Static assets
├── package.json
├── tsconfig.json
├── tailwind.config.js # Custom theme configuration
└── next.config.js
User pastes JSON
↓
Validate JSON syntax
↓
Parse and analyze structure
↓
Generate TypeScript interfaces
↓
Generate Zod validation schemas
↓
Generate Prisma database models
↓
Display in Monaco Editor tabs
↓
User can copy, download, or share
User clicks "Share"
↓
Generate unique 8-character slug (nanoid)
↓
Save JSON + outputs to Supabase
↓
Create shareable URL: /s/[slug]
↓
Display link with copy button
↓
Anyone can view via public URL
- Strings: Regular strings, date strings (
DateTimefor ISO dates) - Numbers:
Intfor integers,Floatfor decimals - Booleans:
booleantype - Null values: Marked as nullable/optional
- Objects: Nested interfaces with proper naming
- Arrays: Typed arrays with element type inference
- Create a new project at Supabase
- Go to Project Settings → API
- Copy:
- Project URL →
NEXT_PUBLIC_SUPABASE_URL anon publickey →NEXT_PUBLIC_SUPABASE_ANON_KEY
- Project URL →
- Run the SQL migration provided in the Quick Start section
- Your database is ready!
For production deployments (Vercel, Netlify, etc.):
NEXT_PUBLIC_BASE_URL=https://your-domain.comThis ensures share links use your production domain.
| Shortcut | Action |
|---|---|
Ctrl + Enter |
Convert JSON to schemas |
Ctrl + B |
Format JSON (beautify) |
Ctrl + / |
Toggle comments (in editor) |
Primary: #6366F1 (Indigo)
Accent: #22C55E (Green)
Dark Background: #0F1117
Neutral: #E5E7EB- Sans-serif: Inter, system-ui
- Monospace: Consolas, Monaco (code editor)
- Border Radius: 0.5rem (8px)
- Shadows: Subtle shadows for depth
- Transitions: Smooth 200ms transitions
| Column | Type | Description |
|---|---|---|
id |
uuid | Primary key (auto-generated) |
slug |
text | Unique 8-character identifier |
json_input |
text | Original JSON input |
ts_output |
text | Generated TypeScript code |
zod_output |
text | Generated Zod schema |
prisma_output |
text | Generated Prisma model |
created_at |
timestamptz | Timestamp of creation |
- ✅ Public read access (view shared conversions)
- ✅ Public insert access (create conversions)
- ❌ No update or delete (permanent records)
We welcome contributions! Here's how:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Make your changes
- Commit with conventional commits
git commit -m "feat: add amazing feature" - Push to your fork
git push origin feature/amazing-feature
- Open a Pull Request
Follow Conventional Commits:
feat:- New featuresfix:- Bug fixesdocs:- Documentation changesstyle:- Code style (formatting)refactor:- Code refactoringtest:- Adding testschore:- Maintenance
This project is licensed under the MIT License - see the LICENSE file for details.
Akshad Jaiswal
- GitHub: @akshadjaiswal
- Twitter: @akshad_999
- Next.js - The React Framework for Production
- Monaco Editor - VS Code's powerful editor
- Supabase - Open source Firebase alternative
- shadcn/ui - Beautiful component library
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Unstyled, accessible components
- TanStack Query - Powerful data synchronization
- Zustand - Lightweight state management
Need help? Have questions?
- Open an Issue
- Start a Discussion
- Follow updates on Twitter
Made with ❤️ for developers who love clean code