Ask HN: Easiest way to build a CRUD app?

211 points by tropicalfruit ↗ HN
Ideally, there would be no:

>multiple programming/scripting languages to learn

>external dependencies: packages, api's, services, saas

Should be simple and resilient, can last for a long time.

Doesn't require a lot of maintenance, large multiskilled teams, or dependency on services or API's that have a tendency to deprecate or disappear. Something which is not easy to compromise or hack.

Is it a stupid question? 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.

Thanks

238 comments

[ 5.9 ms ] story [ 275 ms ] thread
.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.

.NET Core and Razor Pages are a solid option!
(comment deleted)
im actually trying to build a kind of admin UI in .NET Core, scaffolding on POCOs through EF Core: https://github.com/cloudy-net/Cloudy.CMS

although it is a little bit in disarray at the moment because of a migration to preact.

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#).
With the SAFE stack and SQL data providers you can go 100% F#
I would use EF core (code first) even if my app wasn't in dotnet. Migrations and deployments just. work.
Blazor is even better; awesome to be able to use C# both the for the web front end and back-end.
How many people will use it and how will it be used? What is the app exactly going to do?

Whe first thing that comes to mind i Notion, which is a true no-code alternative if you want to build internal CRUD apps.

The next step would be to use a managed backend and a no-code frontend. For backend you can use services like Firebase [1], Nhost [2], or Supabase [3].

For frontend you can use something like Retool [4].

[1] https://firebase.com/

[2] https://nhost.io/ - Discloser: I'm the co-founder of Nhost

[3] https://supabase.com/

[4] https://retool.com/

i use this setup (besides using python fastapi code in the backend) and i really love it. Retool is awesome.
It certainly depends on what's your definition of "easy".

If you're coming with no experience in programming at all, nothing will be easy. There might be tools which focus on one programming language, but they would abstract away too much details of how web based apps work in general to really understand what you're doing.

If you have some experience in a programming language or coming from just another field than web development, I'd suggest you go with a web framework which is commonly used in your programming language's universe. That might be Django for Python, ASP.NET for C#, etc.

Then, there are many lowcode/nocode tools which gives quick results. I have used Anvil in a tutorial to build a Twitter Dashboard: https://bas.codes/posts/python-anvil-twitter-stats

Your idea with the static site generators could also work. Keep in mind that you're going to create mostly frontend code when using this approach. That involves JS and npm – so you might go deep into the rabbit holes of front end web development, which can be huge. However, if that's what you want, I'd suggest using NextJS over Gatsby since I'd consider it easier to setup for beginners. Using a non-JS static site gen would contradict your "no multiple languages" requirement ;)

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.
Exactly what I would choose.
I can second this. I am using Elixir/Phoenix/LiveView for a new web app I am launching soon, and I have not written a single line of javascript so far.
LiveView is amazingly productive, and it allows you to make highly interactive webapps much faster than if you make a REST/front-end split, just using regular Elixir.
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/

Can you make it out of a google form and a google sheet?
No, because then I would be relying on an external service from Google.
You will always rely on some external services.

Either AWS for hosting or if you go the crazy root your ISP to bring internet to your own server.

Relying on Google sheet and Google form seems like a reasonable safe bet.

Then of course, the simple stack may not be enough, but if it is enough, I am not aware of anything simpler.

They didn't say they will rely on an some external services. But an external service from Google. Not using Google or similar can be a requirement. For example if they want to build a CRUD application manipulating personal information in Europe.
http://iommi.rocks

Any tool that can do CRUD in a web context has a minimum level of complexity. I strongly believe iommi comes closer to that minimum than standard django by a lot.

Plain HTML + Alpine.js + HTMX for the frontend. Use the language that you prefer for the backend handle the HTTP requests and return HTML to the frontend.
Laravel. You'll get a lot of plug n' play stuff within its ecosystem. The community is at this point massive, so there's no doubt it will stick around for the time to come.

