- React
- Typescript
- MUI
- Vite
- Jest
npm run install
to install the dependencies.npm run start
to start the vite server.- This should launch the app on localhost:3005
The application itself is fairly basic. The two main components are <Form />
and <Tax />
. I utilized context API as my global state management solution (Redux would be overkill).
I wrote two custom hooks to demonstrate my grasp on react hooks.
useCalculateTax()
- This hook takes care of making the API call to fetch the Tax brackets and set's the response to ContextAPI.useTaxContext()
- This hook is a better way to use React's Context API. It stores all the state that is being shared amoung components.
- Tests - I wanted to write more and better tests. Due to the lack of time I could not spare much time for writing tests.
- Organizing Types - I wanted to create shared types/interfaces to avoid repetition of TS code.
- Content Layout Shifting - The Form and Output shift after the calculate button is clicked.
- Prevent Extra API Call - If the year entered stays the same we don't need to re-fetch the data.
- Styling - Some more custom CSS would have improved the user experience a lot. CSS is added sugar!