This repository contains the source code for a phonebook web application built using React, Redux Toolkit, and incorporating user registration and login functionality.
-
Add Contacts: Users can add new contacts by providing a name and phone number.
-
Remove Contacts: Users can delete saved contacts that are no longer needed.
-
Search Contacts: Provides the ability to quickly search for contacts by name.
-
User Registration and Login: New users can register with the application by providing necessary details, and registered users can log in to the application.
-
State Management: Efficient state management with Redux Toolkit.
-
Async Operations: Uses Redux Thunk for handling asynchronous operations like fetching, updating contacts, user registration, and login.
-
HTTP Requests: Axios library is used for making HTTP requests to a mock API.
- React
- Redux Toolkit
- Axios
- React Redux
- React Testing Library
This project uses Redux Toolkit for efficient state management. The following Redux features are implemented:
-
Fetching Contacts:
- Contacts are fetched asynchronously using Redux Thunk middleware.
- The
fetchContacts
action is responsible for making a GET request to the mock API.
-
Adding a Contact:
- Adding a new contact is handled by the
addContact
action, which makes a POST request to the API.
- Adding a new contact is handled by the
-
Deleting a Contact:
- Contacts can be deleted using the
deleteContact
action, making a DELETE request to the API.
- Contacts can be deleted using the
-
User Authentication:
- User registration and login are implemented using the
registerUser
andloginUser
actions, respectively. - Authentication status is managed in the Redux store.
- User registration and login are implemented using the
-
Redux Store:
- The global state is managed using Redux, with the store configured using Redux Toolkit.
-
Async Operations:
- Redux Thunk is used to handle asynchronous operations, allowing for complex interactions with the API.
Feel free to explore the codebase for detailed implementations of these features in the Redux-related files.