|
1 |
| -## Quick Start |
| 1 | +# Author |
2 | 2 |
|
3 |
| -1. Clone the repo |
| 3 | +Sean M. Wells <sean.wells.sc@gmail.com> |
4 | 4 |
|
5 |
| - ``` |
6 |
| - $ git clone https://github.com/swells/js-example-fraud-score.git |
| 5 | +# Environment |
7 | 6 |
|
8 |
| - ``` |
| 7 | +OSX |
9 | 8 |
|
10 |
| -2. Install the global requirements: |
| 9 | +# Supported Browsers |
11 | 10 |
|
12 |
| - ``` |
13 |
| - $ npm install -g gulp bower browserify |
14 |
| - ``` |
| 11 | +Latest stable: Chrome, FireFox, Safari |
15 | 12 |
|
16 |
| -3. Install the local requirements: |
| 13 | +Note: It will probably work in IE 10/11 as well however I did not verify this. |
17 | 14 |
|
18 |
| - ``` |
19 |
| - $ npm install |
20 |
| - ``` |
| 15 | +# Libraries Used |
21 | 16 |
|
22 |
| -4. Run locally: |
| 17 | +- [AngularJS](https://angularjs.org) |
| 18 | + 1. AngularJS Core |
| 19 | + 2. Internationalisation i18n [pascalprecht.translate](http://angular-translate.github.io/) |
| 20 | + 3. Low level Angular Directive [ui.ace](http://angular-ui.github.io/ui-ace/) |
| 21 | + for the [Ace Editor](http://ace.c9.io/). This is the editor used for |
| 22 | + authoring blog posts. |
| 23 | + 4. Markdown parser [marked](https://github.com/chjj/marked) used for |
| 24 | + converting blog posts written in markdown to HTML. |
23 | 25 |
|
24 |
| - ``` |
25 |
| - $ gulp |
26 |
| - ``` |
| 26 | +AngularJS was used because it is quick to develop in. Given my current workload |
| 27 | +I could only budget at most *three* days to work on the test spread out over the |
| 28 | +week. |
| 29 | + |
| 30 | +Getting a basic REST based CRUD application up and going in AngularJS is easy |
| 31 | +using their [$resource](https://docs.angularjs.org/api/ngResource/service/$resource) |
| 32 | +service. This is a "factory which creates a resource object that lets you |
| 33 | +interact with RESTful server-side data sources." This was an natural fit for the |
| 34 | +test. |
| 35 | + |
| 36 | +- [Twitter Bootstrap](http://getbootstrap.com/) for CSS *only* |
| 37 | + |
| 38 | +Bootstrap was used as the boilerplate responsive foundation. I then styled the |
| 39 | +site to not make it look like Bootstrap. This was done using LESS and can be |
| 40 | +viewed in `/webapp/styles/less`. |
| 41 | + |
| 42 | +# List of Source Code |
| 43 | + |
| 44 | +``` |
| 45 | +/webapps |
| 46 | + /bower_components |
| 47 | + - Home to all the libraries used. |
| 48 | + /images |
| 49 | + - None |
| 50 | + /scripts |
| 51 | + /controllers |
| 52 | + - create.js (Controller to Create a new blog post) |
| 53 | + - delete.js (Controller to Delete a specific blog post) |
| 54 | + - edit.js (Controller to Edit a specific blog post) |
| 55 | + - list.js (Controller to View a list of all existing blog posts) |
| 56 | + - main.js (Parent Controller) |
| 57 | + - post.js (Controller to View a specific blog post) |
| 58 | + / directives |
| 59 | + - blog-editor.js (Custom Angular directive for the editor widget) |
| 60 | + - marked.js (Custom Angular directive for markdown widget) |
| 61 | + - resizeable.js (Custom Angular directive for resizing elements) |
| 62 | + /services |
| 63 | + - Post.js (Resource object that lets you interact with the RESTful |
| 64 | + server-side data sources.) |
| 65 | + /vendor |
| 66 | + - Home to any JavaScript assets that could not be pulled in via Bower. |
| 67 | + /styles |
| 68 | + /less |
| 69 | + - blog.less |
| 70 | + - buttons.less |
| 71 | + - content.less |
| 72 | + - elements.less |
| 73 | + - includes.less |
| 74 | + - layout.less |
| 75 | + - theme-salesforce.less |
| 76 | + - variables.less |
| 77 | + - main.css (The compiled result of the above .less files) |
| 78 | + /views |
| 79 | + /directives |
| 80 | + - blog-editor.html (Partial for the `blog-editor`) |
| 81 | + - create.html (Partial for the Controller to Create a new blog post) |
| 82 | + - delete.html (Partial for the Controller to Delete a specific blog post) |
| 83 | + - edit.html (Partial for the Controller to Edit a specific blog post) |
| 84 | + - list.html (Partial for the Controller to View a list of all existing blog posts) |
| 85 | + - post.html (Partial for the Controller to View a specific blog post) |
| 86 | + |
| 87 | + - index.html (The base view for the single page application) |
| 88 | + - robots.txt (The Robot Exclusion Standard) |
| 89 | +
|
| 90 | +``` |
| 91 | + |
| 92 | +# Notes to augment your code comments |
| 93 | + |
| 94 | +I scaffolded the application using [Yeoman](http://yeoman.io/) to manage bower |
| 95 | +packages and to setup a base Gruntfile.js to manage the UI building. I felt this |
| 96 | +was necessary to easily lint the JavaScript and test to see if everything minimized |
| 97 | +properly as if this was a production deployment. |
| 98 | + |
| 99 | +I developed the test outside of Java using a simple [Express.js](http://expressjs.com/) |
| 100 | +server that mimicked the actual supplied Java server code. This allowed for |
| 101 | +faster development, live page loading on file changes, ect... I then moved the |
| 102 | +un-minimized and unoptimised files over to Java/Jetty to verify for submition. |
| 103 | + |
| 104 | + |
| 105 | +# Not completed in time |
| 106 | + |
| 107 | +Internationalization i18n bundle in some other language other than en. |
27 | 108 |
|
28 |
| -5. View in browser at `http://localhost:9080` |
29 | 109 |
|
0 commit comments