React.js/Typescript application to select vehicles and customize them.
- React.js, Typescript
- Material UI (MUI)
- Zod (for data validation)
- Zustand (state manager)
- Jest, React Testing Library (for testing)
Node.js (20.0.x or higher)
git clone https://github.com/abaldawa/vehicle-selection.git
cd https://github.com/abaldawa/vehicle-selection.git
- execute
npm i
- execute
npm start
(This will start the frontend react dev server) - Go to
http://localhost:3000
to see the UI
Full suite of integration tests are written covering the entire functionality including the edge cases. To run the integration tests do below:
cd https://github.com/abaldawa/vehicle-selection.git
- execute
npm run test:watch
To create a production build of the application do below:
cd https://github.com/abaldawa/vehicle-selection.git
- execute
npm run build
- This will generate the production build of the application in thebuild
folder
Once the production build of the application is created in the build
folder then it can be deployed and served from any CDN/reverse proxy/static server/server etc.
- When the UI is loading the vehicles data then the Loader is shown on the UI
- If the data loading fails for any reason then error popup displaying the error is shown on the UI.
- If data loading is successful but no vehicles are found then a popup is shown to the user informing the same
- Zod is used for data validation and if the data is received in an incorrect format then the exact validation error details popup is shown on the UI.
Integration tests covering all the edge cases and success cases are written which validates that the application works as intended. Moreover, the integration tests code is not hardcoded and is scalable/extensible because of below architecture:
Integration test code
-> reads -> Test plan
-> has Test scenarions
-> has {action, assertion tests}
Test scenarions
mock data can be easily changed by adding/removing/modifying objects in the test scenarios
array. Once the test scenario
data is changed, the Integration test suite
will pick it up, execute the scenarios as described and validate the test results thus making adding/removing/modifying scenarios extremely easy without needing any change to the
original test code.
- Mobile first responsive design is implemented which looks good on both mobile and desktop.
- Modern CSS units (ex
container
units) are used to be responsive at the container level. - CSS-IN-JS flavour which comes with material-ui is used.
Below video demonstrates how the UI looks like and its functionality.