Giter Club home page Giter Club logo

triggerdotdev / jsonhero-web Goto Github PK

View Code? Open in Web Editor NEW
8.7K 46.0 444.0 57.51 MB

JSON Hero is an open-source, beautiful JSON explorer for the web that lets you browse, search and navigate your JSON files at speed. ๐Ÿš€. Built with ๐Ÿ’œ by the Trigger.dev team.

Home Page: https://jsonhero.io

License: Apache License 2.0

TypeScript 94.66% JavaScript 0.46% CSS 0.20% Dockerfile 0.04% MDX 4.64%
json developer-tools tools viewer devtools json-viewer react typescript hacktoberfest

jsonhero-web's Introduction

Trigger.dev logo

Open Bounties Rewarded Bounties

Brought to you by Trigger.dev

JSON Hero was created and is maintained by the team behind Trigger.dev. With Trigger.dev you can trigger workflows from APIs, on a schedule, or on demand. We make API calls easy with authentication handled for you, and you can add durable delays that survive server restarts.

JSON Hero

JSON Hero makes reading and understand JSON files easy by giving you a clean and beautiful UI packed with extra features.

  • View JSON any way you'd like: Column View, Tree View, Editor View, and more.
  • Automatically infers the contents of strings and provides useful previews
  • Creates an inferred JSON Schema that could be used to validate your JSON
  • Quickly scan related values to check for edge cases
  • Search your JSON files (both keys and values)
  • Keyboard accessible
  • Easily sharable URLs with path support

JSON Hero Screenshot

Features

Send to JSON Hero

Send your JSON to JSON Hero in a variety of ways

  • Head to jsonhero.io and Drag and Drop a JSON file, or paste JSON or a JSON url in the provided form

  • Include a Base64 encoded string of a JSON payload: jsonhero.io/new?j=eyAiZm9vIjogImJhciIgfQ==

  • Include a JSON URL to the new endpoint: jsonhero.io/new?url=https://jsonplaceholder.typicode.com/todos/1

  • Install the VS Code extension and open JSON from VS Code

  • Raycast user? Check out our extension here

  • Use the unofficial API:

    • Make a POST request to jsonhero.io/api/create.json with the following JSON body:
    {
      "title": "test 123",
      "content": { "foo": "bar" },
      "readOnly": false, // this is optional, will make it so the document title cannot be edited or document cannot be deleted
      "ttl": 3600 // this will expire the document after 3600 seconds, also optional
    }

    The JSON response will be the following:

    {
      "id": "YKKduNySH7Ub",
      "title": "test 123",
      "location": "https://jsonhero.io/j/YKKduNySH7Ub"
    }

Column view

Inspired by macOS Finder, Column View is a new way to browse a JSON document.

JSON Hero Column View

It has all the features you'd expect: Keyboard navigation, Path bar, history.

It also has a nifty feature that allows you to "hold" a descendent selected and travel up through the hierarchy, and then move between siblings and view the different values found at that path. It's hard to describe, but here is an animation to help demonstrate:

Column View - Traverse with Context

As you can see, holding the Option (or Alt key on Windows) while moving to a parent keeps the part of the document selected and shows it in context of it's surrounding JSON. Then you can traverse between items in an array and compare the values of the selection across deep hierarchy cahnges.

Editor view

View your entire JSON document in an editor, but keep the nice previews and related values you get from the sidebar as you move around the document:

Editor view

Tree view

Use a traditional tree view to traverse your JSON document, with collapsible sections and keyboard shortcuts. All while keeping the nice previews:

Tree view

Search

Quickly open a search panel and fuzzy search your entire JSON file in milliseconds. Searches through key names, key paths, values, and even pretty formatted values (e.g. Searching for "Dec" will find datetime strings in the month of December.)

Search

Content Previews

JSON Hero automatically infers the content of strings and provides useful previews and properties of the value you've selected. It's "Show Don't Tell" for JSON:

Dates and Times

Preview colors

Image URLs

Preview colors

Website URLs

Preview websites

Tweet URLS

Preview tweets

JSON URLs

Preview JSON

Colors

Preview colors

Related Values

Easily see all the related values across your entire JSON document for a specific field, including any undefined or null values.

Editor view

Bugs and Feature Requests

Have a bug or a feature request? Feel free to open a new issue.

