I’m excited to invite you to the next step of the Prokeep hiring process: the Technical Challenge. Please reply to this email and confirm you have received and give an estimated delivery date Instructions: Build a React app using your favorite boilerplate or seed (or from scratch), that consists of a login form that sends a login REST post request to this stubbed REST service: https://reqres.in You are free to use whatever tooling you want and whatever libraries you feel best solves the problem. Bonus points if the form looks sharp.
- The login form should have an email input and a password input.
- The login form should validate that the email is a valid email input and the password field has at least one character before you process the submit action.
- You are free to do on change or submit validation – extra points for onChange.
- Build a unit test for the form – testing both a valid login and an invalid login. you are free to use whatever testing stack you like.
- Include a “dev” or “run” script in your package.json scripts
- Include a “test” script in your package.json scripts
- Upload to a code sharing service such as GitHub, Gitlab, etc. and let us know where to find it. reqres.in (When complete, please let us know and share with user “trippp” on Github, or, if you are sharing elsewhere, we can provide a username by request.) Reqres – A hosted REST-API ready to respond to your AJAX requests A hosted REST-API ready to respond to your AJAX requests
This repository contains the code regarding the Prokeep Technical Challenge.
The project is built on top of React 18, and it uses the MUI framework for the sharp-looking UI, Axios for doing the AJAX request, Jest and Enzyme for unit tests. In addition, it also strictly follows Airbnb's Javascript (React) style guide thanks to Eslint.
The client
directory contains the main source code of the React app with the following key files:
-
package.json
: lists all the dependencies required for the app and the scripts to run & test the app. -
src/components/Login.jsx
: contains the Login form component. It has the fields for email and password inputs. It validates the inputs using thevalidator
library and interacts with the stubbed REST service usingaxios
. -
src/components/Success.jsx
: offers a success message on successful login including the received token.
Clone this repository and run the following commands:
npm install
: installs the dependenciesnpm run dev
ornpm start
: starts the react app in development modenpm run test
: triggers the unit tests
You can view a live demo and play with the application by clicking here.
If you faced any issues while implementing the app feel free to reach out, I'd be more than happy to help.