I’m working on a personal project using Golang for the backend and I’m a bit stuck on how to structure the app properly. I want to keep things clean as it grows, especially when adding multiple routes and handlers. Do you have any recommended folder structure or approach for organizing a Go web project in a scalable way?
ReplyHey Arjun, I ran into the same issue when I started using Go for web apps. What worked for me was splitting things into packages like /handlers, /services, and /models. I also use chi for routing, super lightweight and flexible. One thing that helped a lot was setting up dependency injection early on instead of using global vars. Makes testing way easier later. If you're interested, I can share a repo I used as a starting point. Good luck with the project.