Clean Architecture using Golang.

Golang Template

Description

This is an example of implementation of Clean Architecture in Go (Golang) projects.

Rule of Clean Architecture by Uncle Bob

  • Independent of Frameworks. The architecture does not depend on the existence of some library of feature laden software. This allows you to use such frameworks as tools, rather than having to cram your system into their limited constraints.
  • Testable. The business rules can be tested without the UI, Database, Web Server, or any other external element.
  • Independent of UI. The UI can change easily, without changing the rest of the system. A Web UI could be replaced with a console UI, for example, without changing the business rules.
  • 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.
  • Independent of any external agency. In fact your business rules simply don’t know anything at all about the outside world.

More at https://8thlight.com/blog/uncle-bob/2012/08/13/the-clean-architecture.html

This project has 4 Domain layer :

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

The diagram:

golang clean architecture

Run the Applications

# Build docker image and run
make run

# Check if the containers are running
$ docker ps

# Stop
make stop

# Clean
make clean
Owner
Golang Common Packages
These packages will help you accelerate your software development process
Golang Common Packages
Similar Resources

A general purpose golang CLI template for Github and Gitlab

golang-cli-template A general purpose project template for golang CLI applications This template serves as a starting point for golang commandline app

Dec 2, 2022

Callable Ajax / http requests inside Golang templates

jaco Callable Ajax / http requests inside Golang templates Examples Examples #1 {{ define "content" }} div id="myTodos"/div script

Dec 5, 2021

A Go Template Library. A bunch of utils and collections that are not part of the Golang standard library.

gotl A Go Template Library. A bunch of utils and collections that are not part of the Golang standard library. Prerequisites This library is using ext

Dec 15, 2021

Competitive Programming Template for Golang

Go Competitive Programming Template How to use this repo? Check the commit histo

Dec 19, 2021

Template user CRUD operations with golang, JWT, postgres

user-api-golang A CRUD API template for perform operations on users. Written in golang. Components Server: Golang with go-chi as mux and zap for loggi

Dec 26, 2021

Go-project-template - Template for a golang project

This is a template repository for golang project Usage Go to github: https://git

Oct 25, 2022

Template for depency injection in golang (no libraries)

Go Dependency Injection (No libraries) Project template based on the most common layered architecture style, made to explain how to do dependency inje

Mar 30, 2022

Golang Service Template

Golang Service Template Golang back-end service template. Using this template, you can get started with back-end projects quickly. Web Framework ORM D

Jun 8, 2022

This is a simple GoLang script template.

This is a simple GoLang script template.

Oct 25, 2022
Clean Architecture template for Golang services

Go Clean template Clean Architecture template for Golang services Overview The purpose of the template is to show: how to organize a project and preve

Nov 30, 2021
An example of implementation of Clean Architecture in Golang

Golang Template Description This is an example of implementation of Clean Archit

Dec 29, 2021
Clean arch Golang template project

Template No previous versions, still working on this one to reach v1. API Service for pssword app mobilde based on : https://github.com/bxcodec/go-cle

Sep 15, 2021
Template for Golang rest API using Fiber

Rest API Setup DB sudo -S docker-compose -f db.yml up -d Build container sudo -S docker build -t rest-api-image . Run container from image sudo -S doc

Dec 5, 2021
Programatic document generation as a HTTP service. Render PDFs using LaTeX templates and JSON.
Programatic document generation as a HTTP service. Render PDFs using LaTeX templates and JSON.

LaTTe Generate PDFs using LaTeX templates and JSON. Try out the demo! Find LaTTe on Docker Hub Table of Contents About Obtaining LaTTe Running & Using

Dec 29, 2022
A template to build dynamic web apps quickly using Go, html/template and javascript
A template to build dynamic web apps quickly using Go, html/template and javascript

gomodest-template A modest template to build dynamic web apps in Go, HTML and sprinkles and spots of javascript. Why ? Build dynamic websites using th

Dec 29, 2022
Template for advanced Telegram bots using telebot.v3

Telebot Template $ git clone https://github.com/massbots/template . $ chmod +x init.sh; ./init.sh NOTE The script will delete itself after the configu

Dec 30, 2022
A simple template using Fiber for me to bootstrap API services quickly.

Fiber Template A simple template using Fiber for me to bootstrap API services quickly. Features Fiber GORM air for hot reloading ... and possibly more

Dec 16, 2021
Goview is a lightweight, minimalist and idiomatic template library based on golang html/template for building Go web application.

goview Goview is a lightweight, minimalist and idiomatic template library based on golang html/template for building Go web application. Contents Inst

Dec 25, 2022
Handlebars for golang

raymond Handlebars for golang with the same features as handlebars.js 3.0. The full API documentation is available here: http://godoc.org/github.com/a

Jan 5, 2023