jeeo / golang-ddd-boilerplate

a Simple Golang boilerplate for DDD aplications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Golang DDD Boilerplate


It's a simple boilerplate for DDD based aplications

This boilerplate is using the following techs:

  • HTTP: Echo
  • Database: Postgres (default driver)
  • Dependency Injection: Wire
  • Mocks generation: gomock

One advantage of splitting your application into layers is that you can change your edges without concern about the application core <3 Change them as you need/want

Running in locally

  1. download and build dependencies
  $ make build
  1. Provide a .env file as .env.example or export this environment variables

  2. Run generated bin

  $ ./app

Docker

  1. Generate a docker image
  $ make build-docker
  1. Run it
  $ docker run --env-file .env --net=host jeeo/go_api

PS: I was lazy :) using host network and envfile is just for example purpose. Run it as you want following good pratices for your environment


Todo

  • Define project layers
  • Adds deployment artifacts
  • Unit tests example

there are few examples of unit tests for mapper and application layer =)

About

a Simple Golang boilerplate for DDD aplications


Languages

Language:Go 97.2%Language:Makefile 1.4%Language:Dockerfile 1.2%Language:Shell 0.3%