Clean Architecture using Golang.

Overview

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
You might also like...
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

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

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

Competitive Programming Template for Golang

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

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

Go-project-template - Template for a golang project

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

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

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

This is a simple GoLang script template.

This is a simple GoLang script template.

Owner
Golang Common Packages
These packages will help you accelerate your software development process
Golang Common Packages
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

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

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

Emirhan 0 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

Diego Alberto León López 2 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

Daniel Svitan 2 Dec 5, 2021
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

Raphael Reyna 190 Dec 29, 2022
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

Adnaan Badr 85 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

MassBots 19 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

Victor Neo 0 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

foolin 314 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

Aymerick 508 Jan 5, 2023