Ask HN: What's is your go to toolset for simple front end development?

304 points by anakaine ↗ HN
I'm quite firmly in back end development. Often times I find myself wanting to have a simple front end to which I can attach some new experiments for home brew coding such as Flask.

I'd not mind if my front end looked a little bit nice, but don't want to spend forever learning, hand coding, and trouble shooting html, css, JavaScript.

What's in your toolkit for some simple front end drag and drop style block building that gives you enough of a template to get started? I've seen the odd one posted on HN over the years, but never had the foresight to save one.

Given its home lab style stuff I don't really want to dive into the likes of Webflow, Canva, etc.

294 comments

[ 3.4 ms ] story [ 248 ms ] thread
Being no frontend dev myself, the rare times I have to do a webpage I go for jquery and bootstrap. May sound old-fashioned, and perhaps it is, but it works.
https://tailwindui.com/ - lots of pre-made templates using tailwind css. Some are free, but the more advanced ones require payment.
This looks pretty useful. I'll have to do a bit of digging and see how hard they are to put together.
What is the proper way to use it? Is it a collection of code snippets to copy/paste into our projects?
I just read that you didn't want to troubleshoot html, css and js, so my goto toolkit for simple UIs might not fit your bill, but hear me out :)

At work, when I do internal tools, they are usually well received. They also pass just below the threshold of having their looks be judged. They're not ugly, because they're almost not there.

Very plain HTML: HEAD+TITLE, H1, H2, UL, OL, A, IMG, INPUT, BR, TABLE, P Javascript as needed, usually embedded in the HEAD There is no CSS.

There's simply no design to attack, no colors or alignments to disagree with. It exposes the interface to communicate with the backend, nothing more.

It's also the fastest and simplest way of getting stuff done, if you don't need to expose it to "end users".

