Marvel information portal is a single-page application (SPA) that utilizes the Marvel Developer Portal API to display characters and comics from the Marvel universe. The application provides a user-friendly interface for exploring Marvel content with seamless navigation and dynamic features.
-
Home Page:
- Character List:
- Displays all Marvel characters.
- Characters are dynamically loaded when the user clicks a button.
- Random Character Block:
- Shows a random Marvel character.
- Includes a button to fetch a new random character.
- Allows navigation to a detailed page about the character.
- Character Search:
- Users can search for characters by name using an input form.
- If a character is found, a "To Page" button appears, redirecting to the character's detailed page.
- Character List:
-
Comics Page:
- Displays a list of Marvel comics.
- Comics are dynamically loaded on button click.
- Users can navigate to a detailed page for each comic.
-
Detail Pages:
- Separate pages for individual characters and comics, showcasing detailed information about the selected item.
- React.js: Core framework for building the SPA.
- Fetch API: To interact with the Marvel Developer Portal API.
- React Transition Group: For animations when loading characters and comics.
- Custom Hooks: Encapsulation of reusable logic to simplify components.
- Formik & Yup: For form creation and validation (e.g., search input validation).
- Dynamic Imports and React.lazy: To enable code-splitting and improve initial load performance.
- React Router DOM: For routing between pages.
- Error Boundaries: To handle and display errors gracefully.
-
Code Splitting:
- Implemented using
React.lazy
and dynamic imports to reduce the initial bundle size and load components only when needed.
- Implemented using
-
API Efficiency:
- Optimized API calls to fetch only the necessary data.
-
Animation Optimization:
- Leveraged
React Transition Group
to provide smooth transitions without compromising performance.
- Leveraged
-
Error Handling:
- Used Error Boundaries to catch runtime errors and display fallback UI, enhancing the overall user experience.
-
Form Validation:
- Ensured robust input validation using
Formik
andYup
, minimizing potential user input errors.
- Ensured robust input validation using
-
Reusability and Modularity:
- Created custom hooks for shared logic, promoting code reusability and easier maintenance.
-
Clone the repository:
git clone https://github.com/your-repository/marvel-spa.git
-
Install dependencies:
npm install
-
Start the development server:
npm start
-
Open the application in your browser:
- Navigate to
http://localhost:3000
.
- Navigate to
- Add pagination for character and comic lists.
- Implement a favorites feature to allow users to save characters and comics.
- Improve accessibility by following WCAG guidelines.
- Enhance responsiveness for mobile devices.
Feel free to contribute to this project by submitting pull requests or reporting issues!