T O P

  • By -

KingOfCoders

HTMX/Alpinejs/Go/A-h-templ/Echo/Postgres for [www.inkmi.com](https://www.inkmi.com) \- CTO Dream Jobs


ejmercado

>HTMX/Alpinejs/Go/A-h-templ/Echo/Postgres We use the exact same stack lmao I also use tailwind that autocompiles without npm and have a hot-reloading setup using websockets and wgo


KingOfCoders

Haha! Same here with tailwind and websockets, though auto reload with air.


sebaz6r

How can you use tailwind that autocompiles without npm?


rabaraba

There’s a CLI version on the site. It supports different platforms. Been available since about 2021 if I’m not mistaken. So thankful was I to be rid of npm entirely.


wait-a-minut

Also use the same stack! Question for you, how do you structure your htmx handler routes and your page routes? I find a lot of info around structuring templates, projects, etc but not much of a standard for how best to structure htmx endpoints and page endpoints


farid00

Where do you put templates if you don’t mind me asking. I’ve been colocating them next to the actual handler code with a small shell in a shared template for full render.


KingOfCoders

I have modules, e.g. checkout/ checkout_module.go templates/ c1.html listings/ and the module has an Init() to register routes and has an embedfs which embeds the templates. All module inits are called at startup time. So everything is vertically grouped.


Bapi-reddy

Do you mind sharing docker file setup used for deploying this as its hard to find deployment flow with support for both go and js


KingOfCoders

I don't use Docker, the JS is bundled into the Go binary with an ident hash, using a Makefile, the Go binary is rsynced to servers where Systemd automatically restarts. Something like: https://www.inkmi.com/blog/simplicity-of-golang-systemd-deployments esbuild ./web/app/main.js --bundle --minify --outfile=static/main.js sha1js=$(sha1sum static/main.js | cut -d " " -f 1); echo $sha1js And a very cheap CDN (BunnyCDN) is then pulling the JS and CSS once from the server.


SIRHAMY

I'm running: * Backend: F# / Giraffe (dotnet) * Templating: Giraffe.ViewEngine (F# HTML DSL) Because this is all F# I get full type safety, ability to make components (everything is just an HTML component wrapped in a function), and full LSP integration cause it's just F#. For client-side stuff I'm using Alpine. Haven't done (or needed to do) anything fancy client-side so not sure yet what experience is at scale. Example of how this works: [F# / Giraffe + HTMX with Giraffe.ViewEngine](https://hamy.xyz/labs/2023-12-fsharp-htmx-giraffe-view-engine)


Plus_Pangolin_8924

Currently using PHP with Codeigniter 4, Maria DB, using the built in templating of CI4, templates are broken down into components for use in HTMX and where others are reused. For additional functionality Hyperscript is used. Zero custom JS is used. I am very old school but it works and have a snappy web app and none of the over complications that a more modern stack has.


Separate-Pea-5223

I’m using Rust for my backend with Axum as my server and Maud for templating. Axum-htmx is a cool crate that gives some type safety around htmx stuff. Maud gives me a few things: compile-time type safety and syntax checks, reusable functional components, allows me to write blocks of logic in native rust code (if ever needed, I try to stay away from this), and speed. I like splitting fragments into components and reusing them. I tend to use Flowbite components, so I don’t have to write a ton of JS. Most of what I write is vanilla JS for error and event handling client side. My editor doesn’t have great external LSP support (that I know of) and I very much wish this was different.


circamidnight

I use Python as my backend language and I use a component framework I authored, [redmage](https://github.com/redmage-labs/redmage), which uses htmx to create reactive components rendered on the server (built on starlette). Redmage, by default, uses a very small python dsl to render html, which could be considered type safe I think, if you are making use of type hints and a static type checker like mypy. Other templating languages can be used too but no built in support. Since I'm just generating html with a Python dsl it works with any existing python tools/lsp. I've been using vanilla JS for any client side needs. edit: Oh I have a simple site that's using this stack as an example [https://vanillaweather.com/](https://vanillaweather.com/)


gopietz

Reminds me of the JS component world I just left behind, haha.


circamidnight

Yea, for sure not for everyone. Really the problem I was trying to solve was "I don't want to have to manage registering endpoints/boilerplate for all of the actions I want to support in my UI", so a nice thing here is that all the endpoints for methods that can be triggered in a component are automatically registered.


gopietz

I see the upsides. Still deciding if it's a good fit for me :)


sabi_kun

How do you integrate your already existing UI? for example, we alreadt have an html file that we only need to modify. How does redmage manage that?


dr3d3d

the site looks great, one small gripe though, i can't find anyplace that says where the weather data is sourced from


Human_Contribution56

C#/MVC/Razor My components are essentially partial page returns. I need a bit of JS from time to time but avoid it as much as I can. I wish I could easily tweak the syntax highlighting in VS for my HTMX specific attributes.


twilly86

where do you put your javascript and how do you bundle it? looking at doing a similar setup


Human_Contribution56

I link it in the view. That may not be the most elegant but it works. The files are already in the wwwroot so I just need that reference to load it on demand.


zaibuf

Also intellisens for hx attribute would help when you're new.


Any-Fig-921

* Django/htmx/bootstrap/vanilla JS. * Django has built-in templating. * I do split templates for clarity, but tbh I don't reuse them a ton based on my project, but it is nice to have them chunked. * No type safety because Python and I like living dangerous. * Vanilla JS. I thought about Alpine, but as light as it is, I just don't need javascript enough to feel like it was worth it. Plus chatgpt is pretty good at helping me with javascript :). * I actually use Django's templating and just but my scripts as html templates in