Add README on how to run the "Pet Clinic Front-end" code

This commit is contained in:
Andrew Abogado 2015-01-24 16:34:32 +08:00
parent 0e36e4726a
commit b17f0d165a

View file

@ -0,0 +1,41 @@
Pet Clinic Front-end
====================
Pet Clinic Front-end is the static file for [Spring Pet Clinic repo](https://github.com/singularity-sg/spring-petclinic) client-side code. It is generated by using [Yoeman](http://yeoman.io/), The web's scaffolding tool for modern webapps.
### Start here:
1. Download and install [NodeJS](http://nodejs.org/) if you haven't installed it yet.
2. Be sure you are at the root directory of the **spring-petclinic** repo.
3. Change directory by issuing this command, `cd assets/petclinic/`
4. Run `npm install -g yo bower grunt-cli`. This will install [Yoeman](http://yeoman.io/), [Bower](http://bower.io/), and [Grunt](http://gruntjs.com/).
5. On the same folder, run `bower install && npm install`
Assuming all went well, after which, all we have to run are `grunt` commands to start the server and review the app you have generated, run the unit tests, and build an optimized, production-ready version of your app.
## Preview an app you have generated (with Livereload)
Run `grunt serve`. This will open up the app on your browser in http://localhost:9000/ url
## Run the unit tests
Run `grunt test`. This is how you'll run unit test. Though we haven't done any test for this app, so you skip this.
## Build an optimized, production-ready version of your app
Run `grunt build`
Running `grunt build` takes your `app/` source code files and turns them into a distributable application, which ends up in `dist/` directory
### Install Grunt
> **Note**
>
> If an error occurred when running any grunt commands relating to PhantomJS timing out, do the following to fix the issue.
1. Make sure you're in `assets/petclinic/` directory. Run `cd test`
2. Run `bower install`
3. Go back to the petclinic folder, run `cd ..`
4. Try to run `grunt`. See if no errors appeared.