[HN Gopher] Ask HN: Simplest stack to build web apps in 2021?
       ___________________________________________________________________
        
       Ask HN: Simplest stack to build web apps in 2021?
        
       I'm looking to build a new app with a frontend, rest API, and
       server-side rendering. I'd prefer a single batteried framework
       supporting all of these out of the box.  It's been a while since I
       can develop from a clean slate and I was hoping web dev in 2021
       would be much simpler than what I am used to. However, I spent this
       entire morning looking at modern frameworks (not going to name them
       to avoid turning this into a different kind of discussion) and I'm
       kinda disappointed. They all look complicated and require lots of
       configs and plumbing to get started.  Any stack/framework that you
       find simple and joyful to develop with?
        
       Author : yblu
       Score  : 35 points
       Date   : 2021-11-22 21:26 UTC (1 hours ago)
        
       | newacc9 wrote:
       | Dotnet 5.0, kestrel server, MVC sample project. You can use
       | dotnet and deploy to linux. Pretty simple.
        
       | whitepoplar wrote:
       | PETAL (Phoenix, Elixir, Tailwind, Alpine.js, LiveView)
        
       | alexcnwy wrote:
       | Flask.
       | 
       | Very lightweight without much black box magic.
       | 
       | Miguel Grinberg's tutorials and book are a great and quick crash
       | course.
        
         | okl wrote:
         | Flask Mega-Tutorial: https://blog.miguelgrinberg.com/post/the-
         | flask-mega-tutorial...
        
       | cookiengineer wrote:
       | If you want a batteries included framework, maybe take a look at
       | ember? [1]
       | 
       | It tries to automate a lot via the ember-data module (which also
       | makes queries automatically, e.g. left/right joins etc) so it
       | shines with its predefined rules, lots of former rails people
       | seem to contribute to its ecosystem these days.
       | 
       | [1] https://emberjs.com
        
         | theflyinghorse wrote:
         | I would advise against ember only because of the very steep
         | learning curve. I wpuod even say that it's a learning wall.
        
       | throwthere wrote:
       | PHP and jquery.
        
         | acabal wrote:
         | I think many people will think this is a joke answer, but IMHO
         | "server-side language of choice + jQuery" is actually the best
         | answer.
         | 
         | So much can be accomplished with server-side rendering and some
         | jQuery sprinkled on top. (jQuery isn't even strictly necessary
         | with modern vanilla JS, but it's very nice syntactic sugar at
         | the least.)
         | 
         | 90% of apps/sites will fit into a basic CRUD/REST document
         | format, which is exactly what server-side HTML served over a
         | RESTful interface was made for. Judicious use of jQuery fills
         | in the front end blanks for all but the most advanced use
         | cases.
         | 
         | The big benefit of this is that you're not locked in to the JS
         | framework-of-the-week once it inevitably becomes either
         | deprecated by its mammoth corporate sponsor who doesn't care
         | about you, or when it's no longer the new hotness and you can't
         | find developers who understand it anymore. jQuery has been
         | around with a largely stable interface for a decade and a half.
         | 
         | The secondary benefit is that you're not including some vast
         | framework with innumerable, inauditable dependencies, requiring
         | special expertise from highly-paid developers, just to put an
         | AJAX button on a webform.
        
       | torvald wrote:
       | If your app is stateless; FastAPI. Otherwise Django all the way
       | (with some cloud managed SQL, if you are not into hosting it
       | yourself). Remember backups.
       | 
       | Put in on a VM, deploy with Ansible, and call it a day.
        
       | spicyusername wrote:
       | If you want an all-in-one, which it sounds like you do, I'd look
       | into something like Nuxt and VueJS 3[1]
       | 
       | If you don't mind separating them out (which lets you use
       | different tools for your web tier and your middle tier) I'd
       | probably use a combination of a static page driven by VueJS on
       | the frontend and Golang on the backend for the API.
       | 
       | [1]: https://v3.nuxtjs.org/getting-started/introduction
        
       | thorin wrote:
       | I'd like to know too, but I think I'm going to be disappointed.
       | Currently using dot net core web api with angular or react. I was
       | thinking about trying to pick up django again, is that still
       | likely to be worthwhile? Have done java spring previously. Node/
       | express didn't seem to have enough batteries included.
        
       | rsp1984 wrote:
       | Interesting that Svelte hasn't come up yet. Personally I find it
       | to be the only sane web framework out there. Easy to learn,
       | little boilerplate code, very well structured, very fast. Give it
       | a try!
        
       | thrower123 wrote:
       | I'd be tempted to use Blazor if I was starting a new greenfield
       | project and somebody else was paying.
        
       | tootie wrote:
       | I'd absolutely go for next.js and deploy with Vercel. It's got a
       | huge community, lots of starter templates and enterprisey add-
       | ons. There's stuff to learn but react is easily the most popular
       | frontend framework right now and has the most energy.
        
         | Zababa wrote:
         | How do you do database stuff and auth with Next?
        
       | barosl wrote:
       | I was in the same boat as you. I'm mostly a backend person and I
       | had avoided frontend frameworks and used vanilla JavaScript
       | directly because I did't like the complexity of modern JavaScript
       | frameworks.
       | 
       | Recently, I tried Next.js and it changed my mind a bit. It
       | prefers convention over configuration, requiring tremendously
       | less configuration compared to other frontend frameworks. It is
       | still a bit complex, but hides the fact nicely under a well-
       | defined abstraction. I might try another project with Next.js in
       | the near future.
        
       | AlphaGeekZulu wrote:
       | I use Rust with Rocket and Tera.
        
       | brundolf wrote:
       | Next.js. It takes care of most of the config for you, and
       | integrates client/server/static/API beautifully under a single
       | roof. Also gives you nice bells and whistles like hot reloading
       | out of the box
        
       | tikwidd wrote:
       | Next.js or a create-react-app project for the frontend, which you
       | can host for free on Azure Static Web Apps.
       | 
       | Azure functions or Google Firebase for the backend.
       | 
       | With this approach you might not need to pay a cent depending on
       | your usage, plus you can take advantage of the large ecosystem of
       | React components. For a "non-serverless" approach, I would set up
       | a VM on Linode and use docker-compose behind nginx.
        
         | pjgalbraith wrote:
         | I would also consider using Cloudflare Workers for the backend
         | and for the static site hosting if it is a simple enough app.
        
       | ushakov wrote:
       | Crystal programming language with Kemal or Lucky
       | 
       | https://kemalcr.com/
       | 
       | https://luckyframework.org/
        
       | elchin wrote:
       | Check out RedwoodJS
        
       | bengale wrote:
       | NextJS has everything you're asking for, including handling the
       | API. Super simple to get started with straight out of the box and
       | the docs are great.
        
       | thegreatpeter wrote:
       | Check out remix.run - it just opened sourced today. Created by
       | Michael & Ryan & Kent C Dodds from React Router.
       | 
       | Plenty of folks who "haven't used a framework, but heard X is
       | great" are missing out on the real deal. Give it a go, you won't
       | regret it!
        
       | omnimus wrote:
       | Phoenix+Liveview or Laravel+Livewire or Rails+Hotwire/Turbo
        
       | tchock23 wrote:
       | Counterpoint to the suggestions above, why not try out a no/low
       | code framework like Bubble.io?
       | 
       | I've met a few devs recently that are starting with that for
       | simple CRUD projects even though they could easily spin something
       | up in Rails.
        
         | muzani wrote:
         | I tried it. It's nice but it feels a bit slower. The usual
         | problem with these things is we're so used to doing everything
         | with plaintext that the mouse based approach feels unwieldy.
        
       | softwarerero wrote:
       | If you need full-stack and want to build quick take a look at
       | https://www.meteor.com/.
        
       | nikivi wrote:
       | I quite liked the recent Remix v1 demo
       | (https://www.youtube.com/watch?v=wsJaUjd1rUo). The way you can
       | get data in and out of react with their loader is great.
       | 
       | I personally am looking into using it (or most probably next.js)
       | with Cloudflare Workers / Durable Objects. Running backend code
       | close to end users is awesome.
        
       | globalise83 wrote:
       | Meteor, Typescript template, with React frontend, MongoDB for the
       | Meteor built-in accounts and authentication, and Postgresql for
       | data management. Can also easily use Express to expose some REST
       | endpoints. Plus there is a server side rendering package that
       | makes it pretty easy.
        
       | codegeek wrote:
       | Everytime this questions comes up (and it comes up a lot
       | especially on HN), the answer is almost always: start with the
       | Language that you already know and then reverse engineer. For
       | example:
       | 
       | PHP => Symfony or Laravel
       | 
       | Python => Django or Flask
       | 
       | Javascript => Node/Express
       | 
       | Ruby => Rails
       | 
       | Then there are others like elixir/Phoenix etc and then you can do
       | your own in Go etc.
        
         | gfxgirl wrote:
         | Node/Express != Rails, one is a low-level gives you almost
         | nothing at all. The other is a high-level CRUD based framework.
        
         | keyle wrote:
         | I'd go one more, and say specifically Laravel Livewire. It's a
         | pleasure to use and gives you the flexibility of having a
         | reactive frontend.
         | 
         | I do recommend dipping in Laravel first, before Livewire.
        
       | dmje wrote:
       | Bracing myself for the downvotes but meh, let's live life
       | dangerously.
       | 
       | WordPress.
       | 
       | Why? Incredibly easy to dev against. Powerful API built in. User
       | model. Flexible theming. Plugins for extensibility. Multisite for
       | more complex apps.
       | 
       | I've built a few web apps in house using it and am now making a
       | couple for production use. I might one day find I need to get
       | this made bespoke but I can't see a requirement any day soon. WP
       | does everything I need.
        
       | Mikeb85 wrote:
       | Rails. But do Rails 7 (still in alpha but it's on rubygems - it's
       | also super stable, I think the alpha label is simply because DHH
       | hasn't finalized all the changes). Gone is all the webpack JS
       | nonsense (it doesn't have any dependency on Node at all).
       | Hotwire/Turbo/Stimulus is standard. ES Modules/import maps are
       | standard. It's dead simple, almost reminds me of the early days
       | of Rails. But of course it's industrial-strength, better than
       | ever, Ruby is also better than ever.
       | 
       | Edit - to make life extra easy also set it up with Postgres and
       | deploy to Heroku. Everything literally just works.
        
         | dominik-2020 wrote:
         | This is debatable and I'd say absolutely not :)
        
           | Mikeb85 wrote:
           | For OP's criteria it works. It's relatively simple (by
           | today's standards), it's full-stack, has everything out-of-
           | the-box. Getting started is as easy as it gets (in 2021).
           | 
           | What would you choose?
        
       | ajjenkins wrote:
       | I haven't used it myself, but Next.js is a popular choice if you
       | want to use React. It's primarily a front end framework, but can
       | do all of the things you mentioned in your post. But probably not
       | the best if you're looking for something to build a traditional
       | web app with a database. I think there are comparable frameworks
       | for Svelte if you'd rather use that.
       | 
       | But if you really want a full stack framework or don't want to
       | deal with fancy JavaScript frameworks, I think you're better off
       | sticking with Rails/Django/Express or something you've probably
       | heard of.
        
         | Raed667 wrote:
         | I second NextJS, you get React, SSR, serverless endpoints and a
         | rich ecosystem of integrations. It works great with things like
         | Friebase, Supabase or any regular DB / Redis.
        
         | enlyth wrote:
         | I use NextJS at work and it fits everything the OP wants, I
         | would definitely recommend it especially if you're comfortable
         | with JS or TypeScript already.
        
       | holonomically wrote:
       | Frontend is what will get you. The kids have decided everything
       | now needs to be compiled and transpiled so you won't be able to
       | avoid the hassle of frontend development. If you want to avoid
       | all of that then Flutter/Dart might be a good option:
       | https://dart.dev/web. But this is just me giving random advice. I
       | tried Dart for a while and it's a nice language, no worse than
       | all the other contenders when it comes to web development.
        
         | nnoitra wrote:
         | Yup, everything is a constanatly changing fix on top of broken
         | JS and a broken architecture.
        
         | Zababa wrote:
         | > If you want to avoid all of that then Flutter/Dart might be a
         | good option: https://dart.dev/web.
         | 
         | I don't get your point, Dart is also compiled to JavaScript.
        
           | holonomically wrote:
           | It reduces the effort of learning different frameworks for
           | the frontend and the backend. You use one language that
           | includes simple interoperatbility between the frontend and
           | the backend. It will still obviously need to be compiled into
           | a format that browsers can work with but if you're gonna use
           | a framework anyway then Dart/Flutter is a reasonable choice
           | (modulo performance issues as mentioned by others in this
           | thread).
        
             | Zababa wrote:
             | But you could make the exact same argument for plain
             | JavaScript? With the difference that JavaScript is way
             | bigger in the web space.
        
               | holonomically wrote:
               | The point is no one uses plain javascript anymore so if
               | you're going to use some domain specific language with
               | its own build pipeline to generate compiled assets for
               | the browser then Dart/Flutter is no worse than any other
               | javascript framework.
        
               | Zababa wrote:
               | It is worse, because very few people use it, and the
               | performance on the frontend is terrible.
        
         | cercatrova wrote:
         | Flutter is cool but not ready for the web, much as Google wants
         | to label their web support as "stable"
        
           | holonomically wrote:
           | What's missing?
        
             | sgt wrote:
             | Slow scrolling, is a major issue. Hard to solve.
             | 
             | Flutter is great for native iOS and Android though.
        
             | jeroenhd wrote:
             | In my experience: performance. Even Google's Flutter apps
             | lag horribly in Firefox and feel slow and wonky in
             | Chromium.
             | 
             | The development framework is pretty nice with the way you
             | can share code between native and web, but the end result
             | is just lacking.
        
             | Mikeb85 wrote:
             | The performance is terrible.
        
               | holonomically wrote:
               | I looked at the flutter gallery and it looks like they
               | just compile everything to js files and paint the widgets
               | on a canvas element. Would be interesting to know if
               | they're investing any effort in different backends like
               | WASM. Would probably solve their performance problems.
               | Canvas is obviously a sensible option for rendering but
               | it looks like it might be another reason why their
               | performance isn't great.
        
       | e67f70028a46fba wrote:
       | http://htmx.org + whatever backend you like best
        
         | mamcx wrote:
         | And pair with https://tailwindcss.com and you are golden.
         | 
         | Seriously, is super productive this way!
        
         | ASalazarMX wrote:
         | Wait, this looks and feels like a very pragmatic way of making
         | modern websites. How has this not become more popular? What are
         | its cons?
        
           | mamcx wrote:
           | > What are its cons?
           | 
           | Is very pragmatic. That means your whole investment in the
           | arcane ways of JS are dust. Not hipster at all.
           | 
           | ---
           | 
           | More seriously, Is of little issues here. You setup and it
           | works, so is not something that lead to "generate content"
           | like other setups.
           | 
           | I found only a significant issue (to me)
           | (https://github.com/bigskysoftware/htmx/issues/596) but then
           | I do something that have never done in long time with a JS
           | library: I poke into the source and fix it myself. Far easier
           | than expected! (ie: The code is plain!)
        
       | _peeley wrote:
       | I use Laravel both at my day job and for a few side projects, and
       | it's a real blast to work with. It's very similar to Rails in
       | that you can auto-generate most boilerplate for
       | models/views/controllers, and then paint-by-numbers from there.
       | The HTML templating is nice enough for static sites, but it has
       | great Vue integration if you're making something a little more
       | interactive. If you also ever need to venture outside the super
       | feature-packed framework, the PHP ecosystem is absolutely
       | enormous so it's rare you'll ever be wanting for packages.
       | 
       | The PHP language obviously still has some sharp edges and
       | annoying design choices, but it's seen some huge improvements in
       | the past few years imo. Simply using a framework like Laravel
       | will also save you from some of the more infamous footguns, since
       | there's a lot of secure/sane defaults included.
        
       ___________________________________________________________________
       (page generated 2021-11-22 23:02 UTC)