Hacker Newsnew | past | comments | ask | show | jobs | submit | matt_callmann's commentslogin

I'll give it a try, but I'm not a fan of the SPA approach. Try using it with Templ and server-side rendering (SSR) instead of any JavaScript framework.

If anyone has already done this and can share their experience, I would love to hear about it!


I can speak to this.

It works, though if you need auth/authz you'll probably want to add some middleware to get a cookie flow working instead of the jwt approach PB uses by default.

If I remember right, essentially you set the cookie on login and on auth refresh and pull it out and into the auth header on all incoming requests.


is there a git repo with example code?


Not OP, but I design my Go projects with a very similar pattern that I learned from OP's 2018 post.

I think this is a pretty good example of a real-world implementation:

https://github.com/mtlynch/picoshare

Particularly these files:

https://github.com/mtlynch/picoshare/blob/2cd9979dab084ca781...

https://github.com/mtlynch/picoshare/blob/2cd9979dab084ca781...


out of curiosity, why no sort-of-established pkg and internal dirs? What do you think of https://github.com/photoprism/photoprism structure?


I'm not familiar with that package structure, unfortunately. It might be good, but I'm not sure what the reasons are for structuring the project that way.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: