Golang restful-api project starter-kit with Gin and Postgresql (using pgx library). This starter project build using DDD
model architect.
# NOTE: PROJECT is NOT READY yet.
The package used in this project:
- Gin, most stared Go web framework on Github
- pgx, the best PostgreSQL driver for Go
- jwt, Jwt Authentication and Authorization
- logrus, logger for access log, database log, and server log
- viper, complete configuration solution
- Air, Hot reload support for fast development
|-- root/
|-- |-- cmd/
|-- |-- |-- app/
|-- |-- |-- |-- server/
|-- |-- |-- main.go
|-- |-- config/
|-- |-- |-- .config.yaml
|-- |-- dist/
|-- |-- internal/
|-- |-- |-- app/
|-- |-- |-- |-- account/
|-- |-- |-- |-- |-- datastore/
|-- |-- |-- |-- |-- handler/
|-- |-- |-- |-- |-- service/
|-- |-- |-- |-- |-- README.md
|-- |-- |-- |-- |-- router.go
|-- |-- |-- |-- mail/
|-- |-- |-- config/
|-- |-- |-- database/
|-- |-- |-- |-- sql/
|-- |-- |-- domain/
|-- |-- |-- pkg/
|-- |-- |-- |-- auth/
|-- |-- |-- |-- errors/
|-- |-- |-- |-- helper/
|-- |-- |-- |-- logger/
|-- |-- log/
|-- |-- vendor/
|-- |-- go.mod
|-- |-- go.sum
|-- |-- LICENSE
|-- |-- Makefile
|-- |-- README.md
Before we run the app, make sure the config has been set.
from the root
directory, run
cp config/example.config.yaml .config.yaml
to test application (with hot reload), run:
air
OR
run without hot reload:
make run
To build the app, run:
make build
To run the test, run:
make test
Show test coverage result on browser:
# make sure file 'proof.out already exist/ generated'
make show-test
Generate new test coverage and show result on browser:
make test-proof
- Jwt Authentication and Authorization
- Add Test
- Add blog app