A simple seed project for a single page web app written with Angular, Require and SASS on the client side and Go with Gorilla Toolkit on the server side. The seed project is configured as a true single page web app in that the build scripts will concat and minify all the css and js files and then inline them into the index.html file. The seed project comes chock full with goodies:
- Automated build and testing tasks
- Server side unit tests
- Client side unit tests
- End-to-End tests
The app can be built into a standalone server.exe to run on any machine, it also comes with a preconfigured app.yaml file for easy upload to google app engine. You can see the seed project running on GAE here.
##Setup Checklist
-
Install:
-
Create the directory
$GOPATH/src/github.com/0xor1/gorillaseed
and check this repo out into it -
cd
to$GOPATH/src/github.com/0xor1/gorillaseed
and run:npm install npm install -g grunt-cli
-
Local request redirection is required, for local development, (Fiddler is a good tool for this) to send
gorillaseed-1.appspot.com
to127.0.0.1:8080
-
Run the grunt tasks
watchSass
,buildServer
thenstartDevServer
-
Open a browser and navigate to
gorillaseed-1.appspot.com
, if you are looking at a web page with some buttons on, congratz everything worked.
##Common Tasks
There is a grunt task to cover all the basic requirements of development, run the following commands as grunt <cmd>
:
-
buildServer
will build the server and copy the resulting server.exe tobuild\server
-
testServer
will run all the server unit tests and drop the results and coverage reports intest\unit\server
-
cleanServerBuild
will delete all generated files from runningbuildServer
-
cleanServerTest
will delete all generated files from runningtestServer
-
buildClient
will write the index.html file tobuild\client
with the concatenated and minified css and js inlined and stripped of its AMD loading code. It should be noted that this task copies the existing root style.css file to the build folder for inlining, so any Sass changes need to have completed compilation before this task is run -
testClient
will run all the client unit tests and drop the results and coverage reports intest\unit\client
-
cleanClientBuild
will delete all generated files from runningbuildClient
-
cleanClientTest
will delete all generated files from runningtestClient
-
buildAll
is a convenience command forbuildServer
andbuildClient
-
testAll
is a convenience command fortestServer
andtestClient
-
cleanAllBuild
is a convenience command forcleanServerBuild
andcleanClientBuild
-
cleanAllTest
is a convenience command forcleanServerTest
andcleanClientTest
-
watchSass
will start compass auto compilation of all sass files in thesrc\client
directory -
cleanSass
will delete all css files insrc\client
-
startDevServer
will start theserver.exe
in thesrc\server
directory -
startBuildServer
will start theserver.exe
in thebuild\server
directory -
updateSeleniumServer
will runwebdriver-manager update
-
startSeleniumServer
will runwebdriver-manager start
-
testE2e
will run all the end to end tests and drop the results reports intest\e2e\results
-
cleanE2e
will delete all generated files from runningtestE2e
-
buildAppEngine
will copy the necessary files tobuild
-
cleanAppEngine
will delete app files frombuild
-
startAppEngine
will run the server in the local app engine environment frombuild
-
deployAppEngine
will deploy the app to google app engine frombuild
-
nuke
is a convenience command forcleanAllBuild
,cleanAllTest
,cleanSass
,cleanE2e
andcleanAppEngineBuild