Live data from Hacker News

Ask HN: Easiest way to build a CRUD app?

news.ycombinator.com

161–170 of 239 posts

Re: Ask HN: Easiest way to build a CRUD app?

#161
I specifically wrote a starter kit/framework to solve this problem -- at least for me, and hopefully for others: https://nodewood.com/

Since you'll be running JavaScript in the browser, it also uses Node.js for the backend. This allows you to use the same code for validation, business logic, etc, and it specifically has multiple patterns to encourage this.

It's all one bundle that you run locally (or on one machine in production, or two if you want to split out the DB, which I'd recommend). By default, it uses Docker to run locally, but I've included instructions to run it on bare-metal, if you choose. For subscriptions, I use Stripe, but I mean you gotta use _someone_ for that, and I found their API to be easiest to work with, and thus modify.

I specifically built it so that I wouldn't have to keep re-creating the wheel when I wanted to try out a new SaaS idea as just one person, so it should work just fine for someone who doesn't want to require a team, but it should also work well for people who do want to scale to teams: one of the core components is that you break up work into "features" which are directories that repeat the common subdirectories (api, lib, ui) and make it easy to keep commonly-used code together.

Full docs are available publicly on the site, and if you have any questions, I'm more than happy to answer!

Re: Ask HN: Easiest way to build a CRUD app?

#162
post #56

I'll probably be a minority here, but I'd say: java + Vaadin [1] + raw jdbc (no ORM nonsense). On Vaadin site, you can use starter [2] to create an app template. There is no need to write javascript; most Vaadin code looks like good old desktop programming. Due Java stability, that thing will run forever and will be performant. If you want to be "cloud native" (or whatever cool name now is) in the future, you can lat…

Vaadin is interesting, and choice of java is ok (though I prefer Kotlin).

But raw jdbc in 2022 is absolutely bonkers. If you don't prefer ORMs that's ok, but a light abstraction like SQLDelight or Spring data jdbc (if you prefer working with SQL) or a query builder like jOOQ (if you like type-safety) can make your life simpler by an order of magnitude.

Re: Ask HN: Easiest way to build a CRUD app?

#163

If this isn't a business application, ignore this entire comment. If it is a business application, you probably shouldn't build a CRUD app, at least not the way that's commonly understood. Stick with me for a minute. First off, you must never delete business data (except per GDPR, retention policies, or other legal requirements). I'm sure someone will pipe in with a contrived use case where you would want to, but in…

[deleted]

Re: Ask HN: Easiest way to build a CRUD app?

#164

If this isn't a business application, ignore this entire comment. If it is a business application, you probably shouldn't build a CRUD app, at least not the way that's commonly understood. Stick with me for a minute. First off, you must never delete business data (except per GDPR, retention policies, or other legal requirements). I'm sure someone will pipe in with a contrived use case where you would want to, but in…

We just use our log as a history if we need it. We very rarely need it.

Obviously it depends upon your exact domain. But overbuilding history can be a mistake too.

Re: Ask HN: Easiest way to build a CRUD app?

#165

Your requirements are contradictory and incomplete: - No single language can do all of that successfully, unless you ditch GUI and client-server models - Without external dependencies you will either be reinventing the wheel or adding lots of layers - All software will require maintenance, more layers equal more maintenance - All software can be compromised or hacked, more layers equal more attack surface - If it has…

> If it is a single-user, single-machine "app", you could use a plain UTF-8 text file which can be read and written to by any relevant text editor. No app is the best app in this case. This does depend in what kind of information you intend to CRUD.

I would similarly say a Rails app that uses a filesystem DB for records, sessions, logging, etc despite never having touched Ruby more than 3 times in the last 2 decades.

Many of your listed points are puzzling though.

> No single language can do all of that successfully, unless you ditch GUI and client-server models

There's nothing in the requirements about a GUI or client/server model. A CRUD app by API is pretty common.

> - Without external dependencies you will either be reinventing the wheel or adding lots of layers

No need for reinventing or using additional "layers" (whatever that's supposed to mean).

> - All software can be compromised or hacked, more layers equal more attack surface

"not easily" can be interpreted many ways, but assuring that nothing is 100% secure is irrelevant.

The question is quite sophisticated, within modern technology choices. However, the ease of CRUD app generation has been streamlined by Ruby to a ridiculous degree. Ruby has been great for this kind of thing for a long time, despite it's problems as a language for larger applications. People who are recommending Java, using Spring or not, are either ignorant or in denial. Java is a horrific choice for development speed and reliability for what amounts to requirements for a small application. Additionally, big/popular frameworks like Laravel/Django etc are also going to slower to develop and more problematic than a simple Rails app. This is primarily because of the ecosystems that shun the concept of a filesystem as a DB because it breaks their sensibilities about "the right way to do things".

Re: Ask HN: Easiest way to build a CRUD app?

#166
I reckon python bottle.py (or flask), psycopg2, with basic auth. And sqlite or postgres..

I tried django but spent more time trying to understand the magic. I like writing out my SQL in the endpoint function for readability.

Oh if you want GUI component as well. Jinja2 and Htmx.

Re: Ask HN: Easiest way to build a CRUD app?

#167
I am building something of this sort.

Im the app, if you have the right permission, you can use xml to describe tables, forms, and you can use lua to respond on the sever side to control and database events.

It is very staright forward, and you can do it all directly on the web.

It is still alpha, but if you are interested let me jnow and i will open a playground for you.

Re: Ask HN: Easiest way to build a CRUD app?

#169
For apps I've built in the past, I've found the hardest thing was having to pay monthly hosting costs for years (which is pretty much a necessity if you use a cloud SQL database that things like Rails and Django rely on heavily).

Even $10 a month becomes annoying after 5 years.

I built this: https://forever-free-cloud-app-starter.chriszhu.me/ as a way to build a basic CRUD app that would be free to host forever.

Re: Ask HN: Easiest way to build a CRUD app?

#170

Your requirements are contradictory and incomplete: - No single language can do all of that successfully, unless you ditch GUI and client-server models - Without external dependencies you will either be reinventing the wheel or adding lots of layers - All software will require maintenance, more layers equal more maintenance - All software can be compromised or hacked, more layers equal more attack surface - If it has…

Typescript/JS React FE + Node BE - one language.

No, that's more like four languages: Typescript, CSS, HTML and the JavaScript the TS gets compiled down to. You can't just write TS once, and never touch it again, because you are now targeting a webbrowser and running a webserver, and are probably using a billion NPM packages. None of those are 'static' for a year, let a long a 'long time'.
Post reply on HN