This simple webpage performs a currency conversion using the JSON data from http://fixer.io
- AngularJS
- Angular Material
- Grunt
- SASS
- NPM
- Please have the latest Node.JS and NPM (version 3.10.3 important) installed via Node.Js
- Clone the repository to CurencyConversion folder.
- Run 'npm install -g grunt-cli' to install the Grunt CLI to run tasks. (If error occurs, try 'npm cache clean' and rerun 'npm install -g grunt-cli')
- Run 'npm install -g karma' to install and karma test runner.
- Run 'npm install grunt' to install local grunt
- Run 'npm install' within that folder using command line for windows, terminal for Mac and Linux. (Could take a while)
- If you are on Linux or Mac, proceed to the next step. On Windows, please install Ruby with Gem such that we can use Sass. Ruby
- Run 'gem install sass' to install Sass
- After everything is setup, simply run 'grunt' in the root folder. This will start a static web server via grunt task 'connect'. (If failed, delete your node_modules folder and run 'npm install' again)
- Navigate to http://localhost:6789/ to view the webpage on a static web server (or open up index.html)
- Navigate to http://localhost:6789/docs to view the documentations API
Grunt uses the following dependencies:
- JsHint
- Watch
- Concat
- Sass
- Copy
- Uglify
- Clean
- Connect
- Ngdocs
These tasks will all be executed when 'grunt' is run.
This web page is designed using AngularJS following its MVC structure in which the controllers also acts as models. Documentations are avaliable at http://localhost:6789/docs , generated using Ngdocs
- Currency Row
- Currency Field
- Currency Dropdown
- Main Controller
- Currency Row Controller
- Currency Field Controller
- Currency Dropdown Controller
- Dialog Controller
- Exchange Rate Service
- Incremental Service
- Responsive design using media queries
- Sass Mixins for simplifying future workflow
- _constants.scss for a storage of constant values
- Uses Angular's $on and $broadcast to emit and receive events
- When a model was changed in the input and select tag, an event will be broadcasted.
- Upon receiving of event details with $on, currency calcuation will be performed to update the model. (Observer pattern) (HTTP request data is cached on page using angular's $http option to increase performance)
- Expand the number of currency rows to support more currencies.
- Any changes made to any rows can cause other rows to change value.
- Select the date of the currency rate you wish to view.
- Add a backend server such as Node to allow html templates to be written in a separate file and used with templateUrl.
- Add unit tests for each controller functionality
- UglifyJs does not seem to support ES5 syntax such as multi-line html notation '``' so I decided to keep the uglify task and resolved using classic javascript notation '+' because performance is more valued
- Html view templates was not used because there was no backend server to link to different template URLs
- Unit tests were setup but not completed yet using Karma and Jasmine framework, integrated in Grunt
- Leo Liu - University of Waterloo
This project is licensed under the MIT License - see the LICENSE.md file for details