I do this for internal science stuff at my work. The scientists love it. Simple and fast.
I recently took a similar approach for a couple of simple websites (https://abyteofcoding.com/survey/ and https://crosspromote.io), and found that surprisingly people don't really care that much. It's still very annoying to deal with responsive stuff (changing design based on screen size) though.
It would only take a tiny amount CSS to make it usable.

The examples by vonadz are minimal to the point of being a chore to use.

(comment deleted)
I pretty much do this as well. The only thing I do different is, when I need to present it to someone, I will drop in a minimalist css library like PureCSS or Milligram.
There's a ton of very simple "minimalist" or "classless" or "markdown" [0] CSS files that you can apply to plain HTML to get modest good looks versus browser default styles these days. No changes to your markup, just use that raw HTML you are already comfortable with and LINK tag in a single CSS file.

This seems like a very good list with lots of handy easy to compare preview screenshots: https://github.com/dbohdan/classless-css

[0] From that idea that sometimes you just want to take a Markdown document's boring raw HTML output straight out of the processor without any other templating in between.

Bang on. We have internal tools like that and they just work - something which dumps a list of switches and information for example, trivial to find what's plugged in etc. The interface doesn't get in the way. Dynamic pages are a matter of "print" stuck in the middle of the php.

We also have internal tools based on gigabytes of react across millions of files, we have data fields in there you can't actually highlight and copy the label from that require 3 days efforts to add a tiny feature. But it probably looks nice.

Honestly? React [0], Tailwind [1] and Vite [2]. Using Vite so setup the environment and tailwind components for css I have never been able to create front end faster than now. It feels like a super power.

[0] https://reactjs.org/

[1] https://tailwindcss.com/

[2] https://vitejs.dev/

OP mentioned they are backend developers-- and you are asking them to do a whole frontend setup? Your answer is a bit like "Oh just recompile the Linux kernel if you want feature X, its so easy LOL"
Thanks for taking charge on this one. You've stated my feelings when it comes to doing all the css, javascript and html
It’s really not a huge hurdle. You have to install a few tools. If you’re a backend developer, this shouldn’t be too challenging. And what you get in return is:

Tailwind: CSS done right, in my opinion. If you haven’t tried it, it’s amazing. It’s a no brainer if you’re not great at CSS (which a self-proclaimed backend developer would not be).

React or Preact: it’s much better than cobbling together strings of HTML or using some proprietary template system. You build views with JavaScript and a teeny bit of syntactic sugar.

Vite: I haven’t used, but I do use esbuild which it abstracts. It’s fast, and gets out of your way so you can bundle everything up nicely.

If you add TypeScript to the mix, you now have one of the most advanced compilers in the world helping you catch your mistakes early.

I know it’s popular to bash on front end folks. I’ve been writing front ends, back ends, embedded systems, and more for over 20 years. These tools legitimately solve some gnarly problems and have turned an area I previously hated (web front ends) into one I kinda sorta like (or at least don’t hate).

Some might disagree with these arguments on the account of smaller projects not necessarily "needing" all of that functionality, but personally I think that you do bring up some nice points!

In my eyes, it's important to find a technology stack that can scale both up and down in what it does - something that would be good enough for you to ship both production ready software with a bit more effort, as well as knock together a proof of concept in a weekend. Something that's good enough to be used in a team of people who have general experience in the industry (be it full-stack work or front-end in particular), as well as use on your own.

Why? Because the time I have for learning technologies and ironing out all the quirks in any particular setup is limited, it's far easier to make a few template repositories and a few customized component libraries of your own (which may just be renamed Bootstrap integration with a few additional personal touches and quality of life improvements) that you can throw in a new project and start working with it ASAP, not just work with 5 different stacks in 10 different projects, needing to constantly context switch.

Coincidentally, that's also one of the many reasons why most of my apps use containers as their runtimes (standardization regardless of orchestrator) and I don't scoff at boring languages like Java that let you use them as a hammer to beat in those pesky screws in their place.

Bad analogy. It's more akin to installing postgres and rails for backend development, which is not an unfair ask.

They can write plain HTML and some barebone css, and thats ok. That'll be similar to asking a backend dev to ftp some php file to a shared host.

I totally agree. This is a super stack. The productivity it enables is insane. I like to use Chakra instead of Tailwind, but same principle.
React is one tool that a primary backend developer should stay away from.

Reasons being:

1. React uses jsx,css-in-js and other non standard solutions. Adding additional learning effort

2. React hooks require manual dependency tracking which can lead to error. Literally every other js framework has dependency tracking built in. Vue had it since day 1

3. React has minimal api, and leaves a lot to third party ecosystem. So, not only you need to Google a lot more. But these best tools change frequently.

4. React be default recommends CRA which is slow. While vite (which is excellent) does support react, some of react libraries do not work properly due to ESM and JS issues which webpack ignores.

5. You are not trying to be FE expert, so react's major pro (good on resume) is not relevant

Took me a moment to realize that frontend here means HTML+js, not the HTTP server (that is the first server that handles user's request, therefore being the frontend to everything else).
It depends a bit. If you want a real "micro" framework so it is super fast loading, then that will narrow down your options (I looked at purecss which is really small) but then it is likely to lack the more powerful controls you get with something like bootstrap.

If you want more bells and whistles then bootstrap is fairly easy to understand, allows you to customise your js/css to only include what you are actually using but if you want the full scss experience to easily tweak parts of your design, it is all extra work to setup using gulp/webpack/visual studio code plugins or whatever.

- Bootstrap

- Bootswatch

- Some custom scss to pop it up

- Some basic jQuery for everything dynamic

Simple yet super effective

I usually just pull in fomantic ui (fork of semantic ui). It has all the components (and variants) I need, it’s easy to use and the components look much nicer than other ui frameworks.
(comment deleted)
My last experiment was with bulma css and vanilla javascript (typescript) with web components for components that needed custom/complex interactions. Nice thing with this approach is that you can "just" render the web components with the backend's template engine as if those were your normal html tags. Because of typescript, a build step was required. For this I used esbuild (esbuild itself didn't do the type checking so I ran tsc with --noEmit and --watch next to it).

Didn't get that far with that project to see how it works when the code base scales. I would probably pick the same setup for my next greenfield project.

Just use some simple CSS framework that you like/are used to plus maybe jquery if you need more than vanilla javascript.

This will get you a looong way and you don't even need npm for it.. just copy the minimized files into your source folder.

Not sure that's what you're looking for, but my product www.jigdev.com definitely allows you to make simple UIs to interact with backend services
Really tired to find all kinds of modules for different function.

So even though I had bad experience with AngularJS, I still decided to learn Angular instead of React and Vue several years ago.

But if you only have some small projects, TypeScript is not better than JavaScript.

I often use plain HTML and a classless CSS (e.g. Water.css[0]) for personal projects.

This way it's easy to write and maintain. Looks okay. Fast feedback cycle during development. No need for build steps. Works in browsers without JavaScript. Works well on desktop and mobile devices.

Highly recommended if suits your needs.

[0]: https://watercss.kognise.dev/

This should be the top answer. Simple Css libraries (I use MVP.css) that just work with no hassle is the way to go
This looks nice. Nothing wrong with this
Take a look at Pinegrow [0] (I'm the author). It is a desktop app that lets you visually work with standard HTML & CSS files and supports frameworks such as Bootstrap, Tailwind CSS or just plain old CSS. There are also more advanced features, for example live SASS compilation, components, interactions and even exporting WordPress themes and blocks.

[0] https://pinegrow.com

Tried Pinegrow(and similar UI tools), didnt like it. They expect you to still know all the low level details, at which point you might as well write straigth css
Any plan to compile this to webassembly and make it run in the browser? Webflow is killing it. I had no idea there were other options.

To be clear, I... don't even know why I want that? Desktop software runs faster than webapps do. But for some reason I feel like people these days simply prefer to not download stuff. Weird.

Pinegrow is a web app (mostly vanilla JS, HTML and CSS) packaged with NWJS [0] into a desktop app that runs on Mac, Windows and Linux.

We also have Pinegrow Online [0] that works 100% in the browser - without webassembly. The performance is quite good for such a complex UI.

[0] https://pinegrow.online/edit/

React with create-react-app [0] and Netlify for deployment, github as git repo. This way you can have a hello world app that has a full CI pipeline in ~30 mins.

[0] https://reactjs.org/docs/create-a-new-react-app.html#create-...

If your domain is already on Route53, you can replace Netlify with AWS Amplify and save another 10 mins…
And install React-Router, Redux, set TypeScript
Redux is absolutely not a requirement for "simple" front-end dev. There are many simpler, less boilerplate-y, and more modern ways to manage state in a React application. See https://blog.logrocket.com/modern-guide-react-state-patterns...
Even with up to medium complexities a simple useContext or React.Context is enough.

And with NextJS it makes react state management very scalable and rarely need redux at all IMO.

And if you want a drag'n'drop GUI for this workflow, there's React Studio (macOS only):

https://reactstudio.com

It outputs create-react-app projects with no extra runtime components or other limitations. You can deploy on Netlify or do whatever you like with the code.

If you need any kind of interactivity on the frontend, but are more comfortable with the backend, I would suggest looking at Phoenix LiveView [0] or a similar server-rendered HTML technology for your language of your choice [1].

In short, these solutions take JavaScript out of the mix entirely and basically let you deal with a single logical "app", rather than a separate frontend & backend.

[0] https://github.com/phoenixframework/phoenix_live_view [1] https://github.com/dbohdan/liveviews

A single logical app sounds great. There is great freedom and power in simplicity for small concerns.
Seconding this. I've been using LiveView in production for ~18 months now, on a couple of projects.

Hugely simplifies the overall stack. Combine with TailwindCSS, TailwindUI.com, and you have some very powerful tooling at a low development cost.

You or your company hiring, by any chance. I've been using that exact stack for a few years now, and Elixir+LV jobs are hard to come by :P.

I probably need to focus more on 'vanilla' back- and frontend stuff, but man has it been fun so far! Definitely made me enjoy my work more.

We are betting big on moving to liveview and are hiring.

We run a half dozen elixir apps in the healthcare and research sectors.

people@polkadotskysoftware.com

How stable is it?

I've been screwed over twice by Angular, RXJS, etc. Every month we had to redo most of our work as the community kept deciding on new directions of correctness.

Check the second link above. There are frameworks for this pattern in most languages, many with many years of effort into them. I can personally recommend Vaadin.
The web-components backed vaadin or vaadin flow (JSF-like, all-Java)?
After having learned & used all the major frontend frameworks (starting from jquery, backbone, ... react, svelte) I am now firmly in the camp of LiveView. No more "REST APIs"/fetch calls, SSR by default, no javascript alltogether, very simple programming model once you "get" it.
It's very cool. I'm actually working on a web framework called Bolts in the Rust ecosystem that will offer LiveView-like functionality, born from my hatred of modern js frameworks.
The irony is you will have to code a lot of javascript to make this ;)
eh as long as it's _myyyy_ javascript I don't mind at all
I'm in the same camp, I've slowly "regressed" backwards from overcomplicated SPA's back to server side rendering. When LiveView hit and I was already using Phoenix it was just perfect. It's a slight embelishment on top of multi-page server rendered pages which gives all the benefits I need and nothing more.

If I _really_ need something to be driven by the frontend like a transition then I'll use Alpine.js.

For CSS I tend to use tailwindcss / tailwindui because I know it well and it doens't need npm. If I didn't know tailwind I'd probably look at something like bootstrap or something I can build on top of with vanilla css.

How do you deal with more complex/dynamic forms? As someone who learnt frontend mostly in React I've always struggled wrapping my head around how you would do that with server-side rendering.

For example: 1) selecting a checkbox alters other fields in the form 2) validation that needs to hit the backend and then present warnings/errors to user 3) field arrays -> sending back a list of fields

