{"repo":"naughtygopher/goapp","free":true,"listed":false,"github":"https://github.com/naughtygopher/goapp","clone":"git clone https://github.com/naughtygopher/goapp.git","description":"An opinionated guideline to structure & develop a Go web application/service","language":"Go","stars":1070,"topics":["go","webapp","webservice","webserver","project","golang-application","golang-examples","golang","golang-library","goapp"],"license":"MIT","category":"dev-tools","readme_excerpt":"Goapp v1.0 This is an opinionated guideline to structure a Go web application/service (could be extended for any type of application). My opinions were formed over a span of 9+ years building web applications/services with Go, trying to implement DDD (Domain Driven Development) & Clean Architecture. This guideline works for 1.4+ (i.e. since introduction of the special 'internal' directory). P.S: This guideline is not directly applicable for an independent package, as their primary use of such a package is to be consumed in other applications. In such cases, having most or all of the package code in the root is probably the best way of doing it. The structure is explained based on a note taking web application (with hardly any features implemented 🤭). Table of contents 1. Directory structure 2. Configs package 3. API package 4. Users (would be common for all such business logic / domain units, 'usernotes' being similar to users) package. 5. Testing 6. pkg package - 6.1. datastore - 6.2. logger 7. HTTP server - 7.1. templates 8. lib 9. vendor 10. docker 11. schemas 12. main.go 13. Error handling 14. Dependency flow 15. Integrating with ELK APM 16. Note Directory structure internal \"internal\" is a special directory name in Go, wherein any exported name/entity can only be consumed within its immediate parent or any other packages within internal directory. internal/configs Creating a dedicated configs package might seem like an overkill, but it makes things easier. In the app, y","default_branch":null,"files":null,"tree":[],"storefront":"/r/naughtygopher","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/naughtygopher/goapp/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}