Skip to content

Implementation of clean architecture in Go. It has 4 main domain layers: Models Layer, Repository Layer, Usecase Layer, Delivery Layer

License

Notifications You must be signed in to change notification settings

ishaanthakur/goclean-arch

Repository files navigation

Description

Implementation of Clean Architecture in Go.

Clean Architecture guidelines:-

  • Framework Independent. The architecture does not depend on the existence of some library of feature dependent software. This allows to implement these frameworks as tools.
  • Testable. The business rules can be tested without the UI, Database, Web Server, or any other external element.
  • UI Independent.
  • Independent of Database. You can swap out Oracle or SQL Server, for Mongo, BigTable, CouchDB, or something else. Your business rules are not bound to the database.

project has 4 Domain layer :

  • Models Layer
  • Repository Layer
  • Usecase Layer
  • Delivery Layer

The diagram:

golang clean architecture

Running Instruction

Need to run the article.sql in your mysql

Since the project already use Go Module, recommended to put the source code in any folder but GOPATH.

Run the Testing

$ make test

Run the Applications

** run it with docker-compose **

#move to directory
$ cd workspace

# Clone into YOUR $GOPATH/src
$ git clone https://github.com/ishaanthakur/goclean-arch.git

#move to project
$ cd goclean-arch

# Build the docker image first
$ make docker

# Run the application
$ make run

# check if the containers are running
$ docker ps

# Execute the call
$ curl localhost:9090/articles

# Stop
$ make stop

About

Implementation of clean architecture in Go. It has 4 main domain layers: Models Layer, Repository Layer, Usecase Layer, Delivery Layer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published