LiveView can handle that pretty well, you can setup a click or validation handler for your live view / component. It then hits the handler function on the backend and you can have the component updated in place. Since it only sends the diffs down it's pretty efficient on the round trip, at least not something to worry about compared to the hundreds of api calls most SPA's will make.

So the flow is 1) click the checkbox 2) call sent across the open socket 3) backend does it's logic to figure out what it needs to do 4) backend returns the small diff of changes 5) frontend alters dom.

Its actually recommended with Liveview for pure client side stuff (hiding form elements, etc.) to do that in the client. There are hooks to do such things. Granted I've only built admin-y tools that are pure liveview but did hear/read there are options for client side JS.

Just because it can be done 100% server side doesn't mean it should be, especially if its driven out of a "look, no JS!" type of approach.

This is really cool and makes me want to learn Elixir.

Staying in one language for frontend and backend is just so appealing. To my knowledge, the other option to achieve that would be having something like Blazor WASM or Rust Yew that compiles to WebAssembly to have a client-side app a la React/Vue/Svelte.

I wonder which of these approaches will end up be more prevalent in the future. To me it seems like compiling something React-like to WASM might be more attractive, because you can stay in your backend language, but ditch the permanent websocket connection.

I came across something that is somewhere in the middle. Maybe a happy medium? It's a Python library called IDOM [0]. Best way I can explain it is that it is server-side bindings for React, where state and diffs are passed back and forth for you via web sockets. You implement your components in Python with a React-like API and IDOM builds the equivalent React components for you on the client-side and then wires up your server-side state handlers. It is also web framework agnostic, works with all the most popular ASGI web frameworks in Python.

