export USERNAME=
docker build -t $USERNAME/covid-tracker-user .
docker push $USERNAME/covid-tracker-user
docker build -t $USERNAME/covid-tracker-store .
docker push $USERNAME/covid-tracker-store
docker build -t $USERNAME/covid-tracker-record .
docker push $USERNAME/covid-tracker-record
A starter project with Golang, Gin and DynamoDB
Golang Gin boilerplate with DynamoDB resource. Supports multiple configuration environments.
This project use a DynamoDB base docker image.
Setup DynamoDB dependency: docker run -d -p 8080:8080 vsouza/dynamo-local --port 8080
.
├── Makefile
├── Procfile
├── README.md
├── config
│ ├── config.go
│ ├── development.yaml
│ ├── production.yaml
│ └── test.yaml
├── controllers
│ └── user.go
├── db
│ └── db.go
├── forms
│ └── user.go
├── header.jpg
├── main.go
├── middlewares
│ └── auth.go
├── models
│ └── user.go
└── server
├── router.go
└── server.go
make deps
curl -s ${TARGET_URL}/health
Running DynamoDB on Docker Image:
check this project: vsouza/docker-dynamoDB-local
- 0.0.1
- Configuration by environment, Auth and Log middlewares, User entity.
Vinicius Souza – @iamvsouza – [email protected]
Distributed under the MIT license. See License for more information.
TARGET_URL='http://3.224.156.234.sslip.io'
USER_PHONE='0912345678'
USER_PASS='878787'
STORE_PHONE='0987654321'
STORE_PASS='87878787'
STORE_NAME='giver'
STORE_ADDR='taipei'
curl -s -X POST ${TARGET_URL}/auth/user/signup -d "{\"phone\": \"${USER_PHONE}\", \"password\": \"${USER_PASS}\"}"
user_token=$(curl -s -X POST ${TARGET_URL}/auth/user/login -d "{\"phone\": \"${USER_PHONE}\", \"password\": \"${USER_PASS}\"}" | tee /dev/tty | sed 's/{"token":"\([^"]*\)"}/\1/')
curl -s -X POST ${TARGET_URL}/auth/store/signup -d "{\"phone\": \"${STORE_PHONE}\", \"password\": \"${STORE_PASS}\", \"name\": \"${STORE_NAME}\", \"address\": \"${STORE_ADDR}\"}"
store_token=$(curl -s -X POST ${TARGET_URL}/auth/store/login -d "{\"phone\": \"${STORE_PHONE}\", \"password\": \"${STORE_PASS}\"}" | tee /dev/tty | sed 's/{"token":"\([^"]*\)"}/\1/')
qrcode=$(curl -s -X GET ${TARGET_URL}/auth/store/profile -H "Authorization: Bearer ${store_token}" | tee /dev/tty | grep -o '"qrcode":"[^"]*"' | sed 's/"qrcode":"\([^"]*\)"/\1/')
curl -s -X POST ${TARGET_URL}/records -H "Authorization: Bearer ${user_token}" -d "{\"store_id\": \"${qrcode}\"}"