Skip to content

aleksandraostrovskaya/marvel-comics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Marvel information portal

Project Overview

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.

Features

  1. 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.
  2. 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.
  3. Detail Pages:

    • Separate pages for individual characters and comics, showcasing detailed information about the selected item.

Technologies Used

  • 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.

Optimization Techniques

  1. Code Splitting:

    • Implemented using React.lazy and dynamic imports to reduce the initial bundle size and load components only when needed.
  2. API Efficiency:

    • Optimized API calls to fetch only the necessary data.
  3. Animation Optimization:

    • Leveraged React Transition Group to provide smooth transitions without compromising performance.
  4. Error Handling:

    • Used Error Boundaries to catch runtime errors and display fallback UI, enhancing the overall user experience.
  5. Form Validation:

    • Ensured robust input validation using Formik and Yup, minimizing potential user input errors.
  6. Reusability and Modularity:

    • Created custom hooks for shared logic, promoting code reusability and easier maintenance.

How to Run the Project

  1. Clone the repository:

    git clone https://github.com/your-repository/marvel-spa.git
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm start
  4. Open the application in your browser:

    • Navigate to http://localhost:3000.

Future Improvements

  • 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!

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published