top | item 16915293

Show HN: JSON storage bins with schema validation

74 points| azirbel | 7 years ago |npoint.io

19 comments

order
[+] azirbel|7 years ago|reply
Hi HN! This is a side project I've been working on for a while now.

It's similar to https://jsonbin.io (which was an inspiration!), but focuses on the second step of prototyping with data - once you're editing JSON online, how do you make sure you don't break your app? npoint.io lets you enforce a structure using JSON schema (http://json-schema.org).

More background info: http://alexzirbel.com/npoint

Also, it's open source! https://www.github.com/azirbel/npoint

All feedback is super welcome. Also happy to answer any questions here.

[+] peterwwillis|7 years ago|reply
Could you add that to your FAQ? I was like, what the heck is a json bin, what is actually validating this schema, is this something I run on my machine or in the cloud, is this self-hostable, how am I supposed to actually use any of this, what am I suposed to use it for, etc. Cloning jsonbin's about page would be great.
[+] koolba|7 years ago|reply
Looks nice. Having the immediate "Click here" that leads into the edit page with the double paned edit window is particularly cool.

Watch out with providing a hosted version of something like this with totally untrusted user input. JSON schema allows for arbitrary regexes for field validation which means a malicious user could easily bring down the site with a nasty regex[1]. Not a concern for anything privately hosted but sadly there are plenty of jerks in the world.

[1]: https://www.owasp.org/index.php/Regular_expression_Denial_of...

[+] azirbel|7 years ago|reply
Ouch, that would suck. Thanks for the heads-up.
[+] zerkten|7 years ago|reply
"Once a bin is locked, it cannot be deleted and none of its data can ever be changed."

I can understand why there is good reason for the data to never change, but if your product gets popular, or you are unlucky, then this could turn out to be a bad design choice i.e. Bob copies and pastes data containing customer PII in instead of the data they meant to include.

An option for data to be deleted, even if it's after multiple prompts, or a streamlined support flow.

[+] azirbel|7 years ago|reply
That's a good point. Since I don't have that feature, I'll be happy to remove data manually if it ever comes up.
[+] andrenotgiant|7 years ago|reply
interesting - If I understand it right, I ran into a possible use-case for n:point recently...

I was building a pretty simple charting app that used React and Redux, so the structure of a chart was 100% defined via a JSON "state".

I didn't want to bother with a server so I just stored the state in browser localstorage.

BUT when I put the app online via static hosting, I needed to give users a way of deeplinking to and sharing a diagram they created.

Could I use n:point via API to set and get json state and then add your identifiers in an anchor tag like:

http://my-static-chart-app.com/#4aed7cea56ece156c705

[+] azirbel|7 years ago|reply
That sounds like a perfect way to use it.

Here's an example of charting data, using npoint.io as the data storage "backend":

https://beta.observablehq.com/@azirbel/npoint-io-charting-de...

If you made a charting app that used an anchor tag to load data like you described, and made the resulting chart embeddable, I'd actually be interested in using it to power charts in blog posts. Cool idea.

[+] baus|7 years ago|reply
Interesting idea. I read your blog post on the project, and understand your point on user management. I've hit the same stumbling block with projects I've been working on -- too much time spent on user management. There seems to be few off-the-shelf solutions for writing user management for SPAs and everyone recreates the wheel.
[+] pobo|7 years ago|reply
neat, i like the design. Just wondering how would you monetize such an app. maybe you can add ads here and there.
[+] azirbel|7 years ago|reply
Easy - I'll just inject text-based ads into the saved data!

(Kidding, of course...)

I think it's unlikely that this site can be monetized, so I don't have my hopes up. The clearest direction would be to move up the "backend-as-a-service" spectrum into Headless CMS land (which I have a diagram for here: http://alexzirbel.com/npoint). But I think it would be hard to balance that with the quick setup / unstructured data nature of the project.

One feature (maybe a premium feature) I'd love to add is form-based data editing. Theoretically you could generate the right kind of input fields (text, date, number) from the JSON schema and expose that as alternative editing interface. That would make the tool more like a CMS.

[+] tathougies|7 years ago|reply
Random question... where did you get the art you used to make the website? Did you do it yourself?
[+] azirbel|7 years ago|reply
Made it myself in Sketch! It took me forever, I'll probably find a real illustrator next time.