Sign inSign up

xuye0/jsonhero

By xuye0

•Updated 6 months ago

Image
0

878

xuye0/jsonhero repository overview

⁠JSON Hero

Self-hosted JSON Hero⁠ packaged as a Docker image.

JSON Hero is a web app for exploring JSON with a clean UI and useful tooling:

  • Column view, tree view, and editor view
  • Search across keys and values
  • Smart previews for URLs, dates, colors, images, and more
  • Inferred schema and related value inspection
  • SQLite-based local document storage for simple self-hosting

Source repository: https://github.com/triggerdotdev/jsonhero-web⁠

⁠Quick Start

docker pull xuye0/jsonhero:latest

mkdir -p data

docker run -d \
  --name jsonhero \
  --restart unless-stopped \
  -p 3000:3000 \
  -e SESSION_SECRET=$(openssl rand -hex 32) \
  -v $(pwd)/data:/app/data \
  xuye0/jsonhero:latest

Open http://localhost:3000.

⁠Startup Parameters

Recommended startup command:

docker run -d \
  --name jsonhero \
  --restart unless-stopped \
  -p 3000:3000 \
  -e SESSION_SECRET=$(openssl rand -hex 32) \
  -v $(pwd)/data:/app/data \
  xuye0/jsonhero:latest

Parameter reference:

  • -d: run in the background
  • --name jsonhero: set the container name
  • --restart unless-stopped: auto-start after Docker restarts
  • -p 3000:3000: map host port 3000 to container port 3000
  • -e SESSION_SECRET=...: session signing secret; set your own value in production
  • -v $(pwd)/data:/app/data: persist SQLite data on the host
  • xuye0/jsonhero:latest: image name and tag

⁠Environment Variables

  • SESSION_SECRET Required for production use. If omitted, the container falls back to change-me-in-production, which is not secure.

  • PORT Internal listening port for the app. Default: 3000.

  • DOCUMENTS_DB_PATH SQLite database path inside the container. Default: /app/data/documents.db.

  • APIHERO_PROJECT_KEY Optional.

⁠Common Run Commands

Minimal run without persistent storage:

docker run --rm \
  -p 3000:3000 \
  -e SESSION_SECRET=test-secret \
  xuye0/jsonhero:latest

Production-style run with persistent storage:

mkdir -p data

docker run -d \
  --name jsonhero \
  --restart unless-stopped \
  -p 3000:3000 \
  -e SESSION_SECRET=$(openssl rand -hex 32) \
  -v $(pwd)/data:/app/data \
  xuye0/jsonhero:latest

Use a different host port while keeping the container on port 3000:

docker run -d \
  --name jsonhero \
  -p 8080:3000 \
  -e SESSION_SECRET=$(openssl rand -hex 32) \
  -v $(pwd)/data:/app/data \
  xuye0/jsonhero:latest

Change the internal app port as well:

docker run -d \
  --name jsonhero \
  -p 8080:8080 \
  -e PORT=8080 \
  -e SESSION_SECRET=$(openssl rand -hex 32) \
  -v $(pwd)/data:/app/data \
  xuye0/jsonhero:latest

Use a custom database path:

mkdir -p db

docker run -d \
  --name jsonhero \
  -p 3000:3000 \
  -e SESSION_SECRET=$(openssl rand -hex 32) \
  -e DOCUMENTS_DB_PATH=/app/db/documents.db \
  -v $(pwd)/db:/app/db \
  xuye0/jsonhero:latest

⁠Data Persistence

JSON Hero stores documents in a local SQLite file.

  • Default database path in the container: /app/data/documents.db
  • If you do not mount a volume, deleting the container deletes the stored data

⁠Update the Container

docker pull xuye0/jsonhero:latest
docker rm -f jsonhero

docker run -d \
  --name jsonhero \
  --restart unless-stopped \
  -p 3000:3000 \
  -e SESSION_SECRET=$(openssl rand -hex 32) \
  -v $(pwd)/data:/app/data \
  xuye0/jsonhero:latest

⁠Notes

  • The image exposes port 3000 by default
  • Documents are stored locally in SQLite, not a managed cloud database
  • For persistent deployments, always mount a volume and set a strong SESSION_SECRET

Tag summary

Content type

Image

Digest

sha256:d30260f63…

Size

98.7 MB

Last updated

6 months ago

docker pull xuye0/jsonhero