Golang Service Boilerplate Using Echo Framework
The fastest way to build a restful api with Echo with a structured project that using PostgreSQL db and JWT base authentication middleware.
This project ships following features as default:
- Sqlx Integration with PostgreSQL
- Easy Database Migration with
Go migrate
- Authentication Using Jwt (Access Token and Refresh Token)
- Easy dotenv Management
- CORS Configuration
- Logger layer with Zap
- Caching layer with Redis
- Authorization RBAC with Casbin
- Clean structured Project
Installation
Requirements
- Go version >= 1.18
- PostgreSQL
- Redis
- Taskfile (Optional)
Clone the repository
$ go get github.com/derektruong/go-service-boilerplate
Using Taskfile (Recommended)
$ task init-dev
$ task migrate-up
# ---seed data---
$ task migrate-seed
$ task run-dev