You can also join our Discord channel to hang out and discuss anything you'd like.

Developing

To run locally, first clone the repo and install the dependencies:

git clone https://github.com/triggerdotdev/jsonhero-web.git
cd jsonhero-web
npm install

Then, create a file at the root of the repo called .env and set the SESSION_SECRET value:

SESSION_SECRET=abc123

Then, run npm run build or npm run dev to build.

Now, run npm start and open your browser to http://localhost:8787

jsonhero-web's People

Contributors

abhaykumarvats avatar boyum avatar cesaryuan avatar cool-runningz avatar d-k-p avatar dhaven avatar dmelancon avatar dsgdsr avatar ericallam avatar kit-p avatar kubahasek avatar kvooak avatar matt-aitken avatar michellbrito avatar mtmfahathdev avatar onecodemonkey avatar prasaya avatar raheelrjunaid avatar rahulkumarrv avatar samejr avatar sascha10000 avatar shanemaglangit avatar sshari avatar suven-p avatar tobihans avatar warpdesign avatar waunbroderick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jsonhero-web's Issues

Add a button to copy the path of a json field

At the top there is the breadcrumb shown anyways so adding a copy functionality sounds quite easy. I started to use JSON Hero at the start of this week and it is an awesome tool for huge JSON files with a lot of structure while developing. Second time I really need to get a path fairly deep nested and type it by hand.

e.g.: {
"someField": "a",
"someObj"": {
"someArray": [7,8,9]
}
}

When I now navigate to the 2nd element of the "someArray" it would be nice to copy that path for example like: "someObj.someArray[2]"

I would be open to implement it myself and contribute. if i find time this week. Thx for the great work and being OSS.

Crashes a few seconds after loading in browser

How to replicate:

  • Clone repo and npm install
  • npm start
  • Browse to http://localhost:8787
  • Wait for about 5 seconds

This error appears in the browser:

Error: Unexpected Server Error
    at handleDataRequest (/Users/scott/Tools/jsonhero-web/node_modules/@remix-run/server-runtime/esm/server.js:163:31)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at requestHandler (/Users/scott/Tools/jsonhero-web/node_modules/@remix-run/server-runtime/esm/server.js:41:20)
    at handleEvent (/Users/scott/Tools/jsonhero-web/node_modules/@remix-run/cloudflare-workers/esm/worker.js:98:18)
    at EventTarget.[kDispatchFetch] (/Users/scott/Tools/jsonhero-web/node_modules/@miniflare/core/src/standards/event.ts:359:13)
    at Server.<anonymous> (/Users/scott/Tools/jsonhero-web/node_modules/@miniflare/http-server/src/index.ts:168:20)

In the console:

[1] GET /build/routes/actions/getPreview.$url-JE4JRBGI.js 200 OK (6.18ms)
[1] ReferenceError: PEEKALINK_API_KEY is not defined
[1]     at getPeekalink (/Users/scott/Tools/jsonhero-web/app/services/uriPreview.server.ts:17:3)
[1]     at getUriPreview (/Users/scott/Tools/jsonhero-web/app/services/uriPreview.server.ts:71:33)
[1]     at processTicksAndRejections (node:internal/process/task_queues:96:5)
[1]     at loader2 (/Users/scott/Tools/jsonhero-web/build/route:/Users/scott/Tools/jsonhero-web/app/routes/actions/getPreview.$url.ts:10:18)
[1]     at callRouteLoader (/Users/scott/Tools/jsonhero-web/node_modules/@remix-run/server-runtime/esm/data.js:69:14)
[1]     at handleDataRequest (/Users/scott/Tools/jsonhero-web/node_modules/@remix-run/server-runtime/esm/server.js:125:18)
[1]     at requestHandler (/Users/scott/Tools/jsonhero-web/node_modules/@remix-run/server-runtime/esm/server.js:41:20)
[1]     at handleEvent (/Users/scott/Tools/jsonhero-web/node_modules/@remix-run/cloudflare-workers/esm/worker.js:98:18)
[1]     at EventTarget.[kDispatchFetch] (/Users/scott/Tools/jsonhero-web/node_modules/@miniflare/core/src/standards/event.ts:359:13)
[1]     at Server.<anonymous> (/Users/scott/Tools/jsonhero-web/node_modules/@miniflare/http-server/src/index.ts:168:20)
[1] GET /actions/getPreview/https%3A%2F%2Fwww.theonion.com%2F?_data=routes%2Factions%2FgetPreview.%24url 500 Internal Server Error (557.21ms)

