- Each brand has it own
pickup_address
- Validations for related resource are done in delivery layer. e.g.
brand_id
in product create. - Two roles are available for table
users
, which are "admin" and "user". Anyway, records of either roles can be created from guest http API. - Token-based authentication, and save auth session too
- net/http - Standard library as multiplexer or router
- sqlx - Extensions to database/sql.
- pgx - PostgreSQL driver and toolkit for Go
- JWT - A Go implementation of JSON Web Tokens.
- viper - A Go configuration with fangs
- go-redis - Redis client for Golang
- zap - Logger
- validator - Go Struct and Field validation
- migrate - Database migrations. CLI and Golang library.
- testify - Testing toolkit
- gomock - Mocking framework
- CompileDaemon - Compile daemon for Go
- Docker - Docker
docker-compose.local.yml
or
docker-compose.dev.yml
make develop
make local
or
make run
After deployment, run
make migrate_up
Register admin and buyer user from http://localhost:5001/user/create
http://localhost:5001/swagger/ or http://139.162.7.112:5001/swagger/ (test)
curl -X POST \
-d '{
"email": "admin@gmail.com",
"password": "admin"
}' \
http://139.162.7.112:5001/swagger/index.html#/Users/post_user_login
curl -X POST \
-d '{
"email": "djourdan555@gmail.com",
"password": "hello"
}' \
http://139.162.7.112:5001/swagger/index.html#/Users/post_user_login