Skip to content
Web Application bootstrap for Go
Find file
Pull request Compare This branch is 10 commits behind elcct:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
controllers
helpers
models
public
system
views
.gitignore
LICENSE
README.md
config.json.example
server.go

README.md

Default Project Build Status

Provides essentials that most web applications need - MVC pattern and user authorisation that can be easily extended.

It consists of 3 core components:

Dependencies

Default Project requires Go, MongoDB and few other tools installed.

Instructions below have been tested on Ubuntu 14.04.

Installation

If you don't have Go installed, follow installation instructions described here: http://golang.org/doc/install

Then install remaining dependecies:

sudo apt-get install make git mercurial subversion bzr

MongoDB:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
sudo echo 'deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install mongodb-org

No go to your GOPATH location and run:

go get github.com/elcct/defaultproject

And then:

go install github.com/elcct/defaultproject

In your GOPATH directory you can create config.json file:

{
    "secret": "secret",
    "public_path": "./src/github.com/elcct/defaultproject/public",
    "template_path": "./src/github.com/elcct/defaultproject/views", 
    "database": {
        "hosts": "localhost",
        "database": "defaultproject"
    }
}

Finally, you can run:

./bin/defaultproject

That should output something like:

2014/06/19 15:31:15.386961 Starting Goji on [::]:8000

And it means you can now direct your browser to localhost:8000

Project structure

/controllers

All your controllers that serve defined routes.

/helpers

Helper functions.

/models

You database models.

/public

It has all your static files mapped to /assets/* path except robots.txt and favicon.ico that map to /.

/system

Core functions and structs.

/views

Your views using standard Go template system.

server.go

This file starts your web application and also contains routes definition.

Something went wrong with that request. Please try again.