Used mustache.js to build the frontend templates. Mustache is a logic-less template syntax. Simple data driven and easy to separate from the backend. Two Mustache templates were created for the analysis form and analysis report.
Used grunt sass for the efficient styling and ES6 new features like arrow function to write the clean Javascript code. Used Webpack and babel-polyfill to make the ES6 code running on the old browsers.
The server just needs to provide the data for the template render. Used express as the static server and cheerio to build a simple document parser. The document parser provide serval methods that get the desired data.
- There are two environments DEV and PROD configurable in server.js.
- Server serves the static files under '/dest' for the DEV and '/build' for PROD.
- Use
npm install
to install all the dependent packages and then usenode server
to run the server. - The server listens on port '3000' configurable in server.js.
Due to the limited time, there are a few issues that need to be fixed.
- On the server side there could be a few bugs, that need to be tested and fixed. e.g. how to detect inaccessible links or how determine if a page contains a login form. For now just on the assumption that login form has only one input element with the property 'type=password'.
- On the client side need to optimize the responsive design.