HACKER Q&A
📣 willvarfar

Where is my server-side rendering?


So its been 20 years since I last did web-dev.

My memory of the old days was that pretty much any programmer could go write server-side code in any scripting language to generate pages and tables and things and build UIs pretty much instantly. HTML was a language that was obvious and easy to generate with for-loops and such, and Javascript was something you could add for fancy things. Templates came along and made things even easier, and the biggest pain point was the back-button.

Fast forward to 2021, and I am in need of a simple editor for a GRPC API and I am finding myself flummoxed and unsure where to start on how to even make a UI for it! Everything seems to one server that serves Javascript single-page app that uses graphql to interrogate some middleware that in turn calls whatever backends are needed etc.

Where went the quick and dirty results of server-side generation of HTML tables and such?

It feels like modern web-dev is more cogs and more massaging and a much steeper learning curve and everything.

How can old-timers quickly and easily get a modern-feeling but simple-to-make UI?


  👤 the__alchemist Accepted Answer ✓
Here's my approach - I think it will work for you, but you can use different tooling:

-Django server framework to handle templates, auth, routing, DB etc

- HTML templates and CSS (inline for one-offs, and CSS files for multi-use and defaults)

- Targeted JS without dependencies for UI manipulation and fetching data from the server as required.

I think you'll find the improvements in modern JS and CSS very nice. Flex, Grid, JS DOM apis etc. Ignore the bloated frontend frameworks etc.


👤 pantulis
If this is a personal project and if you are not very JS fluent, you can absolutely stay away from all the SPA bruhaha. Rails is still very well alive and kicking, same thing going on for Django, Symphony and so on.

I say "if this is a personal project" because in the case of a professional engagement there are possibly other considerations.


👤 cblconfederate
PHP , jquery with maybe bootstrap for the mobile compatibility and some mysql. It all works as it always had and you won't have to learn a lot of new stuff you won't use again.

👤 sprobertson
Nothing's stopping you from generating HTML with plain old strings. If you like Python, Bottle [1] is a great example of how simple it can be. This isn't actually what I use these days (I'm a victim of the fancy client-side JS libraries) but it's much easier to get running from zero than any other setup.

[1] http://bottlepy.org/docs/dev/tutorial.html#tutorial-template...


👤 aristofun
Rails + bootstrap ui. The fastest lane to up & running website.

👤 Jiocus
It's been only 6 months since I made a quick and dirty DBMS web explorer, with for-loop tables and columns with sensible user-actions, dropdown menus what have you, depending on data types and requirements reported by the database. All server-side generated.

Stack that solved my problem:

- Python Flask, with the bundled Jinja templating,

- Spectre CSS.

This setup could produce some seriously large, functional and attractive tables. PHP is also an option, with Twig templating (which is a Jinja copycat).


👤 nonsapreiche
> Where went the quick and dirty results of server-side generation of HTML tables and such?

Still here in the 20 years old technology you know, only changed in some paradigm, words, tools, but the core is always the same hyper text metaphor.

> How can old-timers quickly and easily get a modern-feeling but simple-to-make UI?

There are a lot of frameworks available todays, but if you have been ibernated for 20 years, I bet you'll like to try do it by yourself.


👤 davismwfl
Depends on the stack you are sitting on or familiar with. Plenty of ways to still create a server side rendered site.

PHP has been around for quite the long time and is a quick and easy way to do it if you are familiar (or even if you aren't usually). Sure people shit on PHP all the time, but it can be a quick way to do it. Node also has template systems for server side. .NET & Python too.


👤 rajacombinator
Try looking harder? Basically every webserver framework comes with server side rendering out of the box and as de facto.

👤 ecesena

👤 PaulHoule
Use React and keep all state in MobX, find one widget set you like, stick with it and don't get hung up on fine requirements of how it looks and behaves.

👤 codegeek
PHP: Symfony/Laravel Blade Templates

Python: Django/Flask/Jinja Templates

Ruby: Rails ?

NodeJS: Express ?

Basically a popular framework for a popular language. Almost all are server side by default.


👤 tomcam
May I ask what’s wrong with vanilla PHP?

👤 lioeters
With Node.js and Express, you can generate HTML as a string in response to HTTP requests, as barebones as it gets.

👤 midrus
Ruby on Rails.

👤 simon_acca
Plotly dash is the modern version of what you describe

https://plotly.com/dash/


👤 yamellasmallela
Django templates will be your fastest option

Rails and PHP are a nightmare and legacy. Don't even bother

Next.js is pretty good


👤 ironmagma
> HTML was a language that was obvious and easy to generate

It was never so. This attitude in fact is the cause of many bugs and security vulnerabilities, most popularly XSS. There's a reason infrastructure was built around these technologies, one of which is that they are not really safe.