- Golang 1.16.2 or higher
- Python 3.7 or higher
- Extract zip file and move to folder src project Go
If run auth-app golang error "gcc executable" you are running Ubuntu do:
$ apt-get install build-essentialIf you want check deploy host you can change url API with 103.56.207.67
If you want to check with Postman, you can import .json in the folder postman
Go to the directory auth-app for setup and run app
$ cd auth-appSetup dependencies
$ go get github.com/go-chi/chi/v5
$ go get github.com/stretchr/testify
$ go get github.com/newm4n/goornogo
$ go get github.com/mattn/go-sqlite3
$ go get github.com/dgrijalva/jwt-goRun application
$ go run main.pybuild application
$ make buildrun application
$ make rununit test code
$ make testclean go
$ make cleandocker build application
$ make docker-builddocker run application
$ make docker-runAPI register user
$ curl -d "phone=12345678&name=arfian&role=admin" -H "Content-Type: application/x-www-form-urlencoded" -X POST 103.56.207.67:2001/auth/registerAPI login
$ curl -d "phone=12345678&password=LiY4" -H "Content-Type: application/x-www-form-urlencoded" -X POST 103.56.207.67:2001/auth/loginAPI check jwt
$ curl -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7Im5hbWUiOiJhcmZpYW4iLCJwaG9uZSI6IjEyMzQ1Njc4Iiwicm9sZSI6ImFkbWluIiwidGltZXN0YW1wIjoiU3VuZGF5LCAwNC1BcHItMjEgMDI6MjM6NTAgVVRDIiwidXNlcm5hbWUiOiJhcmZpYW4ifSwiZXhwIjoxNjE3NzYyMzE4fQ.qV1tkmnj_-QK3ZrWWHdMbXihq-eTtIYPHiIGFtQvckA" -X GET 103.56.207.67:2001/auth/checkjwtGo to the directory fetch-app for setup and run app
$ cd fetch-appInstall the dependencies.
$ pip3 install -r requirements.txtunit test code
$ make test run application
$ make run docker build application
$ make docker-builddocker run application
$ make docker-runAPI get price USD
$ curl -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7Im5hbWUiOiJhcmZpYW4iLCJwaG9uZSI6IjEyMzQ1Njc4Iiwicm9sZSI6ImFkbWluIiwidGltZXN0YW1wIjoiU3VuZGF5LCAwNC1BcHItMjEgMDI6MjM6NTAgVVRDIiwidXNlcm5hbWUiOiJhcmZpYW4ifSwiZXhwIjoxNjE3NzYyMzE4fQ.qV1tkmnj_-QK3ZrWWHdMbXihq-eTtIYPHiIGFtQvckA" -X GET 103.56.207.67:2002/fetch/getpriceAPI Aggregate data
$ curl -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7Im5hbWUiOiJhcmZpYW4iLCJwaG9uZSI6IjEyMzQ1Njc4Iiwicm9sZSI6ImFkbWluIiwidGltZXN0YW1wIjoiU3VuZGF5LCAwNC1BcHItMjEgMDI6MjM6NTAgVVRDIiwidXNlcm5hbWUiOiJhcmZpYW4ifSwiZXhwIjoxNjE3NzYyMzE4fQ.qV1tkmnj_-QK3ZrWWHdMbXihq-eTtIYPHiIGFtQvckA" -X GET 103.56.207.67:2002/fetch/getaggregateAPI check jwt
$ curl -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7Im5hbWUiOiJhcmZpYW4iLCJwaG9uZSI6IjEyMzQ1Njc4Iiwicm9sZSI6ImFkbWluIiwidGltZXN0YW1wIjoiU3VuZGF5LCAwNC1BcHItMjEgMDI6MjM6NTAgVVRDIiwidXNlcm5hbWUiOiJhcmZpYW4ifSwiZXhwIjoxNjE3NzYyMzE4fQ.qV1tkmnj_-QK3ZrWWHdMbXihq-eTtIYPHiIGFtQvckA" -X GET 103.56.207.67:2002/fetch/checkjwt