Skip to content

GulDmitry/golang-api-vue-js

Repository files navigation

Golang API and Vue JS

Inside

Installation

  • go get github.com/astaxie/beego
  • go get github.com/beego/bee
  • go get github.com/satori/go.uuid
  • go get github.com/smartystreets/goconvey/convey
  • go get github.com/astaxie/beego/orm
  • go get github.com/go-sql-driver/mysql
  • cp conf/app.conf.dist conf/app.conf

Note: echo "export GOPATH=/var/www/golang" >> ~/.zshrc and echo "export GOROOT=/usr/lib/go" >> ~/.zshrc

Run

  • $GOPATH/bin/bee run
  • Generate docs $GOPATH/bin/bee generate docs, run $GOPATH/bin/bee run -downdoc=true to download swagger.
  • Webpack
    • For runmode = prod generate assets NODE_ENV='production' ./node_modules/.bin/webpack -p
    • For runmode = dev run ./node_modules/.bin/webpack-dev-server --progress --colors --port 8081 --content-base=static/
  • Go to http://localhost:8080, API http://localhost:8080/swagger/
  • Tests go test ./... or go test ./tests

Run Docker (DEV only)

  • docker-compose up run server and generate API docs
  • Webpack
    • For runmode = prod generate assets NODE_ENV='production' ./node_modules/.bin/webpack -p
    • For runmode = dev run ./node_modules/.bin/webpack-dev-server --progress --colors --port 8081 --content-base=static/
  • Uncomment testDB() in controllers/main.go:init() to test the ORM.
  • Go to http://localhost:8080, API http://localhost:8080/swagger/, MySQL UI http://localhost:8090
  • Tests ./bin/go test ./... or ./bin/go test ./tests

Note: ./bin/go - make a container and run the command, ./bin/go env to show containers env variables.

TODO

  • User.
  • Data picker and format data on client.
  • ORM.

About

Simple Golang REST API and UI on Vue.js.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published