All Projects → bxcodec → Go Clean Arch

bxcodec / Go Clean Arch

Licence: mit
Go (Golang) Clean Architecture based on Reading Uncle Bob's Clean Architecture

Programming Languages

go
31211 projects - #10 most used programming language
TSQL
950 projects
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to Go Clean Arch

Fluentmigrator
Fluent migrations framework for .NET
Stars: ✭ 2,636 (-48.6%)
Mutual labels:  sql, database, mysql
Gnorm
A database-first code generator for any language
Stars: ✭ 415 (-91.91%)
Mutual labels:  sql, database, mysql
Db
Data access layer for PostgreSQL, CockroachDB, MySQL, SQLite and MongoDB with ORM-like features.
Stars: ✭ 2,832 (-44.77%)
Mutual labels:  sql, database, mysql
Jet
Type safe SQL builder with code generation and automatic query result data mapping
Stars: ✭ 373 (-92.73%)
Mutual labels:  sql, database, mysql
Franchise
🍟 a notebook sql client. what you get when have a lot of sequels.
Stars: ✭ 3,823 (-25.45%)
Mutual labels:  sql, database, mysql
Shardingsphere
Build criterion and ecosystem above multi-model databases
Stars: ✭ 14,989 (+192.3%)
Mutual labels:  sql, database, mysql
Scany
Library for scanning data from a database into Go structs and more
Stars: ✭ 228 (-95.55%)
Mutual labels:  sql, database, mysql
Nut
Advanced, Powerful and easy to use ORM for Qt
Stars: ✭ 181 (-96.47%)
Mutual labels:  sql, database, mysql
Bitnami Docker Mariadb
Bitnami MariaDB Docker Image
Stars: ✭ 251 (-95.11%)
Mutual labels:  sql, database, mysql
Sqlfiddle3
New version based on vert.x and docker
Stars: ✭ 242 (-95.28%)
Mutual labels:  sql, database, mysql
Migrate
Database migrations. CLI and Golang library.
Stars: ✭ 2,315 (-54.86%)
Mutual labels:  sql, database, mysql
Rel
💎 Modern Database Access Layer for Golang - Testable, Extendable and Crafted Into a Clean and Elegant API
Stars: ✭ 317 (-93.82%)
Mutual labels:  sql, database, mysql
Pdo
Connecting to MySQL in PHP using PDO.
Stars: ✭ 187 (-96.35%)
Mutual labels:  sql, database, mysql
Dbeaver
Free universal database tool and SQL client
Stars: ✭ 23,752 (+363.18%)
Mutual labels:  sql, database, mysql
Stackoverflow Clone
Clone project of a famous Q/A website for developers which is stackoverflow built using MySQL-Express-React-Node 🌐
Stars: ✭ 182 (-96.45%)
Mutual labels:  sql, database, mysql
Liquibase
Main Liquibase Source
Stars: ✭ 2,910 (-43.25%)
Mutual labels:  sql, database, mysql
Sqlcheck
Automatically identify anti-patterns in SQL queries
Stars: ✭ 2,062 (-59.79%)
Mutual labels:  sql, database, mysql
Linq2db
Linq to database provider.
Stars: ✭ 2,211 (-56.88%)
Mutual labels:  sql, database, mysql
Granite
ORM Model with Adapters for mysql, pg, sqlite in the Crystal Language.
Stars: ✭ 238 (-95.36%)
Mutual labels:  sql, database, mysql
Php Sql Query Builder
An elegant lightweight and efficient SQL Query Builder with fluid interface SQL syntax supporting bindings and complicated query generation.
Stars: ✭ 313 (-93.9%)
Mutual labels:  sql, database, mysql

go-clean-arch

Changelog

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

The original explanation about this project's structure can read from this medium's post : https://medium.com/@imantumorang/golang-clean-archithecture-efd6d7c43047.

It may different already, but the concept still the same in application level, also you can see the change log from v1 to current version in Master.

How To Run This Project

Make Sure you have run the article.sql in your mysql

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

Run the Testing

$ make test

Run the Applications

Here is the steps to run it with docker-compose

#move to directory
$ cd workspace

# Clone into YOUR $GOPATH/src
$ git clone https://github.com/bxcodec/go-clean-arch.git

#move to project
$ cd go-clean-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

Tools Used:

In this project, I use some tools listed below. But you can use any simmilar library that have the same purposes. But, well, different library will have different implementation type. Just be creative and use anything that you really need.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].