Admittedly it is still a bit raw. But seemed like a really interesting concept when I was looking for LV equivalents.

[0]: https://idom-docs.herokuapp.com/docs/index.html

there's also justpy, uses vue and is closer to liveview in that it generates all the frontend code for you. https://justpy.io/
I've been involved in two projects that use LiveView and both of them have similar path.

First, engineers build application using just LiveView and it works just fine. You click a link you have table with your data, you click button you have filtered table, click another link you see a chart.

But then UX concerns are raised from PO/PM/users. Users find it jarring that they need to wait a little to see a loading spinner on clicked button. And we litter our views with some alpine.js DSL in attributes or load stimulus controllers. Some stuff is moved to hooks and kept in ad-hoc global variables.

Finally, most of the live views evolve into single html node, with mini-SPA written in some lightweight javascript framework. And everything is wired with phoenix websocket.

LiveView is still a fantastic and very productive tool to quickly create applications but I'm not sure if it scales to users expectations.

Thanks for writing up your experience. I’ve been wondering how well liveview works when interacting with the page with variable latency. I tried to search some sites made with liveview in the past, but couldnt find any apart from some official examples.
I use AlpineJS for reactivity. Along with JS Template literals[1], I can reach quite close to the ergonomics of having react like re-usable functional components without bringing in the whole complexity of react ecosystem. Works quite well for smallish projects.

For styling I pick up Bulma CSS if I need some more complex components (tabs, modals etc.) or TailWind if I just want to pepper a little styling here and there. All this loaded directly from CDN. No build step, no server etc required. You easily do debugging from browser console.

I have made a few internal tools like this which my co workers use everyday.

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

I really like the ultra simple approach of MVP.css (https://andybrewer.github.io/mvp/). It looks better than no styling at all and doesn't require me to get into Bootstrap. Only minimal html tags needed. Perfect for small side projects.
pnpm + Vite + Svelte + TypeScript + UnoCSS