PDJsonEditor
ķźµģ“
A powerful JSON visualization and editing tool built with SvelteKit and Svelte 5. View and edit JSON data simultaneously in both code editor and interactive graph views.
š Live Demo
⨠Features
š Advanced JSON Editor
- Syntax Highlighting: CodeMirror-powered editor with JSON syntax highlighting
- Real-time Validation: Instant JSON syntax validation and error reporting
- Format & Minify: One-click JSON formatting and minification
- Navigation: Click on graph nodes to jump to corresponding JSON location
š HTTP Request Integration
- Multi-Method Support: GET, POST, PUT, DELETE, PATCH requests
- Custom Headers: Add and manage HTTP headers
- Request Body: Configure custom request bodies for POST/PUT/PATCH
- URL Import: Fetch JSON data directly from URLs
š Interactive Graph Visualization
- Tree Structure: Visualize JSON as an interactive tree graph
- Compact Nodes: Compact display grouping primitive values
- Expand/Collapse: Toggle node expansion with visual indicators
- Reference Navigation: Navigate between related objects and arrays
- Auto Layout: Dagre-powered automatic graph layout
šÆ Smart Node Display
- Grouped Primitives: Primitive values grouped in parent nodes for clarity
- Reference Types: Objects and arrays shown as references (e.g.,
address {3}
, hobbies [3]
)
- Show More: Automatically collapse nodes with 20+ items with "show more" functionality
- Individual Toggles: Expand/collapse individual reference items
š Internationalization
- Multi-language: English and Korean support
- Language Switcher: Easy language switching in header
- Persistent Settings: Language preference saved in localStorage
š Getting Started
Prerequisites
- Node.js v20.19 or higher
- npm or yarn package manager
Installation
- Clone the repository
git clone https://github.com/podosoft-dev/pdjsoneditor.git
cd pdjsoneditor
- Install dependencies
npm install
- Start development server
npm run dev
- Open in browser
http://localhost:5173
Building for Production
# Build the application
npm run build
# Preview the build
npm run preview
Docker Deployment
Using Pre-built Image from GitHub Container Registry
# Pull the latest image
docker pull ghcr.io/podosoft-dev/pdjsoneditor:latest
# Run the container
docker run -d -p 3000:3000 --name pdjsoneditor ghcr.io/podosoft-dev/pdjsoneditor:latest
# Stop the container
docker stop pdjsoneditor
# Remove the container
docker rm pdjsoneditor
Building from Source
# Build Docker image
docker build -t pdjsoneditor .
# Run the container
docker run -d -p 3000:3000 --name pdjsoneditor pdjsoneditor
# Stop the container
docker stop pdjsoneditor
# Remove the container
docker rm pdjsoneditor
Using Docker Compose
# Build and start the container
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the container
docker-compose down
# Rebuild and start
docker-compose up -d --build
Using Docker Compose with Pre-built Image
Create a docker-compose.yml
with the pre-built image:
version: '3.8'
services:
pdjsoneditor:
image: ghcr.io/podosoft-dev/pdjsoneditor:latest
container_name: pdjsoneditor
ports:
- '3000:3000'
restart: unless-stopped
Then run:
docker-compose up -d
Access the application at http://localhost:3000
š Usage
Basic JSON Editing
- Paste or type JSON in the left editor panel
- View the structure in the right graph panel
- Navigate between views by clicking nodes or using the editor
Fetching Data from URLs
- Select HTTP method from the dropdown (GET, POST, PUT, DELETE, PATCH)
- Enter the URL in the input field
- Configure headers and body using the Settings button (optional)
- Click "Go" to fetch and load the JSON data
Graph Interaction
- Expand/Collapse: Click the colored handles on nodes
- Show More: Click "Show more" on nodes with many items
- Navigate: Click nodes to jump to corresponding JSON location
š ļø Tech Stack
š License
This project is licensed under the MIT License.
š Support
If you encounter any issues or have questions, please open an issue on GitHub.