Live data from Hacker News

Ask HN: Easiest way to build a CRUD app?

news.ycombinator.com

101–110 of 239 posts

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

#101

Also, whatever happened to zope and plone? [2006] https://archive.org/details/SeanKellyGettingYourFeetWetwithP...

They were complex to use and run. You have to learn many concepts which are entirely unique to that ecosystem, and are not very reusable elsewhere. I've been writing Python professionally for over a decade now and I've never come across an app built with Zope/Plane that hadn't been replaced long ago.

They're really quite clever, but they just did too much too differently.

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

#102

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…

Yes. Anyone that's worked with accounting software knows this. There is no delete or update. It would insane to update a transaction that happened three months ago. You have to do a reverse transaction.

Actually, MediaWiki works the same way. You can see the history.

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

#103
Lots of variables in your question.

For simple stuff I am a big believer in building backends with tools like Strapi, it's hard to beat for MVP

For more customized stuff I do believe Rails is still the safest choice in terms of ease of use, docs, learning resources, community, available libraries and integrations, etc. etc. Close 2nd/3rd probably something like Django or Express.js based stuff.

For more complex stuff my weapon of choice is Elixir/Phoenix/LiveView - hard to beat for actual web projects that need to handle some traffic. I am actually close to believing that there's probably nothing better suited for web projects than Erlang BEAM.

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

#104
Two thoughts:

* you didn't specify anything the app *should* do besides "CRUD". You'll get better answers if you can say more about your needs and goals.

* some of the given requirements are mutually contradictory - "no services / SaaS" and "doesn't require a lot of maintenance", for instance. Part of the tradeoff you make using third-party services is "risk of them disappearing" vs "maintenance effort reduction".

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

#105
When I need a simple-ish CRUD app, I use Django. I know the parts I need to know, and learning wasn't too hard. The database schema lives in one easy to view/edit file, no need to both create language objects and write SQL. Jinja2 is the nicest templating language that's not HTML-specific. Deploymemt is easy enough.

That said, I have some issues with Django as well: Integrating JavaScript with the Django goodies (e.g. form system, CSRF prevention) is far from ideal. I remember spending hours to add a form field for multiple handwritten entries "properly", I ended up writing the form template manually and just not using the abstraction for that one field. It worked, but felt hacky. I now had rendering, parsing, and validation in two places.

Permissions are handled the way you'd probably expect them to be: Permissions are strings which users have and pages can require or check them. This is fine for most apps, but sometimes you want multiple views of the same data with complex permissions (e.g. the data determines whether the current user can see the item), Django provides little support there.

I also wish the Admin interface was easier to modify. It can be done, but feels to me like monkeypatching an existing app, not using an abstraction I could build an app on. It's probably meant that way, but I wish there was a framework with a less rigid analogue.

I'm slowly working on my own approach to tackle this problem, mostly focusing on declarative permissions (I wrote about an old version: https://dvdkon.gitlab.io/articles/mocasys-dascore/). I'd appreciate any pointers to other solutions to similar problems.

EDIT: As an aside, here are my criteria for a good CRUD app framework:

- The data model is the source of truth: I shouldn't have to repeat what tables and columns I have, or what constraints are placed on them. Server-side validation and client-side inputs should be autogenerated

- Permissions are all in one place: Critical parts of app security shouldn't be all over the place, especially they shouldn't be duplicated between the backend and frontend.

- Permissions should be granular to both columns and rows: I know this isn't always needed and that it's hard to implement, but sometimes you just need granularity, and hacking it in is, IMO, a bad idea for security reasons (see point above)

- The app is in a git repository, separate from the data it operates on: This is where a lot of "low-code" solutions fail for me, I get the goal of user-extensibility, but when I'm making software that will run a business' core functions, I don't want hidden state. Plain text is the best we've got in that regard.

EDIT2: Another criterion: Transparent handling of history. Keeping every change of an item should't need to be programmed once for every datatype, same for the retrieval UI.

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

#107

.NET, razor pages, sqlite, entity framework. Its hard to build anything non-trivial with a gui without involving a few languages these days. You can package your .NET server as completely self contained and run it on anything, just need a web browser. Edit: python might get you close with a simple html framework.

This is the only valid answer as far as I’m concerned. No other solution offered allows you to write client-side code, SQL commands, and back-end code all in the same language (in this case, C#).

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

#108
This thread is basically name your favorite language/framework. My vote goes to good ol:

Node.js + Postgres

Most flexible, biggest ecosystem of all, runs everywhere, talks to everything. Bonus: Get Github Copilot, it knows Node very well, and you don't even have to code most of the time, just tab, tab, tab.

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

#109
post #100

Api Platform + React. That's just impossible to beat

what you mean by "api platform"?

My bad! The name is indeed generic enough to not be obvious. Here it is: https://api-platform.com/

This is a framework built on top of Symfony and it provides you with full blown Hydra API simply by adding annotations on your entities. It enables you to make simple crud in like 15 minutes, but as it's built on top of Symfony it can also be used for really complex projects

It was originally made by @dunglas which is also a Symfony core team member and does a lot of stuff (the Mercure protocol and Vulcain among other things)

Post reply on HN