Clean Architecture with GO

Introducing Clean architecture with Go.

Clean Architecture with Go

Example repo

Pre-requisites

The darkness of software design

Advantages in Clean Architecture

The Clean Architecture

The only rules you need to know

1. The dependencies can only point inward

The dependencies only point inward

2. Separation of details and abstracts

The flow of control

The Layers

Entities

Use Cases

Interface Adapter

Frameworks and Drivers

Implementation of Clean Architecture in GO

.
├── domain
│ └── model
│ └── user.go
├── infrastructure
│ ├── datastore
│ │ └── db.go
│ └── router
│ └── router.go
├── interface
│ ├── controller
│ │ ├── app_controller.go
│ │ ├── context.go
│ │ └── user_controller.go
│ ├── presenter
│ │ └── user_presenter.go
│ └── repository
│ └── user_repository.go
├── main.go
├── registry
│ ├── registry.go
│ └── user_registry.go
├── usecase
│ ├── presenter
│ │ └── user_presenter.go
│ ├── repository
│ │ └── user_repository.go
│ └── interactor
│ └── user_interactor.go
Directory and Layer

Entities Layer

Use Cases Layer

Interface Adapter Layer

Frameworks and Drivers Layer

Registry

Booting

Conclusion

Web Developer, TypeScript, React, React Native, Vue.js, Go, Swift, and Ruby on Rails https://manatoworks.me/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store