A hypothetical web app written in Go on top of Martini.
How does this differ from most other go-martini
repos? It integrates Grunt, Bower, and AngularJS.
C:\Users\Ivan>npm --version
2.14.7
C:\Users\Ivan>node --version
v4.2.1
- Nodejs: Even though we're using
Go
for our app, several of the client-side toolset uses command line apps that are "extensions" of node.npm
is Node's 'Node Package Manager' and is the accessor to Node's enormous repository of ready-to-use libraries. You need this to installGrunt
andBower
. Competitors: None (not for what we're using it for)? Maybe Ruby has something similar with gem? Maybe there's a Go task runner? - Grunt: Awesome task runner for anything. See the
Gruntfile.js
for an example config. It is used to define everything on our project - How to build our Go code, compile SASS into minified CSS, minify HTML, run Jasmine/Karma tests (unit testing framework for javascript), etc... Competitors: Gulp, etc... - Bower: Similar to
npm
, but only for client-side dependencies. This is where we define the version of AngularJS we're using, Bourbon Neat, etc... - Go: Uh... we need
Go
to actually go write thisGo
app.- Martini: I tried doing HTTP routing in pure Go but there's alot of annoying syntax to deal with. For now, I think Martini is the way to go. See
main.go
for examples on HTTP routes. We can easily apply auth to specific routes which is really what we want.
- Martini: I tried doing HTTP routing in pure Go but there's alot of annoying syntax to deal with. For now, I think Martini is the way to go. See
- Bourbon Neat: This is the
Node
port for the Ruby library. It's a complete framework for building anything theSASS
way... highly recommended by the best Ruby on Rails guy I know. Fortunately there areNode
ports for these:node-sass
,node-bourbon
,node-neat
. It provides a grid and several other things required from a UI standpoint to get us building an awesome front-end. This replacement will significantly reduce our SCSS bloat and remove our need for Ruby/Compass.
Pull the project down from git:
git clone https://github.com/goalbums.git
Navigate to the folder and Get Everything
npm install
bower update
Verify that the following System Variables exist:
GOPATH = (path\to\directory\with\all\go\projects)
GOROOT = C:\Go
(should already exist from Go installation)
Verify that you have the appropriate executables on your PATH (I think this can be the user PATH. Shouldn't have to be a System PATH - and you don't need Python
for some of the npm
packages - you can ignore those errors. Remember, we're not actually running Node
on production, it's just helping us develop and package our app via Grunt
and Bower
):
C:\Users\ivan_portugal\AppData\Roaming\npm;C:\Python34;C:\Program Files\nodejs\;C:\Go\bin;C:\Program Files\Git\cmd
grunt server
Random stuff that has helped me build this project with ease:
- Yeoman
- Yeoman Angular-Go-Martini - This is a big one, duh.
- martini-api-example