/go-gin-ng6-starter

Starter project with Golang Gin backend and Angular 6 frontend using Protocol Buffers. Includes Postgres, JWT, Socket.io, Docker, and CI + CD config.

Primary LanguageJavaScriptMIT LicenseMIT

Golang Gin + Angular 6 Web Application

Technologies

Starter project template using the following libraries/frameworks:

Services for CI & CD:

Get project from Github

To get the project, you need to install Go and set your Go workspace (i.e. $GOPATH) first.

$ go get github.com/app8izer/go-gin-ng6-starter

Alternatively, use git to clone the project:

$ git clone https://github.com/app8izer/go-gin-ng6-starter.git

Install Golang Dependencies via govendor

If not yet installed, install govendor via:

$ go get -u github.com/kardianos/govendor

To install the golang dependencies, run

$ govendor sync

in root of project.

Install Angular Dependencies via npm/yarn

If not yet installed, install node + npm/yarn, e.g. for Mac OS run

$ brew install yarn 

which will also install Node.js if it is not already installed.

To install the Angular dependencies, run

$ cd ./frontend
$ yarn install

in root of project.

Install Protobuf Compiler (protoc)

If not yet installed, install protoc, e.g. for Mac OS:

$ brew install protoc

To compile the schema to Go and Typescript sources run

$ cd ./proto
$ sh ./compile_proto.sh

in root of project.

Development Setup

To start the application with PostgreSQL database, Golang backend, and Angular frontend, the following steps are required.

Database: PostgreSQL

Run

$ docker-compose -f docker-compose.dev.yml

in root of project directory. This will fire up a database listening on port 5432 of your localhost.

Backend: Gin Gonic

To start the backend server on port 8080 run

$ cd ./backend
$ go run main.go

in root of project directory.

Frontend: Angular

To start the frontend server on port 4200 run

$ cd ./frontend
$ yarn run dev

in root of project directory.