Hacker News new | ask | show | jobs
by pabe 971 days ago
Django + HTMX + SQLite or PostgreSQL Hosted on a virtual machine.

... Or the stack you're most efficient/ effective in. A short time-to-market is most important for learning. If you don't reach an audience, your project might bore you soon. Tech rarely is the holy grail to success.

1 comments

I feel like I want to like htmx, and the concepts sound cool. But json is such a nice generic serialization format. Like my API can be in service of my frontend, but also other applications. While, unless I misunderstand it, htmx seems to philosophically believe the backend is the frontend.

Are there any patterns where you have an API with nice json payloads but also use htmx to push the rendering to backend? What do you do when you have users that just want basic data from the API? Do you add json endpoints, or is it more of a “fuck you learn how to accept html” situation?

You can have both a hypermedia API and a data (JSON) API. Your hypermedia API is a lot more lightweight and flexible as it's tied to your web app. The HTMX authors talk about that topic in their book: https://hypermedia.systems/json-data-apis/

"These two different types of APIs have different strengths and needs, so it makes sense to use both. The hypermedia approach can be used for your web application, allowing you to specialize the API for the “shape” of your application. The Data API approach can be used for other, non-hypermedia clients like mobile, integration partners, etc.

Note that by splitting these two APIs apart, you reduce the pressure to constantly change a general Data API to address application needs. Your Data API can focus on remaining stable and reliable, rather than requiring a new version with every added feature."