Melkeydev / go-blueprint

Go-blueprint allows users to spin up a quick Go project using a popular framework
https://docs.go-blueprint.dev/
MIT License
5.94k stars 335 forks source link

HTMX/Templ support? #125

Closed briancbarrow closed 11 months ago

briancbarrow commented 1 year ago

Tell us about your feature request

I used the project to build an HTMX server using Templ. Would we want there to be an option in the cli to setup? I know the project is meant to be minimalistic, so I wasn't going to add it unless people think it is a good idea.

My thought is that opting into this would add another folder for web ui stuff with a basic route to get the project started.

Let me know your thoughts.

Disclaimer

Melkeydev commented 1 year ago

I had some time to think about this. Honestly I love this idea and I think blueprint can definitely benefit from it. HOwever, one thing I want to do is add a --advanced flag that gives many more prompts. In that advanced mode, one of the prompts. I think the current non advanced flow is pretty exhausted and I want to keep it that way. What do YOU think?

briancbarrow commented 1 year ago

I think that is smart. Keep it simple for most everyone, but add functionality if people want it. I'll start looking at it over the holiday and see what I can come up with.

angelofallars commented 1 year ago

I'm 100% down for adding this idea with the --advanced flag.

@briancbarrow What do you think of using my htmx-go library for this? It has a lot of convenient utilities for working with HTMX, like checking if a request is HTMX with htmx.IsHTMX() and autocomplete/documentation that plays well with LSP/Intellisense. It will definitely help people Focus on the actual code of your application.

The only issue is that the library is only built for net/http types, so Fiber integration might be a challenge. But Templ will also have issues with Fiber too.

I like Templ too, so I can help out with integrating Templ, and my htmx-go library.

cedric-appdirect commented 1 year ago

Bringing in frontend library, it would be nice to also add integration test with something like playwright-go, so people don't forget to write tests.

Ujstor commented 1 year ago

Guys, @briancbarrow did an amazing job bringing HTMX templates into Blueprint. More importantly, there is logic for simply implementing other features in the future. If you have time, please help him with this PR #149 @cedric-appdirect @angelofallars

discussion #147 is related to this.