dipeshdulal / clean-gin

Implementation of clean architecture in Go, Gin with dependency injection.
BSD Zero Clause License
445 stars 64 forks source link

Make folder structure modular. #41

Open dipeshdulal opened 1 year ago

dipeshdulal commented 1 year ago

Modular Folder Structures

Currently, routes, services, repository, etc have been added in their separate folders. This make it less modular, harder to re-use and less maintainability.

Thinking of making this structure something like this;

pkg
  |-- authentication (model, handler, service, route, repository, serializer etc.)
  |-- users
  |-- .... 
  |-- common (some common things re-usable by multiple modules)
internal
  |-- framework's internal wiring code 
domain
  |-- users.go (interfaces for users package)
  |-- authentication.go (interfaces for authentication package)

While we are at it, we need to look at the go's recommended folder structure for packages. Following something like this