This repository powers the web service API used in https://saferwall.com.
These packages are used in the project:
- Language: Golang 1.21+
- Routing: Echo
- Configuration: viper
- Logging: zap
- Message queuing: nsq
- Authentication jwt
- Database: gocb
- Password Hashing: bcrypt
- Data Validation: validator
- i18n Translator: universal-translator
This project follows the Standard Go Project Layout
- build - contains packaging and Continuous Integration files.
- cmd - contains the main function.
- configs - contains configuration file templates or default configs.
- docs - contains design and user documents.
- db - contains database sql-like (n1ql) queries.
- internal - contains private project specific code.
- pkg - contains generic packages without project specific dependencies - these can be safely moved to other projects without internal dependencies.
- Install docker.
- git clone
https://github.com/saferwall/webapis.git
. - Create a
private.env
in the root directory:# Used by docker-compose NSQ service when debugging a service locally and # using all the other services from docker-compose. EXTERNAL_IP=<your-host-ip>
- Make sure
make
is installed and runmake init
.
- Standard Package Layout
- How Do You Structure Your Go Apps? by Kat Zień
- https://www.calhoun.io/moving-towards-domain-driven-design-in-go/
- Domain Driven Design in Golang - Strategic Design
- Idiometic Go Web Application Structure
- A clean architecture for Web Application in Go lang
- https://github.com/golang/go/wiki/CodeReviewComments
- https://golang.org/doc/effective_go
- https://peter.bourgon.org/go-best-practices-2016/
- https://www.youtube.com/watch?v=dp1cc6-QKY0