(Why is it trying to load a page on theonion.com?)

My environment:
macOS 12.3.1, MacBook Air (M1, 2020)
Node v16.13.2
Firefox 100.0b9

Bug: Crash when change to dark mode / dark theme

Envirorment:

Hardware

Apple MacBook Pro with M1 Pro chip.

Software

MacOS 12.4

npm test

> test
> jest

 PASS  tests/formatStarCount.test.ts
 PASS  tests/search.test.ts
 PASS  tests/stableJson.test.ts
 PASS  tests/relatedValues.test.ts
  โ— Console

    console.log
      [
        { value: '1609937654', paths: [ '$.data.0.modifiedAt' ] },
        { value: 'null', paths: [ '$.data.1.modifiedAt' ] },
        { value: 'undefined', paths: [ '$.data.2.modifiedAt' ] }
      ]

      at Object.<anonymous> (tests/relatedValues.test.ts:174:13)

 PASS  tests/jsonColumnView.test.ts

Test Suites: 5 passed, 5 total
Tests:       14 passed, 14 total
Snapshots:   11 passed, 11 total
Time:        2.858 s
Ran all test suites.

npm --version

8.11.0

node -v

v18.3.0

Description

When I deployed this project on my own computer and try to switch from the light theme to the dark theme, then there will an error returned.

image

And here is the error log.

[1] TypeError: Value of "this" must be of type SubtleCrypto
[1]     at new NodeError (node:internal/errors:377:5)
[1]     at Proxy.importKey (node:internal/crypto/webcrypto:517:30)
[1]     at sign22 (/Users/user/Documents/gits/github/jsonhero-web/node_modules/@remix-run/cloudflare-workers/esm/cookieSigning.js:13:33)
[1]     at encodeCookieValue (/Users/user/Documents/gits/github/jsonhero-web/node_modules/@remix-run/server-runtime/esm/cookies.js:71:21)
[1]     at Object.serialize (/Users/user/Documents/gits/github/jsonhero-web/node_modules/@remix-run/server-runtime/esm/cookies.js:50:56)
[1]     at Object.commitSession (/Users/user/Documents/gits/github/jsonhero-web/node_modules/@remix-run/server-runtime/esm/sessions/cookieStorage.js:36:21)
[1]     at Object.commit (/Users/user/Documents/gits/github/jsonhero-web/app/theme.server.ts:30:32)
[1]     at action5 (/Users/user/Documents/gits/github/jsonhero-web/build/route:/Users/user/Documents/gits/github/jsonhero-web/app/routes/actions/setTheme.ts:31:51)
[1]     at processTicksAndRejections (node:internal/process/task_queues:95:5)
[1]     at callRouteAction (/Users/user/Documents/gits/github/jsonhero-web/node_modules/@remix-run/server-runtime/esm/data.js:32:14) {
[1]   code: 'ERR_INVALID_THIS'
[1] }
[1] POST /actions/setTheme?_data=routes%2Factions%2FsetTheme 500 Internal Server Error (598.38ms, waitUntil: 598.39ms)

No message if JSON is malformed

I used https://jsonhero.io to take a look at a dirty JSON, and it seems that the JSON contained a malformed field.
Until I cleaned that field I wasn't able to put it in the input to get it read.
However, no matter how many times I tried, it didn't said anything related to an error in the page, as if it wasn't working.

It happened to me in both Safari and Chrome.

A similar behaviour happens in #42 that no answer is given.

Reviewed the issues in the repo and found nothing (besides the other issue referenced) related to this.

Thank you :)

Support passing endpoint as URL param

To share JSON Hero with dynamic endpoint (e.g. IDs on an REST API documentation) would be necessary to pass endpoint through URL with something like https://jsonhero.io/new?url=https://someapi.io/v1/id, right?
It's already possible? If not, wdyt about this feature?

Progressive Web App integration

It would be nice if this site could be contained as a PWA so that it can have its own window. I have an iPad and I recently discovered how pwa's are supported full screen if you add a safari site to the Home Screen

vscode plugin?

