A simple UI for an HR system
This project consists of a simple React app with the following features:
- displays employees data in a table at the
/employeesroute - allows the user to see a detail view of an employee
- allows the user to edit the details of an employee in a form
- displays employees data statistics at the
/statisticsroute using bar charts to show:- average age per industry
- average salary per industry
- average salary per years of experience
- number of employees in each industry
The app uses React version 18 and is written in Typescript.
This project uses yarn for package management.
First, install all dependencies by running the following command in the project's directory.
$ yarnThe data for this app is loaded from a mock json server. Before running the app you need to start this server. You can do so running the following command in the project directory:
$ yarn mock:apiThe server will be available at http://localhost:3001
Next make sure that the api url string is correct in your local .env file. For this example is should look like:
REACT_APP_API_URL='http://localhost:3001'
In case the port is different, make sure to update the environment variable accordingly before running the app.
Then the app can be run in development mode:
$ yarn startOpen http://localhost:3000 to view it in the browser.
This project uses jest and React Testing Library.
To launch the test runner in watch mode you can run:
$ yarn testTo create a production build you can do:
$ yarn buildThis will create/update the app bundle in the build folder.
$ yarn lintTo fix lint errors:
$ yarn lint:fixTo run prettier format:
$ yarn format