Live data from Hacker News

Ask HN: Easiest way to build a CRUD app?

news.ycombinator.com

41–50 of 239 posts

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

#41

I would consider Django and just using its Admin framework for building your UI, you can achieve so much very quickly with almost no code. I believe it’s a brilliant tool for building internal CRUD type db apps. Knowing how to use the admin framework well is basically a developer super power. You won’t need any external libraries, it has brilliant docs and important tools like database migrations are built in.

Second this. I have pulled off some minor miracles singlehandedly using Django. The significant data science ecosystem in python is a real plus if you eventually need to analyze things.

If you want to do something that the ORM isn't designed to do it can be a real pain. But if you have 20-30-100 different business objects you need to model and only a few don't fit in nicely you save so much time in the others that you can absolutely afford to figure out the special cases.

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

#42

I would go for Ruby on Rails, or a more modern Phoenix Framework (Elixir). With Phoenix you can also use Phoenix LiveView to avoid writing JavaScript. Very stable, scalable and low-hassle once you deploy.

A similar setup, for those more comfortable with PHP, would be Laravel [0] in conjunction with Livewire [1].

Laravel is basically the “Rails of PHP”, and has an absolutely incredible ecosystem to go with it.

Livewire was directly inspired by Phoenix LiveView. I only just recently started using it in my own projects, but it’s invaluable. Backend has always been my speciality, but now I can make real-time UIs just like the cool JS kids can too :)

[0] https://laravel.com/

[1] https://laravel-livewire.com/

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

#44
If you intend to build the CRUD app with a programming language (opposed to a low-code or no-code tool), then PHP would be suitable.

At least half of HN will recoil in horror, but PHP was designed for web programming and nothing else. The standard library will have almost everything you need. Deployment is easier than many other languages. It can be as simple as uploading your PHP files to a folder located on your hosting provider.

"Something which is not easy to compromise or hack."

Well, this is dependent on the skill of the programmer and takes time to learn. The alternative is to pull in external dependencies i.e a framework that tackles security issues like authentication, database access etc. But learning to use a framework will also be a time sink (but less time-consuming that building from scratch).

"The closest I can think of is a static site generator with some kind of self-hosted database but I'm not aware of any."

Static Site Generators (SSG) do not use databases and would not be suitable for a dynamic CRUD app. Even a 'simple' task such as signing-in to your CRUD app (if needed) is not possible with a SSG unless you plug in an external dependency.

Remember, if you go down the low-code or no-code tool approach you'll always be tied to the low-code platform who will host your CRUD app.

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

#45
Can you elaborate on what the app does and also prioritize your criteria?

If simplicity is your main requirement you might find inspiration in this:

> My focus has been on how to adapt the lessons I have learned working in teams at Google to a single programmer building small business work. There are many great engineering practices in Silicon Valley's big companies and well-capitalized VC firms, but one person does not have enough bandwidth to use them all and write software. The exercise for me is: what to keep and what must go.

> If I have been doing it right, the technology and techniques described here will sound easy. I have to fit it all in my head while having enough capacity left over to write software people want. Every extra thing has great cost, especially rarely touched software that comes back to bite in the middle of the night six months later.

https://crawshaw.io/blog/one-process-programming-notes https://news.ycombinator.com/item?id=17701882

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

#46
post #34

I would recommend Rails. You can just do: bin/rails generate scaffold Car title:string amount:integer and it will generate code to support all CRUD operations (model, views, controller) for Car with the two attributes title and amount. I can also be deployed without any K8s, Docker ... (but I recommend at least an Ansible set up so you can migrate the hosting easy between providers) You can directly deploy it simply…

Rails removes so many questions 'how should i set this up?' 'where should this code go' 'how do i setup a db connection'. It is fast to setup.

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

#48

I find it a little disappointing that everyone (including the OP) assumes a CRUD app must be a web-application. In a web-application you are NECESSARILY breaking, in all but the most exotic cases, the "multiple programming/scripting languages to learn" AND "external dependencies" requirement. Almost always, the "simple and resilient, can last for a long time" requirement goes out the window as well. If the requiremen…

> In a web-application you are NECESSARILY breaking, in all but the most exotic cases, the "multiple programming/scripting languages to learn" AND "external dependencies" requirement. Almost always, the "simple and resilient, can last for a long time" requirement goes out the window as well.

No? PHP web CRUD apps from a decade ago still work ( some updates are required for security issues, but still), have little to no external dependencies ( you need a webserver like Apache or PHP-FPM to serve your PHP, but that's it), and are in one programming/scripting language - PHP, with some markup in HTML. Nobody is forcing nobody to use JavaScript, that's only if you want and need client side dynamic content. Alternatively, node.js allows you to use JS client and server side, and it can last a long time. However, you need some dependencies.

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

#49
The best thing to do is not to build anything at all, if you can. This depends on what exactly you're trying to accomplish, who the target audience is, etc.

If you need something similar to a website or a store, the easiest option is to go with something like Wix (for websites) or Shopify for a store.

If you need something that's similar to a website but with a tad more complexity or with the potential to add more complexity, a good option might be a hosted WordPress site. You can start with something simple ad add a lot of comlexity via plugins or via writing your own code.

If you're looking for something fully custom, that's really not like anything else, then the easiest might be a low-code no-code tool. Haven't used many myself but that's often a good option.

Finally, if all of that fails, and assuming you need a web app (and not a desktop or mobile app), then you probably should use something like Django with Python or a similar framework for building an app, while keeping the HTML inline (as opposed to a separate React codebase or similar). Use whatever tools you know best to do this. IF you don't know anything, use whatever's the most similar to stuff you already know. (E.g. do you know Python? Use Django. Know Rails? Use Ruby).

This solution is still fairly easy, but also not exactly great for growth. My default these days is usually to start with a backend that's only there to provide an API, and a separate JS-based frontend. That's a lot more work, but most things end up there fairly quickly so usually worth just starting there.

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

#50

jasonette. https://jasonette.com/ I would still build a crud app with the frameworks and dependency hell you are referring to. Magic solutions tend to save time in the short term but often cost more than it saved in the mid to long term.

Project has moved to https://jasonelle.com/
Post reply on HN