Clean architecture in Go.

go-employee

Clean architecture in Go.

Based on the learnings from the book Get Your Hands Dirty on Clean Architecture by Tom Hombergs

testing

requires docker and make

unit tests with code coverage:
TEST_PG_HOST=localhost TEST_PG_PORT=5432 TEST_PG_USER=postgres TEST_PG_PASSWORD=testpwd TEST_PG_DBNAME=postgres make test

integration tests with code coverage:
TEST_PG_HOST=localhost TEST_PG_PORT=5432 TEST_PG_USER=postgres TEST_PG_PASSWORD=testpwd TEST_PG_DBNAME=postgres make test-integration

run

requires docker and postgres

docker build . -t rubinthomasdev/go-employee:latest

for postgres running on windows host
docker run -p 8080:8080 -e PG_HOST=host.docker.internal -e PG_PORT=5432 -e PG_USER=postgres -e PG_PASSWORD=yourpgpassword -e PG_DBNAME=postgres --name employeeapi rubinthomasdev/go-employee:latest

for postgres running on mac host
docker run -p 8080:8080 -e PG_HOST=docker.for.mac.localhost -e PG_PORT=5432 -e PG_USER=postgres -e PG_PASSWORD=yourpgpassword -e PG_DBNAME=postgres --name employeeapi rubinthomasdev/go-employee:latest

endpoints:

to get all employees data:

curl --location --request GET 'localhost:8080/api/v1/employees' \
--header 'Content-Type: application/json'

to get a single employees data:

curl --location --request GET 'localhost:8080/api/v1/employees/1' \
--header 'Content-Type: application/json'
Similar Resources

Clean Architecture using Golang.

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 Bo

Nov 1, 2022

Sample Go REST API implementation with DDD using Clean Architecture.

This layer is a part developed for client-side (mobile, web, etc.) applications to access our domain. It will forward the requests from this layer to the application layer and expose the response it receives from the application layer.

Jan 3, 2023

Rest API for todoapp written in Golang, using clean architecture, CI/CD

Rest API for todoapp written in Golang, using clean architecture, CI/CD

todoapp-backend Rest API for todoapp written in Golang, using Clean Architecture and CI/CD (includes unit tests and integration tests). Using: Web fra

Oct 23, 2022

Example go clean architecture folder pattern

Golang Clean Architecture (Maintenance) Berikut ini adalah folder structure pattern yang biasa saya gunakan, walaupun tidak semua nya saya terapkan di

Dec 21, 2022

Clean Architecture in Go (Golang) projects-DDD

Clean Architecture in Go (Golang) projects-DDD

go-clean-arch Changelog v1: checkout to the v1 branch Proposed on 2017, archived to v1 branch on 2018 Desc: Initial proposal by me. The story can be r

Oct 11, 2021

REST API boilerplate built with go and clean architecture - Echo Framework

GO Boilerplate Prerequisite Install go-migrate for running migration https://github.com/golang-migrate/migrate App requires 2 database (postgreSQL an

Jan 2, 2023

Clean Architecture template for Golang services

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

Jul 11, 2022

Best simple, lightweight, powerful and really fast Api with Golang (Fiber, REL, Dbmate) PostgreSqL Database and Clean Architecture

GOLANG FIBER API (CLEAN ARCHITECTURE) Best simple, lightweight, powerful and really fast Api with Golang (Fiber, REL, Dbmate) PostgreSqLDatabase using

Sep 2, 2022

Go clean architecture fully working example

Burp - clean architecture app Burp is a CRUD app managing beers. Front-end is written in Angular 12. Database in this example is mongodb. Root project

Nov 27, 2022

Go Clean Architecture Boilerplate

Go Clean-Architecture Simple Go Clean-Architecture Boilerplate Overview The purpose of the template is to show: How to organize a project and prevent

Nov 27, 2021

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

Menggunakan clean architecture dengan domain driven design

