movies-go-cq icon indicating copy to clipboard operation
movies-go-cq copied to clipboard

Neo4j Movies Demo App in go with cq

== Neo4j Movies Example Application

=== Stack

  • Go
  • https://github.com/go-cq/cq[cq]
  • Neo4j-Server
  • Frontend: jquery, bootstrap, http://d3js.org/[d3.js]

=== Endpoints:

Get Movie


// JSON object for single movie with cast curl http://cq-neo4j-movies.herokuapp.com/movie/The%20Matrix

// list of JSON objects for movie search results curl http://cq-neo4j-movies.herokuapp.com/search?q=matrix

// JSON object for whole graph viz (nodes, links - arrays) curl http://cq-neo4j-movies.herokuapp.com/graph

=== Setup

This uses the Go standard library HTTP server, along with the cq library, and a mix of standard database/sql and jmoiron/sqlx functionality.

=== Run locally:

Start your local Neo4j Server (http://neo4j.com/download[Download & Install]), open the http://localhost:7474[Neo4j Browser]. Then install the Movies data-set with :play movies, click the statement, and hit the triangular "Run" button.

Start this application with:

[source,shell]

PORT=8080 go run server.go

Go to http://localhost:8080

You can search for movies by title or and click on any entry.

=== Deploy to Heroku

[source,shell]

create a new app with the go buildpack

heroku create -b https://github.com/kr/heroku-buildpack-go.git

add the graphenedb addon

heroku addons:add graphenedb:chalk

create a procfile (cq-example should be replaced with whatever go build creates)

echo 'web: cq-example' > Procfile

install godep

go get github.com/kr/godep

save deps (do this whenever you update your 3rd party libs)

godep save

commit

git commit -a -m 'Heroku / deps'

push to heroku

git push heroku master