This test is designed to assess your ability to work with React. You should style your components using shadcn-ui. All components are available in @/components/ui
(Bonus points for great UI/UX)
-
Create an AppContext that will be used to store an authenticated user state. The user should stay logged in even after a page refresh.
-
Create a Login Form component that will be used to authenticate a user.
-
Create a RequireAuth component that will be used to protect routes that require authentication.
-
Create a Dashboard component that will be used to display the authenticated user's infos.
-
Create a Logout component that will be used to logout the authenticated user.
- Create a ThemeContext to handle dark mode.
- Add a fake loading state to the Login component.
There are 3 files that should help you to complete this test :
- userMock.ts: This file contains the user data that you will use to authenticate a user.
- App.tsx: This file should contains the routes of the app.
- globals.scss: This file contains the TailwindCSS configuration.
-
Clone the project
-
Install dependencies
npm install
- Run the project
npm run dev
- Open http://localhost:3000 to view it in the browser.