It's not a no-code solution, but the shallow learning curve will allow you to get up to speed in no time.

You can't have it all. You may achieve simplicity but it's not easy. Rails has most of what you need for a web app, and its ecosystem has many complementary subsystems and libraries. So, it's very easy to develop something fast. But, after a certain size it starts to be less and less maintainable.
Write an OpenAPI schema file describing your CRUD, and generate code with OpenAPI Generator. Download the official Postgres docker image, run it as a daemon, and configure your app to use it. Configure Nginx as your app's reverse proxy. That's it.
Vaadin meets all your requirements. It has some templates so you can basically make an app by just commenting stuff out.
I'd go with Perl Dancer, SQLite and plain HTML.
Easy in all ways: - plain HTML + JS + CSS to start with, then add some simple framework like Bootstrap + Datatables for quick results - MS SQL Express Edition or Developer Edition as backend; it has the easiest GUI-driven installation, configuration and operation (via SQL Server Management Studio) while it is still completely free - server side programming ... not sure, for me PHP is the simplest, but this is based on a very limited view over all options. PHP is very simple because you can just use Notepad++ or VS Code to edit files, save, run - no build, no dependencies. You can run it under Windows (IIS) or Linux, configuration is minimal.
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.

I'm not a python/Django developer but I'm playing with it for my personal project. It's really nicely made, a lot of things are very easy to do,etc. Couldn't recommend enough.
Just want to add to what I said earlier, on the DB side which could be an external dependency, it doesn’t need to be. Django works super well with SQLite, again no external libs (it’s in the Python standard lib), and you should be able to handle a lot of traffic from a single sever with it.

I have in the past used Djangos built in “in memory” cache with a global invalidation on all db writes for simple apps like this that have a low write rate.

thanks, i will look into this
I use django-cookiecutter [0] for most of my projects as it sets up a myriad of things, saving an incredible amount of time if you need your app to be production ready quick. May be better suited for those experienced with django though.

[0] https://github.com/cookiecutter/cookiecutter-django

"Easiest way to build a CRUD app".

Using the CRUD-app-building framework in which you are competent.

Beyond toy apps there are no shortcuts without that competence but there are plenty of prospective frameworks to develop it in, as evidenced by the other comments.

This is the right answer. There are use cases which are served well by simple builders - temporary or event-related apps, short-lived internal tools, etc., but if there is the faintest possibility that this will require maintenance and extension - and "can last for a long time" points to this - you need something robust that you can reliably tinker with.
> Using the CRUD-app-building framework in which you are competent.

That's assuming people already know one. If they don't, which would you recommand?

I wouldn't. There are no silver bullets. I would say (assuming there were no other motivations) to trial whichever popular, community-supported and well-documented frameworks seem the best match for whatever skills (languages, business domains, whatever) they already have, and go with the one they feel most comfortable with.
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.

As others have mentioned, see if you can rope together something with a Google form and sheets.

Django is great, you can get very far with it's defaults e.g. it uses local SQLite db.

For non enterprise graded CRUD apps, I usually go the PHP way, it's not sexy but it's cheap to run both in term of server cost and brain space to worry about what could go wrong, doesn't require constant maintenance and is likely to outlive the majority of what is considered sexy today.
Why would using PHP make an app not require maintenance?
>Is it a stupid question?

It is not a stupid question at all. A problem I thought would have been solved by now or very closed to solving it. But we are not even half way there. Especially the self hosted API and services part.

Basically you want to bring Native App development model to the web. Although I think WebObject in the old days were quite close?

The current recommendation are Laravel, Rails and Django.

I love using C# and SQLite with EFCore for this kind of applications. Then I put it behind nginx.
What do you want to achieve or build with it? I'd suggest Rails as it's pretty easy to get something up and running but that depends on what tech you are familiar with. It's boring, has a lot of resources online and doesn't change much so maybe a good choice.