Dude!!!!! My notifications are delayed lol how am I getting a notification like two minutes later lol KZbin is against me. Anywayyyyyy good job babe! Love your haircut 😘
@C4CH3S2 ай бұрын
A much cheaper alternative is to deploy directly to a VPS or VDS on providers like Hetzner or Linode, things like railway, vercel, fly, and so on can really fuck you over with fees if you make a mistake. You can do it with docker, but I prefer to setup a reverse proxy and get all my apps running with systemd services. It's really old school but I know I will only ever pay the cost of my VPS and if I want to scale, scaling vertically is effortless :p
@tjblackman082 ай бұрын
A 25MB image is crazy good... You taught me about the "scratch" image, thanks!
@ohLyln2 ай бұрын
Great video Cody! I have been subbed to you for a while since back in my node / react days but I like you have migrated most of my stuff to Go +Templ w/ HTMX! In fact I migrated all my old node heroku projects to Railway a few years ago too! On a side note, I would love to see a video about your dev mode with air and all the cli tools you need to run to "hot reload" (tailwind, templ generate etc). I did have it set up at one point but it always seems like a PITA to set up for every project. Would love to see how you implement such a system!
@AMDevanney2 ай бұрын
I removed the dependency on node by using the standalone tailwind command line tool. You could do the same in the container.
@WebDevCody2 ай бұрын
I’ll try that out
@picklenickil2 ай бұрын
@@AMDevanney wow! Yes ... I take back my comment @WebDevCody
@arturfil2 ай бұрын
This
@arturfil2 ай бұрын
@@depafrom5277 I think HTMX has its place but 100% if you want reactivity, forget about server-side Rendering. Client-side rendering has its place too. Not everything should look like a nail due to only having a hammer.
@ifeanyinneji77042 ай бұрын
Thinking of rewriting most of my django rest framework projects in Go. Just that there isn't any framework like Django for Go
@farzadmf2 ай бұрын
Small tip: instead of prepending every statement in the Makefile, you can to `make -s ...` to make it "silent" (not echo the commands it runs)
@coffeeintocode2 ай бұрын
You could use the Tailwind binary & add DaisyUI from CDN to remove npm entirely…..but it’s not fully tree shaken so the files are bigger than they need to be
@WebDevCody2 ай бұрын
true, but I want smaller css files personally
@unisol1112 ай бұрын
Hey, You can reduce the size of executable binaries with UPX. The compression ratio is around 60% with UPX alone. UPX + Compiler options(-ldflags=“-s -w”) even more.
@WebDevCody2 ай бұрын
Good info!
@eillioniscreating2 ай бұрын
I hope you to make tutorial or playlist about building project with go in the future.
@C4CH3S2 ай бұрын
I think using node to compile your css is fine. It's not like you have it running all the time.
@_vicary2 ай бұрын
You may add one more build stage "FROM node" to save some apt install time.
@c92dotdev2 ай бұрын
I normally have a node layer that pulls from a node docker image like node:22 and a separate golang layer that builds go
@WebDevCody2 ай бұрын
That’s a cool idea
@dejanduh26452 ай бұрын
you are using fiber I see. Would be a good comparison between fiber and the std library to monitor the memory ussage
@MrHamsterbacke7562 ай бұрын
I don't think one could call this kind of stack simple as templ is a custom language and needs a build step. Similar to JSX but less integrated.
@fmentz2 ай бұрын
could do a video on an actual production ready auth in go? Would love to see that
@WebDevCody2 ай бұрын
Sure when I get around to that, focusing on htmx right now
@abhinavadarsh71502 ай бұрын
One thing I want to point out that code generation should not be part of build. You should commit generated go files.
@WebDevCody2 ай бұрын
I disagree
@EverydayElk2 ай бұрын
@@WebDevCody heh, you would be wrong
@WebDevCody2 ай бұрын
@@EverydayElk but why would you commit build files? They should be reproducible artifacts of your build. That’s like committing binaries or node_modules.
@Torboc012 ай бұрын
I saw you were using sqlite in a previous video. How do you deploy the db to railway?
@WebDevCody2 ай бұрын
Add a volume mount and have an env variable that points the service to the mount location
@leo288042 ай бұрын
Do you use sqlite on railway and if so, do you mind explaining how?
@WebDevCody2 ай бұрын
yes, volume mount, and point my go server's sqlite env variable to that mount location
@picklenickil2 ай бұрын
If you needed tailwind in htmx, without adding node to your containers, maybe use tailwind via cdn... Am i right or am i missing something here? Your styles are simple enough so why not.. and you dont look like someone who would have unused classes in his code
@WebDevCody2 ай бұрын
There are a ton of classes I’m not using. The colors alone have like hundreds of classes I’m not using. But yes that is an option.
@picklenickil2 ай бұрын
@@WebDevCody makes Sense.
@lemurza52362 ай бұрын
Loving the node hate 🤣
@WebDevCody2 ай бұрын
I don't really hate node, I'm just annoyed with the ecosystem a bit
@DunckingTest2 ай бұрын
what orm did u use ?
@WebDevCody2 ай бұрын
Just sql directly for now
@tsubasateacher2 ай бұрын
huh? why its so cheap? $5 for 8gb ram and vcpu?
@WebDevCody2 ай бұрын
I think that’s just the max memory they give you. Railway charges by memory usage so you’re not really getting a dedicated 8 GB vps they’re hosting your container somewhere which allows you up to a 8 gigabytes of memory.
@tsubasateacher2 ай бұрын
@@WebDevCody ah.. make sense.
@ifeanyinneji77042 ай бұрын
First to comment
@picklenickil2 ай бұрын
A very slightly better build command build: @npm run build:tailwind @templ generate @rm -f bin/app_prod @CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o bin/app_prod cmd/app/main.go @echo "Compiled your application with all its assets to a single binary => bin/app_prod" For idempotent, parallalized, compressed containers.. 😅
@WebDevCody2 ай бұрын
What makes it compressed? The -s -w? Doesn’t that strip out important debugging info?