Giter Site home page Giter Site logo

kaichihcodeme / go-ddd-template Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 33 KB

Go Lang/ Gin DDD style template for easier to build a go backend application.

Go 92.24% Makefile 0.95% Shell 1.91% Dockerfile 4.90%
api backend backend-api backend-service go golang mysql

go-ddd-template's Introduction

Go/Gin Design-Driven Design Style Template

Introduction

This is a repository for creating a DDD style Go template.

Here implement some simple APIs to query MySQL DB and return the result from DB. And here would apply docker to pack Go API and DB in local. So you can try this project by your local site.

Features

  • A DDD style Go/ Gin API Backend
  • Support Swagger (OpenAPI)
  • Support Log Middleware
  • R/W with MySQL Database via APIs

Requirements

  • Go 1.22.1

Backend Architecture

Our backend follows the DDD (Domain-Driven Design) structure to construct our Go lang backend system.

Initialize Go Project

  1. Create a project folder
  2. Ensure you have Go installed and required versions (check by go version in your cli)
  3. Use this commad to initialize your project in your project folder: go mod init <project-owner>/<project-name>

Packages

  • Gin
  • Viper -> configurations
  • Zap -> logger, and open to other repo using

Make steps

build: make build run: make run build&run: make br

Build up setting

Local

  • setup the connection string of DB in configs/go-template.json
  • then makefile
  • make build
  • make run

Other Env

  • create an .env file to specify the variables for DB and Env
  • then execute docker-compose up

go-ddd-template's People

Contributors

kaichihcodeme avatar

Stargazers

Dika avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.