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.
Pick a "classless" CSS library from a site like CSSBed[1]. These are kind of like Bootstrap, except you don't need to write any CSS or apply any CSS classes in your HTML for them to work. No tooling necessary; just include a tag in your HTML document. If you'd like to try something similar to this "Tailwind" hotness everyone keeps talking about, try Basscss[2]. Again, no tooling, just need a tag.
Once you start needing to add interactivity to your site, htmx[3] is nice and decently simple. If you really want something React-like, Mithril.js[4] is very similar but much simpler.
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
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".
For your use case I would look at AppSmith (https://github.com/appsmithorg/appsmith) or ToolJet (https://github.com/ToolJet/ToolJet).
These are full-stack low-code frameworks, but it's easy to use them to do just the frontend and connect to a backend API you implement yourself separately.
Edit: forgot to mention that these support drag&drop for building user interfaces :)
For layout, don't use any CSS framework, but instead refer to https://css-tricks.com/snippets/css/a-guide-to-flexbox/ often - every time I use some big CSS framework I end up fighting it at some point.
https://vitejs.dev/ for packaging - I got really grumpy when frontend stuff started needing build and packaging tools, but it's the nature of things so you just have to deal with it, and vite is fast, not overly complicated, and supports fast hot reloading.
Why? Preact is small, fast, and reasonably easy to use. But the main selling point for me was that, together with htm, I don't need any build system a la webpack. No node_modules folder. I just have to load one script (preact + htm bundled), define my components in plain javascript files and import them. Bliss for me.
[1] https://github.com/developit/htm
Edit: Just read that you want drag & drop style UI building, so this might not be for you.
If you are comfortable with plain HTML + CSS + Javascript, adding KnockoutJS will give you a minimal app building capability that you will find useful for several usecases.
You get to manage your application's data model in javascript on the client side and the UI can be bound to your datamodel (bidirectionally) without having to manage it yourself. That is more than sufficient for many usecases.
If you don't want to be fiddling around with CSS too much, you can use something like Bootstrap or Material Design's CSS templates to get some decent looking UI (without getting lost in CSS minutiae).
For your development workflow, start without any bundler (like WebPack or Parcel) first. Once, you have your application working, you can then introduce it as a final step.
Sveltekit scales down very well: if you need only CSS and HTML for some paths, that's all you write in your svelte files, and that's also all users download. At the same time if for some other paths you need more Javascript, you can just add it there, without bloating the JS bundle size. Svelte's built-in stores makes it also possible to also do very complex state management, if that's ever a need. With vite under the hood the dev experience is lightning fast.
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...
What languages / platforms are you familiar with?
For example, if you do a lot of C#, you could look at Blazor. Server-side Blazor isn't 100% simple; but if you're already doing C#, it's very easy to learn. (In-browser Blazor compilers C# to WASM, Server-side Blazor sends all mouse clicks over a websocket and gets back partial HTML updates. It (server-side) has a bit of latency, but because all state is in the server, you can keep your implementation simple.)
There's also a similar thing for Java, but I can't remember the name at the moment.
* HTMX (formerly "Intercooler") for interactive (Ajax) functionality: https://htmx.org/
For simple personal projects I write all my own HTML and CSS from scratch. It's not particularly hard to write stuff with low to moderate interactivity from scratch and the infrequency that I do frontend dev means it's quicker to do that than learn whatever new framework has replaced the deprecated one I spent time learning a couple of years earlier (that's probably unfairly snarky but from an outsider looking in, it's hugely daunting and depressing when you see just how much churn there is).
The only problem with rolling your own is that you raise the difficulty for anyone new joining the project (if it's something you plan on opening up to other contributors) and CSS can be a bit a of trial and error to get right too.
However if you're just writing a few test UIs to interface with backend APIs you're POCing (which is what your question reads as) then it's probably easier to skip all the other frameworks out there and knock up something yourself.
https://docs.djangoproject.com/en/4.0/ref/contrib/admin/
A similar modular admin system that's more generic is https://www.forestadmin.com/, I think this one has a layout editor too. But that one requires a REST API and so it may require more plumbing, depending on what you've already built. Or it could fit nicely on top of what you already have, if you already have APIs for everything.
[0] https://reactjs.org/docs/create-a-new-react-app.html#create-...
body {font-family:sans-serif;}
Beyond that, all other CSS is optional imho.And you don't need JavaScript to trigger back-end events, as a simple link will work just as nicely.
It achieves straightforward abstractions and great speed by not having a virtual DOM.
The syntax is also very pleasant.
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.
Bootswatch is also great if you want a little more styling. (Free bootstrap themes)
Bootstrap is great because it is so ubiquitous. They have page templates you can copy to get the page layout you want and then there are tons of bootstrap examples you can just copy and paste.
For CSS I see a lot of recommendations for "classless" libraries, which I've never tried, but could be good if you don't need to do much tinkering. For just a little bit more time investment you can get a lot more options with something like Bootstrap. It's pretty easy to learn, has a lot of "drag and drop" style components, and there are tons of templates out there (free and premium). I learned it once many years ago and have been using it for projects ever since.
On the interactivity side it really depends on what your needs are, but if you don't need too many bells and whistles you could probably get by with vanilla Javascript. jQuery is also a good choice for simple applications, as it offers a slightly more intuitive interface to some of the basic JS actions.
All of this being said, if you think you will be spending a lot of time on the frontend, or have complex interactivity needs, it might be worth it to learn a framework. I can recommend Vue as one that is fairly easy to get started with and also scalable to larger applications.
Vue is easier to learn and uses html, css and js. So I feel right at home. Forms are particularly easier and vue dev tools help a lot in debugging.
Also, last year, I used it for an app after a break of 3+ years. I was still able to re-use a lot of prior knowledge (even if it was half forgotten). There was new syntax(comp api) and typescript introduced, but older syntax (options api) worked fine.
mod_perl / PostgreSQL on the back end. HTML::Mason for templates.
If there is a back-end API with a spec (GraphQL or OpenAPIv3) you can generate an Elm client for that which makes API calls type-safe and thus very robust.
It's not drag and drop, but abstracts away all tooling and let's just get to just writing your code. Either in React or in Django templates.
Eventually, if you have any dynamic behavior, you're going to end up rebuilding a lot of what React does for you.
Full disclosure: I'm the creator.
It was a mind-numbing exercise I wouldn't recommend. There are a lot of strong tools out there, but they're often billed as 'general-purpose' when they're most certainly not.
For my project in question I ended up getting frustrated with either issues with SSR-rendered stylesheets or runtime access to browser API's and so on so I just wrote a simple server with Express that just renders static pages using EJS as a view engine.
I keep my client in the same source folder, with a different config for the build that drops the artifact in the public.
Since I personally like TypeScript over not using it, there was some build setup—but just `tsc` for the server code and `parcel` for the client code.
There's little configuration, and I had it up and running with hot reloading of both the server and client code in no time—made me regret my decision to audit so many other options.
TDLR:
The client code I decided to stick with "vanilla" JS via TypeScript using parcel to build and bundle deps.
The CSS is just css, but I might replace that with SASS because it can be a touch easier to organize and namespace things.
FWIW, if I didn't want the TypeScript or dependency bundling (via NPM for fetching the code to host locally), it would be just JS and CSS with server-rendered HTML... if I need something fancy I have the option of plugging in a framework or something later. Starting light feels so good...
You can get pretty far with just HTML and dropping in any one of those CSS frameworks.
Since you’re using Flask, I would just make some endpoints that serve HTML using Jinja2 templates. Depending on what you’re doing, you might not need JavaScript at all. You can trigger backend stuff using HTML forms with form actions. And with a classless CSS library, the form should look nice too.
If for some reason you want to keep the front end totally separate from the back end, a good framework for building web apps is Remix: https://remix.run/ . It makes it easy to build highly performant websites and has nice helpers for data loading and actions. I also like that it keeps client side JavaScript to a minimum, which keeps things simple and makes your website faster.
I use either Quasar, a Vue3 framework (vue it's very easy to learn and quasar does all the heavy lifting, plus has plenty of components), or recently Vite with Tailwind CSS (this allows you to better control the style).
I would recommend to study with an empty Quasar project and build from there.
I personally go for lit[1] and sometimes typescript, and that's it. Typically use open-wc[2] to have a starting template under a minute.
Then I use any of the front-end libraries that add bells and whistles. Vaadin coming on top [3]
I'm a backender, I don't have time to, nor want to learn the specificities of a framework. And I don't want my users to have to pay the cost of many dependencies that I'm not using the full power of.
Add firebase or supabase with netlify for deployment, and I'm done.
[1]http://lit.dev/ [2]https://open-wc.org/ [3]https://vaadin.com/docs/latest/components
I use these because I know them and I don't need to look for code or docs. And I feel the the tooling doesn't get in my way.
I feel that a UI components library is better suited for how I think, than a drag and drop config tool.
Passing props feels simpler than digging into menus to link that JSON to that calendar.
Other tools (except for Tachyons, these are maybe out of scope for a home lab):
- Tachyons [0] is a small (16K-ish) utility class framework.
- DaisyUI [1] is a free and open source component lib for Tailwind.
- WindiCSS [2] is built on Tailwind with some additional features.
- UnoCSS [3], an interesting on-demand atomic CSS engine that supports Tailwind CSS, WindiCSS, Bootstrap, and Tachyons.
[0]: https://tachyons.io/
[1]: https://daisyui.com/
- Classless minimal CSS framework to make pages pretty without using css
- htmx
Try to avoid doing state management. If you have to do it, use a frontend framework at that point.
:-)
[2]: https://orbitjs.com/
[4]: https://postgrest.org/en/stable/
[5]: https://typeorm.io/
But I think https://unpoly.com/ is nice also and works with any backend.
Tailwind for CSS is great too.
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.
Dart is easy to learn and hasn't as many footguns as JS.
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.
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.
I've been a front and back-end web dev for 20 years. For front-end I almost always use vanilla CSS, vanilla JavaScript, and vanilla HTML by way of the back-end SSR template system.
Budibase.com
1) React/jsx is legitimately nice for templating. Lets say I have a list of ten things I need to display; I know these things at build-time, its not dynamic like from an API or whatever. These ten things are reasonably complex; div+spans+borders+etc. React is all about components; it makes that easy, write once and copy-paste one line. There are ways to get similar behavior in plain HTML+CSS, but it tends to be leveraging web technologies that I'm not super familiar with (web components?).
2) React has an EXTREMELY good developer community. Everything you could possibly want, there's a component out there, and its an npm i away. In comparison, the more pure HTML/CSS world is more fragmented and less developed.
3) `next export`. When people think nextjs, they think SSR. Don't bother with it. Just `next export`. I leverage next for the local dev tooling, the runtime can take care of itself.
4) Or; I want server-side functionality. You can build backend-only API routes, in Next, and its actually awesome. Of course, you have to give up the static export, but its the first full stack JS "framework" where I've started thinking, this actually works & feels productive. Usually I leverage that for really simple stuff; server-side OAuth logins for hacky dashboards, things like that.
For deployment: netlify is nice, or I'll use digitalocean apps if its not a static export.
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.
https://docs.lowdefy.com/introduction
You need Node.js installed so that you have npx, but otherwise you just write your UI in yaml, because why the hell not?
All Python, no need for JavaScript, css, etc. Lots of example templates.
- Bootswatch
- Some custom scss to pop it up
- Some basic jQuery for everything dynamic
Simple yet super effective
It has all I need, and lets me focus on business logic, rather than plumbing.
It is all one simple layer, no front-end/back-end.
if i had to pick, i'm a fan of nuxt. spinup is quick and easy and i'm a vuejs guy so its not that hard.
- SwiftUI (iOS/macOS)
- Rust (backend)
- Tailwind
- Netlify