CMS project. Administrator/content/user management tool. Experimental project.
How to install & start the application and it's dependencies.
From https://golang.org/doc/install
- Download the go version from here. (You need at least 1.10.8)
- Extract it into
/usr/local
(root or sudo)
tar -C /usr/local -xzf go1.11.2.linux-amd64.tar.gz
- Add
/usr/local/go/bin
to thePATH
environment variable. (you can paste it into your .bash_profile/.bashrc/.zshrc/etc... file & source it.)
export PATH=$PATH:/usr/local/go/bin
- Try to run go version command to make sure, that the installation was successful.
$ go version
go version go1.11.2 linux/amd64
From https://github.com/golang/go/wiki/SettingGOPATH
Let's assume, that you have a go
directory in your HOME
folder, and you want to develop your gocode under that dir. Make sure that you have a bin
and a src
dir. under the go
dir.
Add the following lines in your bash/zsh rc/profile file, and then source it.
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
From https://github.com/golang/dep
- Install with apt-get
sudo apt-get install go-dep
- Or install with script
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
From https://gobuffalo.io/en/docs/installation
- Node -gte 8 - how to install
- NPM - info
$ curl -OL https://github.com/gobuffalo/buffalo/releases/download/v0.14.2/buffalo_0.14.2_linux_amd64.tar.gz
$ tar -xvzf buffalo_0.14.2_linux_amd64.tar.gz
$ sudo mv buffalo /usr/local/bin/buffalo
You have a bunch of options for getting an application from github. Due to the golang's dependencies, you have to make sure, that this application is donwloaded to the right place.
- go get
$ go get github.com/akosgarai/buffalo_example
$ cd $GOPATH/src/github.com/akosgarai/buffalo_example
- git clone
$ mkdir -p $GOPATH/src/github.com/akosgarai
$ cd $GOPATH/src/github.com/akosgarai
$ git clone git@github.com:akosgarai/buffalo_example.git
My buffalo example application uses postgres database, so that we need a working db server instance, that the app can use. From https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-16-04
- Installation
$ sudo apt-get update
$ sudo apt-get install postgresql postgresql-contrib
- DB management - switch to postgres user
$ sudo -i -u postgres
- Starting psql app (postgres user)
$ psql
In psql shell, you are able to create users/databases, so that you can setup everything for your needs.
Before the first start, you have to setup the database that contains the necessary tables, and the initial values (eg admins).
$ soda create -a
$ soda migrate up
Buffalo ships with a command that will watch your application and automatically rebuild the Go binary and any assets for you. To do that run the "buffalo dev" command:
$ buffalo dev
If you point your browser to http://127.0.0.1:3000 you should be redirected to the http://127.0.0.1:3000/login page.
Good to know
- Use the built in tool:
buffalo test
- Don't be logged in to the database when you want to run the tests