Live data from Hacker News

Show HN: Caffeine – Minimum viable back end for prototyping

github.com

31–40 of 83 posts

Re: Show HN: Caffeine – Minimum viable back end for prototyping

#31

A few requests should randomly fail to force the developer to think about handling errors. :)

Hah! I'm not sure my MVP has ever had error handling beyond "Something went wrong.". That's something for a real production app, not the minimum possible product.

[deleted]

Re: Show HN: Caffeine – Minimum viable back end for prototyping

#32

Like the idea. Any user auth? I wonder if parse is still around and supported? I thought that was pretty good for this kinda thing.

I think auth is the trickiest thing to solve in a BaaS solution. Could not find anything in the readme about it.

Re: Show HN: Caffeine – Minimum viable back end for prototyping

#33
post #16
post #2

A very basic REST service for JSON data - enough for prototyping and MVPs! Features: no need to set up a database, all data is managed automagically* REST paradigm CRUD for multiple entities/namespaces schema validation search using jq like syntax CORS enabled easy to deploy as container

Just a heads-up, you might want to take down the example website. Now that it's been posted to HN you might see malicious actors. I also think it's prone to SQL injection at the moment? At least, it's raising a syntax error when inputting an apostrophe.

Why? That shows important information about the quality of the product.

Re: Show HN: Caffeine – Minimum viable back end for prototyping

#34
post #20

FYI, there is a name clash with Caffeine, a Mac OS menu bar app that keeps the screen awake: https://intelliscapesolutions.com/apps/caffeine . But I guess this is expected with a name like this, and the scopes of the projects are clearly different, so this should be relatively harmless.

You don't need an app. `caffeinate` is a command line utility built into macOS.

Re: Show HN: Caffeine – Minimum viable back end for prototyping

#35

This is useful. But you can achieve the same results in just a few more steps with Hasura or Supabase and end up with something that is close to production ready.

Yeah, I would probably go hasura if I needed this, but I can see the appeal of something that is a single component you can self host and self understand. Hasura is rock solid, but I will never read through it‘s haskell source or understand how it constructs those extra-clever postgres queries.

If I read it right, you don‘t need to configure any schema to use this? You can just POST a user and it will create that type? If it‘s true, that‘s a real step above hasura/supabase for rapid prototyping.

Re: Show HN: Caffeine – Minimum viable back end for prototyping

#38

Like the idea. Any user auth? I wonder if parse is still around and supported? I thought that was pretty good for this kinda thing.

Parse is still around and supported: https://github.com/parse-community/parse-server

This is bizarre. I spent a good 5+ min looking over the README and documentation site, and couldn’t find out what that project is other than “a backend that runs on Nodejs.” Yeah ok but what is it? Why am I interested? I’m not looking to be sold, just for it to tell me what it’s for. I have some assumptions based on how I got linked there, but this is surprising to me.

Re: Show HN: Caffeine – Minimum viable back end for prototyping

#39
post #6

Feature request: supply .json file via command line to pre-load data into the in-memory database. Taking it even further; how about persisting the data in the file? Sometimes your prototype will need some pre-added data so I think this might be useful.

I have used WireMock in the past that supports pre-defined mocks. It can be run both locally and as a service (I only ran it locally)

http://wiremock.org/

It's more complex than Caffeine, but it has a lot of options.

It can also run as a proxy and generate the mocks from actual http requests passing through the proxy

Re: Show HN: Caffeine – Minimum viable back end for prototyping

#40
post #16
post #2

A very basic REST service for JSON data - enough for prototyping and MVPs! Features: no need to set up a database, all data is managed automagically* REST paradigm CRUD for multiple entities/namespaces schema validation search using jq like syntax CORS enabled easy to deploy as container

Just a heads-up, you might want to take down the example website. Now that it's been posted to HN you might see malicious actors. I also think it's prone to SQL injection at the moment? At least, it's raising a syntax error when inputting an apostrophe.

Yes, don't do this:

https://github.com/rehacktive/caffeine/blob/master/database/...

"INSERT INTO %v (id, data) VALUES('%v','%v') ON CONFLICT (id) DO UPDATE SET data = '%v'"

Use prepared statements and parameters passed to the db driver, not building strings with strings or you are vulnerable to sqli.

I'd also avoid using %v anyway when building strings - safer to use a specific type like %d for int.

Post reply on HN