I chose Vuetify component library for this solution because it has very good documentation. Also Vue JS comes with 1st party state-management and router libraries thus reducing boiler plate code by a LOT.
My solution is responsive, should be mobile/tablet/computer friendly. I also added dark mode for accesibility.
I saved all my backend api logic in a central store. This way its easy to share data across components. Mutations are synchronous while Actions are async.
I purposely didn't write this code in TS to save on time. I also didn't give user feedback in-case the api-call fails, though error is being caught and logged into the console. I only spent only one night to implement this, only a basic unit test is included. No e2e has been made.
Spinners are going to be shown while fetching backend data.
- The home page will contain the high level statistics. Data will be fetched when the component is created.
- A card will displayed for each survey, with a link to the navigate to a detailed route.
- Whenever we reach the "details" route, app will fetch detailed data. Data will be stored in the central store. If end-user "refreshes" the page whilst on this route, the app will alert the user to go back to home page to select a survey.
- In the details page, expansion panels are used to show/hide the questions under each theme. Convenience buttons to expand/collapse all questions are provided.
- Ratings are converted to 5-stars for visual appeal, the exact figure will be shown when you hover on the star graphics.
- I modularized my components wherever I can to keep the code clean.
npm install
npm run serve
npm run build
npm run test:unit
npm run lint