Golang project Menggunakan clean architecture dengan domain driven design Domain - Entity Sebuah model untuk entitas Domain - Model Hampir sama dengan

Jan 4, 2022

Clean Architecture With Golang

Clean Architecture With Golang When init a new project go mod init github.com/samuelterra22/clean-architecture-go Run testes go test ./... Generate a

Aug 2, 2022

Clean Architecture template for Golang services

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

Oct 19, 2022

Implement clean-architecture sample by golang

Implement clean-architecture sample by golang

Feb 17, 2022

API em Golang utilizando clean architecture

Clean Arch in Go Read about Clean Architecture Build make Run tests make te

Dec 23, 2021

Fiber Clean Architecture With GORM

Fiber Clean Architecture With GORM I offer this repository as a proposal for a c

Oct 30, 2022

An example of implementation of Clean Architecture in Golang

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

Dec 29, 2021

Implementation of clean architecture in golang with gin-gonic & gorm

Boilerplate API Boilerplate API template includes all the common packages and setup used for API development in this Company. Development Copy .env.ex

Feb 15, 2022
Clean architecture in Go.

go-employee Clean architecture in Go. Based on the learnings from the book Get Your Hands Dirty on Clean Architecture by Tom Hombergs testing requires

Nov 16, 2022
Golang Clean Architecture based on Uncle Bob's Clean Architecture and Summer internship in 2021

clean-architecture-api Description This is an example of implemention of Clean Architecture in Golang projects. This project has 4 layer : Infrastruct

Feb 20, 2022
This is a POC (Proof of Concept) using Hexagonal Architecture, SOLID, DDD, Clean Code, Clean Architecture
This is a POC (Proof of Concept) using Hexagonal Architecture, SOLID, DDD, Clean Code, Clean Architecture

Projeto Planetas Star Wars: Esse projeto de trata de uma POC utilizando os conceitos de Clean Arch, Hexagonal Arch, Clean Code, DDD, e SOLID. O princi

Feb 10, 2022
Clean-todo - An example of go app with clean architecture

clean-todo An example of go app with clean application Functionality This is a s

Jan 26, 2022
Clean architecture validator for go, like a The Dependency Rule and interaction between packages in your Go projects.
Clean architecture validator for go, like a The Dependency Rule and interaction between packages in your Go projects.

Clean Architecture checker for Golang go-cleanarch was created to keep Clean Architecture rules, like a The Dependency Rule and interaction between mo

Dec 31, 2022
CRUD API server of Clean Architecture with Go(Echo), Gorm, MySQL, Docker and Swagger
CRUD API server of Clean Architecture with Go(Echo), Gorm, MySQL, Docker and Swagger

CRUD API Server of Clean Architecture Go(echo) gorm mysql docker swagger build docker-compose up -d --build API Postman and Fiddler is recommended to

May 14, 2022
An idiomatic Go REST API starter kit (boilerplate) following the SOLID principles and Clean Architecture

Go RESTful API Starter Kit (Boilerplate) This starter kit is designed to get you up and running with a project structure optimized for developing REST

Jan 3, 2023
CRUD API server of Clean Architecture with Go(Echo), Gorm, MySQL, Docker and Swagger
CRUD API server of Clean Architecture with Go(Echo), Gorm, MySQL, Docker and Swagger

CRUD API Server of Clean Architecture Go(echo) gorm mysql docker swagger build docker-compose up -d --build API Postman and Fiddler is recommended to

May 30, 2021
Go monolith with embedded microservices including GRPC,REST,GraphQL and The Clean Architecture.
Go monolith with embedded microservices including GRPC,REST,GraphQL and The Clean Architecture.

GoArcc - Go monolith with embedded microservices including GRPC,REST, graphQL and The Clean Architecture. Description When you start writing a Go proj

Dec 21, 2022
Clean architecture in Go.

go-employee Clean architecture in Go. Based on the learnings from the book Get Your Hands Dirty on Clean Architecture by Tom Hombergs testing requires

Nov 16, 2022