- Golang: version 1.21
- Echo: version 4
- Gorm: version 1.21
- JWT: version 3.21
- PostgreSQL: version 16
- Cloudinary
- Docker: version 20.10
- Docker-compose: version 1.29
- Makefile: version 4.3
- Swagger: version 2.0
- mockery
- assert
- Source code base on Domain Driven Design & Clean Architecture
- Base on Clean Architecture source code by Uncle Bob
Clean Architecture is a software development architecture that has become a standard for building easily maintainable, platform-independent, and source code-reusable applications. Below are some important benefits of using Clean Architecture
- Use radix tree to handle save file assets
├── makefile # run makefile to run project
├── cmd
│ ├── main.go # entry point
├── presenter
│ ├── controller # To handle requests from clients and return responses
│ ├── middleware # Middleware to handle requests before reaching the controller
│ ├── request # Request struct
│ ├── router # Router
│ ├── docs # Swagger docs
├── usecase # business logic
├── domain
│ ├── assets # save file uploaded
│ ├── entity # database entity
│ ├── # response.go # struct mapping model to response
│ ├── repo # repository interface
│ ├── model # struct mapping database table
├── pkg
│ ├── api_errors # error response
│ ├── lib # Set up external libraries.
│ ├── constants # constants
│ ├── utils # utils
├── infra # config connecting to external services
├── boostrap # dependencies injection modules
├── config # config file
│ ├── app.env # environment variables
│ ├── config.yaml # config file
│ ├── config.go # load config file
├── migration # Database migrations
- Install Postgres
- Install Golang
- Get KeyAPI of Cloudinary
- Clone this project
- Create database
- Create .env & config.yml file in config folder
- Run
make
to run project - Run
mockery --dir=domain --output=domain/mocks --outpkg=mocks --all
to generate mock file