A fully-featured REST API developed in Golang for an ebook store.
Check out the TODO.md if you want to have some fun 😇
- Authentication (Sign up, Login and Reset Password)
- Multiple Roles (Customer and Administrator)
- Book Catalog Management
- Order Management
- Pagination
- Order Creation
- File Storage/Retrieval
- Payment Management
- Golang
- Gin
- PostgreSQL
- GORM
- JWT
- Bcrypt
- Wire
- Viper
- Zap
- Stripe
- Amazon S3
- Amazon SES
- Swagger
- Localstack
- Testify
- golangci-lint
This is a high-level technical documentation about how this application is structured. The diagrams follow the C4 model
- SOLID Principles
- Hexagonal Architecture
- Domain Driver Design
- Package by Feature
- Test-Driven-Development
- Execute docker containers
make docker-up
- Execute REST HTTP Server
make start_server
- Open
http://localhost:8080/docs
in your browser
- Install golangci-lint
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
- Execute
lint
target
make lint
Pre-commit hooks are very useful to prevent commits with bad code.
- Install Husky
go install github.com/go-courier/husky/cmd/husky@latest
- Init Husky
husky init
- Execute docker containers
make docker-up
- Clean database and generate seed data
make generate_seed_data
- Install Mockery
go install github.com/vektra/mockery/v2@latest
- Generate Mocks
make generate-mocks
- Install Swaggo
go install github.com/swaggo/swag/cmd/swag@v1.7.8
- Generate Docs
make api-docs
- Install wire
go install github.com/google/wire/cmd/wire@latest
- Execute wire
make wire