This project uses Vuex to demonstrate the MVC pattern for modern front-end. Whilst, Vuex might be an overkill for such a small project it is really powerful as your project becomes big. You separate all your business logic into actions/mutations (Controller), your Vue components (View) are simply presentation layer of your store (Model) data.
- When you load the app, you retrieve Preferred Coin from local storage.
- We have two routes which are basically presentation layer of the same store and actions.
- When route is activated, data is fetched from the backend for selected Coin, upon completion price and timestamp are stored into to localStorage. Additionally, if a previous entry for a selected Coin exist in localStorage, % change is calculated, commited to store and presented to user.
- For every change in user selection, we will retrieve corresponding data as in #3.
npm install
npm run serve
npm run build
npm run test:unit
npm run lint