Ok Go

screenshot of Ok Go

Ok Go

A template for golang web applications inspired by Ruby on Rails

Overview

The Ok Go Web Template is a Golang web application template that aims to provide similar functionality to Ruby on Rails. It includes a range of features and libraries commonly used in web development.

Features

  • Middleware support with Negroni.
  • Routing with Gorilla Mux.
  • Database ORM support with Gorm.
  • Database migrations with Gomigrate and Gofer.
  • Template rendering with Render.
  • Asset pipeline with Gulp.
  • Configuration stored in the OS environment.
  • Testing with Ginkgo and Gomega.

Installation

  1. Ensure you have a working Go environment and Postgres running on port 5432.
  2. Create your development and test databases using the following commands:
    • createdb okgo_dev
    • createdb okgo_test
  3. Clone the repository into your GOPATH/src folder:
    • git clone git@github.com:runemadsen/ok-go.git github.com/runemadsen/ok-go
  4. Create a .env file and a .env.test file in the root folder and add the following environment variable:
    • DATABASE_URL=postgres://MYUSER@localhost:5432/okgo_ENVIRONMENT?sslmode=disable
  5. Install all imported packages and additional command-line requirements:
    • go get -u github.com/codegangsta/gin
    • go get -u github.com/chuckpreslar/gofer/gofer
    • sudo npm install -g gulp && npm install
  6. To run the development server, run the command "gulp server" and open localhost:3000 in your browser.
  7. To run the tests, run the command "ginkgo -r" from the root folder.

Summary

The Ok Go Web Template is a Golang web application template that provides a range of features commonly found in Ruby on Rails. It includes support for middleware, routing, database ORM, database migrations, template rendering, an asset pipeline, configuration management, and testing. The template comes with instructions for installation and usage, making it easy to get started with Golang web development.

gulp
Gulp

Gulp.js is an old but popular site building tool that automates various repetitive development tasks in web development, such as compiling Sass, minifying JavaScript, and optimizing images.