joelewis / gorilla-seed

Seed project for a golang-gorilla powered web app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A quick seed for the golang-gorilla stack

Getting Started

  • Clone the repo: git clone https://github.com/joelewis/gorilla-seed
  • Update the config variables in main.go (DB_URL, SERVER_PORT, etc.)
  • Rename the directory's name to your app's name. mv /path/to/gorilla-seed /path/to/my-app-name
  • Update import paths. Eg. import "path/to/gorilla-seed/models" to import "path/to/my-app-name/models"
  • Compile: go build
  • Initialize tables: ./my-app-name inittables
  • Run server : ./my-app-name

What is inside?

Nothing much.

  • A developer friendly ORM - gorm
  • A user model with a basic setup of gorilla/sessions for authentication. There is no pages or handlers for user signups or login/logout. It is left for you to implement.

Where to start?

  • Define the route in routes.go
  • Add corresponding handler in controllers/controllers.go
  • Add the model structs in models/models.go

About

Seed project for a golang-gorilla powered web app.

License:MIT License


Languages

Language:Go 99.6%Language:HTML 0.4%