Building a React Application with Mock API Integration
Objective: Develop a React application that interacts with a mock API to display and manage a list of data items (e.g., comic characters). The application should provide features for loading data, handling loading states and API failures, selecting/deselecting items with checkboxes, and performing actions like delete and favorite on the selected items.
Features List Display with Mock API: Utilize a mock API to fetch and display a list of at least 1000 data items (e.g., comic characters) in the application. Implement loading indicators to inform users while waiting for API results. Implement error handling to gracefully manage API failures.
Checkbox Selection: Each item in the list should have a checkbox for selection. Users should be able to select or deselect items by toggling the checkboxes.
Item Highlighting: Implement a visual cue to highlight selected items, making it clear which items are currently selected.
Actions on Selected Items: Provide the following actions to be performed on the selected items:
Delete: Users should be able to delete the selected items from the list.
Favorite: Allow users to mark selected items as favorites. Store the favorite status in the local storage to persist across page reloads.
Technical Requirements: React Components: Create modular and reusable React components to manage the UI elements such as the list, checkboxes, loading indicators, etc.State Management:
Use React state to manage the selected items, loading states, and other relevant application state.
Mock API Integration: Choose or create a mock API to simulate data fetching. Implement asynchronous calls to the mock API using fetch or other suitable methods.
Error Handling: Implement error handling for API failures, displaying appropriate messages to users.
Local Storage: Utilize the browser's local storage to persist the favorite status of items. Styling:
Apply suitable styles to enhance the user interface and provide a visually appealing experience.
Responsive Design: Ensure that the application is responsive and works well on different screen sizes. Additional Considerations:
Testing: Implement unit tests to validate the functionality of components and functions.
Documentation: Provide clear documentation for setting up the project, running the application, and any other relevant details.
Code Comments: Add comments in the code to explain complex logic or any crucial implementation details.
Version Control: Use a version control system (e.g., Git) to track changes and manage the project's codebase.
User Feedback: Consider providing feedback to users for successful actions, errors, or other relevant interactions.
Delivery: Submit the React codebase along with any necessary setup instructions and documentation.
This project aims to showcase your proficiency in building a responsive and interactive React application with API integration, state management, and local storage usage.