HI! really love the jsonhero seems awesome. but what I really dream of is having it inside VScode.
is this possible?

JSON hero does not allow you to open large JSON files

Currently, as of 4/29/22, if you attempt to open a large JSON file (around 22MB), the site does not allow you to open it. It simply acts as if you selected no file!

Usecase : Using JSON hero to browse log files & other automatically generated datastructures.

Add ability to make documents read-only

Currently whoever has access to a jsonhero.io url can edit the title. We should support adding a readonly=true flag to the /new endpoint to make it so the title cannot be editable. This would allow sharing of jsonhero.io urls publicly more safe as the title would not be able to be edited maliciously.

Edit option in JsonHero

I have installed the extension 'jsonhero.io tools for VS Code'. It opens the .json file in the browser but it does not have an edit option. Could you please let me know where do I get the edit option when the file opens in the browser. Thanks.

[Chore] Investigate developing with node.js 18

It looks like this error reported to us could be caused by node.js 18:

[1] [mf:wrn] Cache operations will have no impact if you deploy to a workers.dev subdomain!
[1] TypeError: Value of "this" must be of type Crypto
[1]     at new NodeError (node:internal/errors:372:5)
[1]     at getRandomValues (node:internal/crypto/webcrypto:732:11)
[1]     at Proxy.<anonymous> (/Users/.../Desktop/JS/jsonhero-web/node_modules/@miniflare/core/src/standards/helpers.ts:35:16)
[1]     at /Users/.../Desktop/JS/jsonhero-web/app/jsonDoc.server.ts:115:14
[1]     at /Users/.../Desktop/JS/jsonhero-web/node_modules/nanoid/index.js:26:19
[1]     at createId (/Users/.../Desktop/JS/jsonhero-web/app/jsonDoc.server.ts:119:10)
[1]     at createFromRawJson (/Users/.../Desktop/JS/jsonhero-web/app/jsonDoc.server.ts:67:17)
[1]     at createFromUrlOrRawJson (/Users/.../Desktop/JS/jsonhero-web/app/jsonDoc.server.ts:36:12)
[1]     at action2 (/Users/.../Desktop/JS/jsonhero-web/build/route:/Users/.../Desktop/JS/jsonhero-web/app/routes/actions/createFromUrl.ts:26:21)
[1]     at processTicksAndRejections (node:internal/process/task_queues:95:5) {
[1]   code: 'ERR_INVALID_THIS'
[1] }
[1] POST /actions/createFromUrl?_data=routes%2Factions%2FcreateFromUrl 500 Internal Server Error (1157.81ms)

Bug: Previewing an image URL that has no extension, and does not allow HEAD requests, results in a missing preview

For example, this URL does not currently have a preview:

https://picsum.photos/64/64?random:

Broken Preview

The getUriPreview function tries to do a HEAD request on this URL to determine if it's content is an image, but that results in a 405 Method Not Allowed response.

If you do request this URL with a GET request you get a 302 Found response with a location of https://i.picsum.photos/id/29/64/64.jpg?hmac=XAo2bhXlNLP-fdYM8H7kGqAWkIi0E8hywUNIYyZrokc.

Doing a HEAD request on that URL results in a 200 OK with a Content-Type of image/jpeg

The Search shortcut doesn't work on Microsoft Edge

Solution

  • Stop Edge from bringing up the search. This is what other products like Slack do.

event.preventDefault() is already there so it might be that we need to use key down instead of key up. Requires investigation

Bug: crash when url isn't JSON (e.g. is HTML login page)

When I open jsonhero with the following json

{"url":"http://www.google.com/calendar/event?action=TEMPLATE&dates=20220707T103000Z%2F20220707T120000Z&text=bug&location=Nh%C3%A0%20h%C3%A0ng%20Tr%E1%BA%A7u%20Cau%202%2C%20%C4%90%C6%B0%E1%BB%9Dng%20L%C3%AA%20L%E1%BB%A3i%2C%20H%E1%BA%A3i%20C%E1%BA%A3ng%2C%20Th%C3%A0nh%20ph%E1%BB%91%20Qui%20Nh%C6%A1n%2C%20B%C3%ACnh%20%C4%90%E1%BB%8Bnh%2C%20Vi%E1%BB%87t%20Nam"}

I got this error
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.