Giter VIP home page Giter VIP logo

cug's Introduction

Slides for Chicago Ultimate Go Meetup, October 18:

http://go-talks.appspot.com/github.com/kkeuning/cug/slides/gatt.slide

Video of the meetup: https://vimeo.com/196251649

Go APIs: Just Generate Everything With Goa

aka, "generate all the things!"

alt tag

An Introduction to Goa for Microservices and SPAs

Get this repo first for the slides and examples:

go get github.com/kkeuning/cug

To present the slides locally:

Install present
go get golang.org/x/net
go get golang.org/x/tools
go install golang.org/x/tools/cmd/present
cd $GOPATH/src/github.com/kkeuning/cug/slides
$GOPATH/bin/present

Now point your browser to localhost:3999 to view the slides.

Examples

First, install goa and gorma:

go get -u github.com/goadesign/goa/...
go get github.com/goadesign/gorma

Check out the v1.0.0 tag of goa for best compatibility with my examples.

cd $GOPATH/src/github.com/goadesign/goa
git checkout tags/v1.0.0
cd goagen
go install

Next, install the goa examples:

go get github.com/goadesign/examples
go get github.com/goadesign/goa-cellar
go get github.com/goadesign/gorma-cellar
go get github.com/kkeuning/reduxa

Don't forget to get this repo also if you have not already:

go get github.com/kkeuning/cug

Add my forks as remotes to get my additions to the standard examples:

My fork of goa-cellar adds support for cors:

cd $GOPATH/src/github.com/goadesign/goa-cellar
git remote add kkeuning https://github.com/kkeuning/goa-cellar
git remote update
git checkout -t kkeuning/cors

My fork of gorma cellar adds several extras for the demo:

cd $GOPATH/src/github.com/goadesign/gorma-cellar
git remote add kkeuning https://github.com/kkeuning/gorma-cellar
git remote update
git checkout -t kkeuning/chicago

Build the gorma-cellar container:

docker build -t gorma-cellar .

Fire up the React example, and connect it to gorma-cellar (or goa-cellar if you prefer, docker-compose will use gorma-cellar):

cd $GOPATH/src/github.com/kkeuning/cug/examples/react-goa-cellar
docker-compose build
docker-compose up

Seed your database:

cd $GOPATH/src/github.com/goadesign/gorma-cellar/seeder
go build
bash seeder.sh

Point your browser to http://0.0.0.0:2015/ and click Bottles to connect to the api.
I suggest doing this with you browser developer tools open recording network activity to get a feel for the interactions with the cellar api. Also, the Chrome Redux devtools are nice and enabled for the example.

Extras:

Swagger UI: https://github.com/swagger-api/swagger-ui

Bootprint (Static Swagger UI alternative) https://github.com/bootprint/bootprint

Vegeta: https://github.com/tsenart/vegeta

Baloo (end to end api testing): https://github.com/h2non/baloo

Chrome Redux devtools: https://github.com/zalmoxisus/redux-devtools-extension

Restful API Guidelines: http://zalando.github.io/restful-api-guidelines/

JSON API Specification: http://jsonapi.org/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.