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
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.
$ make test
** 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