• Stars
    star
    250
  • Rank 161,830 (Top 4 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 12 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Go lang web app "framework" showcasing straightforward, no-magic, web development

Gooo

   _____
  / ____|
 | |  __  ___   ___   ___
 | | |_ |/ _ \ / _ \ / _ \
 | |__| | (_) | (_) | (_) |
  \_____|\___/ \___/ \___/

Go lang web app "framework" showcasing straightforward, no-magic, web development with the Go language. Includes batch template processing and interaction with postgresql databases, and Model-View architecture.

Quick Start

  • Make sure your GOPATH and GOROOT are set.
    • For help, run go help gopath
  • ./install
  • ./run
    • this performs the following commands:
    • go build
    • ./Gooo

Philosophy

  • Anti-magic
  • So simple, that it's complex.
  • So complex, that it works.
  • If it doesn't work, publish it.

Modular architecture

  • model
    • struct type
    • no special tags or fields, models are just Go structs
    • business logic - straightforward DB methods to be used in the view module
  • view
  • parses templates in tmpl/ folder and defines how they are rendered
  • uses html/template to parse and render
  • fetches rows from database as type Model interfaces
  • router
    • handles dynamic and static routes, request methods, main handler matches the request URL against the routes
    • middleware filters for restful routes
  • introspection
    • models implement interface{} and []interface{} types
    • Go's dynamic feature is interface type conversion, generally checked at runtime
    • Interface -> JSON interface{} -> []byte
    • Interface -> Struct []interface{} -> map[string]interface{}
    • GetStructValues interface{} -> []interface{}
    • InterfaceName: interface{} -> string
  • util
    • generic error handler HandlerErr(err error)

Martin Odersky

Tested and approved by Typeunsafe© Corporation


Tell me more...

Why Go?

Is it good?

Are you good?

Let's Gooo test the example blog app

  • resolve dependencies and install
    • ./install
    • don't want to use postgresql?
      • Sign up for a free Heroku Postgres account here.
      • Create a database and save the connection params for the next step.
      • Or skip this step
  • configure the database connection variable dbParams in the model package (model/model.go)
  • ./Gooo
  • http://localhost:8080/hello/world
  • Gooo celebrate
  • Gooo outside

Let's Gooo write your own Gooo app

  • resolve dependencies and install
    • ./install
    • don't want to use postgresql?
      • Sign up for a free Heroku Postgres account here.
      • Create a database and save the connection params for the next step.
  • define your model interfaces and configure the database connection in the model package (model/model.go)
    • implement your model interface types with anonymous BaseModel field
      • use `json:"-"` for type safety and Go lang future proofing
    • implement functions and variables available to all models with anonymous BaseModel field in the Model interface type
  • define your views as request handler functions in the view package (view/view.go)
  • write your templates in tmpl/ (Go text/template syntax)
  • define routes in main package gooo.go
  • ./Gooo
  • http://localhost:8080/hello/world
  • Gooo celebrate
  • Gooo outside

Gooo read these


Gopher


Enjoy,

- Aaron Lifton

More Repositories

1

react-simple-image-zoom

Simple image zoom component for react
TypeScript
14
star
2

s3_image_optimizer

optimize images in a s3 bucket with image_optim
Ruby
3
star
3

react-server-context

provide data to react components from react-router staticContext, or from window, through a single interface
TypeScript
2
star
4

angular-infinite-scroll

600 byte infinite scroll library for angularJS
HTML
2
star
5

angular-lazy-load

2kb lazy load module for angular. only requirement is angular. supports IntersectionObserver.
JavaScript
2
star
6

BollingerBands

bollinger bands ruby gem [WIP]
Ruby
2
star
7

lilrouter

A simple clojure HTTP router.
Clojure
2
star
8

scala_scripts

Scala
2
star
9

typescript-connect4

Typescript implementation of Connect4 game
TypeScript
1
star
10

MetaProtoObject

Extends Ruby's Object, Array, and Hash Classes with Evil Magic
Ruby
1
star
11

ecs-tool

Easier way of logging into docker containers running on Amazon ECS
Go
1
star
12

AkkaScalazStreams

Akka Actors + Scalaz Streams
Scala
1
star
13

dopevm

dope
Ruby
1
star
14

typescript-snake

Typescript implementation of snake game
TypeScript
1
star
15

active_job_qless

Rails ActiveJob adapter for Qless
Ruby
1
star
16

async-eventmachine-upload

Uploads a file without leaving the page and asynchronously updates the progress of the file upload to the user.
Ruby
1
star
17

sephora_scraper

A web scraper that gets product names, brands, formatted ingredients, images, and available sizes from Sephora's makeup category, and inserts them into a relational DB with several foreign key relationships..
Ruby
1
star
18

metatask

clojure todo list that saves to a TOML file
Clojure
1
star