clean-architecture-go-sample

Modified for practicality from the previous one.

Stars
0
Committers
1

Clean Atchitecture With Golang

Clean architecture with gin framework, air hot reload library, gorm as orm for database related operations.

Orverview

A sample project to learn about Golang, Docker and Clean Architecture.

Requirement

  • macOS(Apple silicon)
  • Docker version 20.10.21

Running the project

  • Make sure you have docker installed.
  • Run git clone https://github.com/takeuchi-shogo/clean-architecture-golang.git
  • Copy .env.sample to .env
  • Copy ./app/src/infrastructure/config/config.go.sample to ./app/src/infrastructure/config/config.go
  • Run docker-compose --env-file ./.env -f docker/docker-compose.yml up -d
  • Go to localhost:8081

Description

Project tree

About /app

Folders related to the application itself.

  • bin

    binary folder.

  • lib

    load environment variables.

  • /src

    Contains the project source code.

    • /adapters

      interface layer.

    • /applications

      business logic layer.

    • /entities

      domain layer.

    • /infrastructure

      infra layer.

  • tasks

  • tmp

  • air.toml

    https://github.com/cosmtrek/air of setting file

  • go.mod, go.sum

    golang modules.

  • main.go

    root file.

About /docker

Contains the docker.

About /mysql

Contains the database.

About /nginx

Contains the nginx.

About etc...

  • .env

    Application-wide environment variable configuration file.

TODO

。。。。。

Author

My Twitter Account

Related Projects