Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/takeuchi-shogo/clean-architecture-go-sample
Modified for practicality from the previous one.
https://github.com/takeuchi-shogo/clean-architecture-go-sample
clean-architecture docker docker-compose gin-gonic golang gorm mysql
Last synced: 19 days ago
JSON representation
Modified for practicality from the previous one.
- Host: GitHub
- URL: https://github.com/takeuchi-shogo/clean-architecture-go-sample
- Owner: takeuchi-shogo
- Created: 2023-01-03T10:39:24.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-08-04T14:39:37.000Z (4 months ago)
- Last Synced: 2024-10-18T15:16:35.458Z (about 1 month ago)
- Topics: clean-architecture, docker, docker-compose, gin-gonic, golang, gorm, mysql
- Language: Go
- Homepage:
- Size: 319 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
.
├── README.md
├── app
│ ├── air.toml
│ ├── bin
│ │ └── dev
│ ├── go.mod
│ ├── go.sum
│ ├── lib
│ │ └── env.go
│ ├── main.go
│ ├── src
│ │ ├── adapters
│ │ │ ├── controllers
│ │ │ │ ├── context.go
│ │ │ │ ├── h.go
│ │ │ │ ├── logger.go
│ │ │ │ └── product
│ │ │ │ └── users_controller.go
│ │ │ ├── gateways
│ │ │ │ ├── gateways
│ │ │ │ └── repositories
│ │ │ │ └── user_repository.go
│ │ │ └── presenters
│ │ │ └── product
│ │ │ └── users_presenter.go
│ │ ├── application
│ │ │ ├── repositories
│ │ │ │ └── user_repository.go
│ │ │ ├── usecases
│ │ │ │ └── product
│ │ │ │ └── user_interactor.go
│ │ │ └── utilities
│ │ │ └── format.go
│ │ ├── entities
│ │ │ ├── errors.go
│ │ │ ├── response.go
│ │ │ └── users.go
│ │ └── infrastructure
│ │ ├── config
│ │ │ ├── config.go
│ │ │ └── config.go.sample
│ │ ├── database
│ │ │ └── db.go
│ │ ├── middleware
│ │ │ ├── cors.go
│ │ │ ├── logger.go
│ │ │ └── request_handler.go
│ │ ├── route
│ │ │ ├── routing.go
│ │ │ └── user_routes.go
│ │ └── server
│ │ └── server.go
│ ├── tasks
│ └── tmp
├── docker
│ ├── app
│ │ └── Dockerfile
│ ├── docker-compose.yml
│ ├── mysql
│ │ └── Dockerfile
│ └── nginx
│ └── Dockerfile
├── mysql
│ ├── config
│ │ └── my.conf
│ ├── data
│ └── migrations
│ └── 01_init_db.sql
└── nginx
└── config
└── default.conf#### 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](https://twitter.com/shogo_mthr123)