A REST API using Go-Fiber
- Programming Language Version : Go 1.21.0
- Essential packages:
- Go Fiber v2 : a Go web framework built on top of Fasthttp, the fastest HTTP engine for Go
- GORM : an ORM for Go for database management
- Local package management:
- utilities : tools to make things easier
- models : program models, in this case only user model
- database : connecting the program with database server
- repositories : communicating with database, responsible for database CURD
- controllers : responsible to processing data. Bridge between controller and repositories
- requests : the API Gateway, the bridge between input, controller, and output
- routes : API routes to the controllers
- Download and install go 1.21.1
- Clone this repository
- Tidy up importing, download, and installing using:
go mod tidy
- the .envexample turns to .env and fill in / change necessary keys
- To test it properly you can use: for testing all packages
go test -p 1 --v ./...
go test -p 1 --v ./package_name
- To run the program :
go run driver.go