I never clicked on a video so fast! I'm enthusiastic to see the progress.
@yazidridwan69172 жыл бұрын
realy appreciate all the great things you've done. can't wait for the future videos
@Fybuh2 жыл бұрын
I was arguing with someone on folder-by-feature. He was against it and kept making noise saying it shouldn't happen in go. I have been using fbf in all my apps properly and have never run into any issue... except with python when i struggled with cycle imports. Happy to see you paved the road for me to avoid cycle imports here
@emilianobarrionuevo75032 жыл бұрын
Great presented video. Thanks for your time and sharing the process of thinking and explaining the way you resolve and deal with the code in self. Being 39 now, I have encounter this situation many times on different projects and different teams, getting things together and make the right decisions to take the project to be in a solid foundation at start. Would love to see more videos on this journey. Thinking the way I can help out...🤔
@loubion2 жыл бұрын
Full newbie here, came to your chanel, tired of useless tutorial on the language. And I'm really glad to find some real world code, to hear some Go related stuff (like frameworks, architecture and tooling), and read the comments to get even more ! Poor english speaker, sorry for that but in a nutshell: thanks a lot
@bmdavis419 Жыл бұрын
Glad to help, stuff like this means a lot thank you
@j946atFIVEFOUR88AA2 жыл бұрын
this is a really awesome channel, thanks man
@bskur6834 Жыл бұрын
i mean fiber is really express like so it makes sense in my head just to organize it like an express project, this way seems overly complicated idk or maybe a mix of both would be nice, like having routes, handlers and models inside internal
@michaelangelovideos2 жыл бұрын
This is actually pretty much the NestJs pattern, cool to see it in Go
@nekoill Жыл бұрын
Nah man, it's cool seeing an interesting useful project being iterated upon, as that too is a part of a software lifecycle
@ChillHunter2 жыл бұрын
You do great work on youtube thank you
@RedPanda-ej2pn2 жыл бұрын
Thanks. I found this very useful!
@killiangrieg2 жыл бұрын
This is really shaping up nicely. Well done. What are your thoughts regarding hexagonal architecture?
@bmdavis4192 жыл бұрын
I have not used it, but it is on my list of things to learn more about
@dandogamer2 жыл бұрын
It's looking better Ben, I think the name of your todo package is stuttering tho. Rather than type TodoDB it would just be DB. You don't see the bytes writer method being called bytes.BytesWriter it's just bytes.Writer
@bmdavis4192 жыл бұрын
Oh yea thats a really good point lol I did not even think of that
@JanChodorowski2 жыл бұрын
First stargazer! :)
@grif.n10 ай бұрын
When you build your app with a Nextjs frontend are you going to communicate with your Go backend via the Next server still or directly from the browser? If communicating from Next server to Go server, do you find the extra step of browser -> server -> server to reduce performance or scalability?
@brightglitch9582 жыл бұрын
I heard fiber uses http/fast still need to research on that, but it'd be cool a comparison on different http packages.
@Benozo17 Жыл бұрын
Controllers renamed to go idio "handlers", http should be its own pkg easy to test, cmd should init http, mongo, root should have start pkg for embeds, views pkg ??, imoh each pkg should hold its own handler models, http registers your pkg handler and http routes is init in cmd, this way you only register your handler. I think your done a great job bootstrapping a minmal structure, its great for small todo like apps, i think you can take this a lot further to handle larger code base, from one gopher to another, keep Going because you will never GO back 😅, ... excuse the dry pun 😂
@JohnDoe-fe3zw2 жыл бұрын
This is great, only thing I didn’t like was connecting the db instance to the controller. since a controller can sometimes make other external calls. I just wouldn’t want anyone working on that endpoint make a db mistake. My personal preference is on each model and the crud functions and in the those functions have a pointer to the db. kind of like how Ruby on Rails has it
@rumble1925 Жыл бұрын
I was messing around in Go a few weeks back, I implemented the same general structure. Just think it was cool that I settled on this my first time playing around with the language, feels validating that I'm not completely dumb seeing as I'm coming from frontend and don't have much experience with any of this.
@ImreKovács-p6g Жыл бұрын
Great video! I've decided to give this project structure a try. If you wanted to expand this app with, let's say, a "calendar" or whatever, would you create a nother folder named "calendar" in the folder named internals, at the same level as todo, and in the "calendar" folder, would you have the files "controller.go", "storage.go" and "router.go"?
@rajenderkatkuri7642 Жыл бұрын
Dude what's your VS Code Theme? Looks sick.
@viniciusataidedealbuquerqu28372 жыл бұрын
9:45 A good thing I try to do is to create a context structure that carries all the application dependencies and every function that uses that context is instantiated as a implementation of that structure (like every request method)
@viniciusataidedealbuquerqu28372 жыл бұрын
oh you figured that out in 12:40
@abdirahmann2 жыл бұрын
btw, it would be awesome if you made a video on how you monitor your backends and aggregate analytics to detect and respond to anomalies. Thanls
@ftamas88 Жыл бұрын
Recommend using context for the app shutdown :)
@ahmeism90 Жыл бұрын
hey im happy that i found your channel, as TS developer, i was trying to learn golang but there were no too many resources. I have and app idea and i have already done some backend part. Would you like to make a video for nodejs developers who want to jump in golang?
@bmdavis419 Жыл бұрын
That is a good idea, a 1 to 1 of major concepts, will add it to the list!
@hectorcast943 Жыл бұрын
What is the vscode theme
@MosiurRahman-dl5ts2 жыл бұрын
Have you looked at Pocketbase project structure?
@OldKing111002 жыл бұрын
One thing I noticed in the Fiber Documentation was the ⚡Make Fiber Faster. It sounds like the standard JSON parser is slow, but they list a bunch of them. I settled on bytedance/sonic since it's optimized with C and Assembly. Is using sonic a bad move or should I use one of the other recommended JSON parsers? This seems like an easy way to reduce stress on the server.
@OldKing111002 жыл бұрын
Of course the moment I consider this Go 1.20 comes out with a 30% increase in performance to the standard JSON encoder.
@richardamare35752 жыл бұрын
what if I want to create something like service struct for uploading images to GCP? should I just create another file for example internal/todo/service.go and implement the feature there and then just pass it to the controller the same way as the todo storage?
@ruyvieira1042 жыл бұрын
No, you just don't use that structure at all. Just make a single file and make it run.
@ericjhuneespa33812 жыл бұрын
have you try go-chi?
@Mixesha0012 жыл бұрын
You should try go-chi :)
@bmdavis4192 жыл бұрын
It looks really cool, todays video will probably be a first impressions video!
@oussamasethoum16652 жыл бұрын
make a video on go and docker
@viniciusataidedealbuquerqu28372 жыл бұрын
go really needs a DI library, doing this manually is gonna get boring fast
@viniciusataidedealbuquerqu28372 жыл бұрын
oh google already created one called wire. I should check that out
@liamkiggen2 жыл бұрын
Drop fiber and add chi
@ghostofalexandria8914 Жыл бұрын
Why should he do that?
@markovidakovic6584 Жыл бұрын
Fiber, fasthttp, and many other alternative frameworks have numerous pitfalls: - You get stuck into the fiber ecosystem. There is no standard library compatibility with their router and api. - Fiber's marginal speed gains are only going to help you in a specific niche that 0.1% of people will have. - To get the full benefit of Fiber, it requires an unidiomatic and advanced style of Go programming. Generally speaking, your bottleneck with your http applications is not going to be memory or CPU usage in most situations. Instead, it's going to be network time, database access, and other IO tasks and operations. The amount of time your HTTP router spends processing a request is tiny compared to most other tasks. The vast majority of Go frameworks can be pretty easily picked up in an hour or so. Typically, the extent to what you have to learn is the different names they use for the same concepts you should already be familiar with. That being given, if you have the choice, this is generally unnecessary if your goal is to build an API service. The Go standard library interface (alongside a router, like chi or gorilla/mux) generally suffice. Why chi specifically? - It's quite purpose-built. It does one thing, and it does it well. - It's fully compatible with the Go standard library, making it usable with almost any other dependency you might have. - It's a very small addition for the power and functionality it provides, with a relatively small API surface.
@PatFarrellKTM Жыл бұрын
I've watched this and your version from two weeks ago. You keep using the term "todo" as a buzzword. I don't understand what, exactly, you mean by it. I would think that a todo list might have stuff like "1) design dbms schema, 2) figure out verbs in POST/GET commands, 3) implement them 4) drink beer"
@SatishRamteare Жыл бұрын
why not GIN?
@dinoscheidt Жыл бұрын
I’m sure I come across as rude, but why replace TypeScript with Go which (except for GOs lack of type hierarchies) are pretty similar and lose code, interface, validation, type, state and knowledge sharing - homogeneity - to the client? I’d understand if this would be F#, Haskell, Lisp,… due to complex event sourced processing or so but… for a web server? NestJS (not next) would be a good reference point
@ejaz787 Жыл бұрын
Performance + so much more
@alkolaqi83 Жыл бұрын
This is one of the reasons I stay away from languages like go or rust. The js world is full of frameworks and good/bad patterns. I do like golang a lot and your vids will help more people use the language. Please keep posting these vids.... also it will be nicer to avoid writing all the swagger docs, is there way to generate the docs automatically based on the types
@bmdavis419 Жыл бұрын
With swagger you have to manually go through and define everything, its annoying, but will make the FEs life so much easier