0% found this document useful (0 votes)
19 views1 page

E-commerce Web App Development Guide

The document outlines the requirements for creating a basic e-commerce web application, including a home page for product listings, a product detail page, and cart functionality. It specifies the use of TypeScript, React JS, and React Router for navigation, along with API data fetching and state management using Context API and MobX. Additional features such as responsiveness, E2E testing, and bonus points for localStorage and animations are also mentioned, along with submission guidelines for a GitHub repository.

Uploaded by

programming4geek
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views1 page

E-commerce Web App Development Guide

The document outlines the requirements for creating a basic e-commerce web application, including a home page for product listings, a product detail page, and cart functionality. It specifies the use of TypeScript, React JS, and React Router for navigation, along with API data fetching and state management using Context API and MobX. Additional features such as responsiveness, E2E testing, and bonus points for localStorage and animations are also mentioned, along with submission guidelines for a GitHub repository.

Uploaded by

programming4geek
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Objective:​

Create a basic e-commerce web application where users can browse products, view detailed product
information, and add or remove items from the cart.

Requirements:

1.​ Home Page (Product Listing)


○​ Display a grid of products with essential details (e.g., name, price, thumbnail).
○​ Each product should link to its Detail Page.
○​ The user should be able to filter and sort the products based on the categories (multiple at
not

once). The filter and sorting should be agnostic to the page refresh and back button navigation
not

i.e. user should be able to share the link and filters should be applied. not

2.​ Product Detail Page


○​ Use dynamic routing to display the product details based on the product id in the URL. e.g.,
/product/:id /details

○​ Fetch product data dynamically based on the id.


Don’t

○​ Display product information, including a title, description, price, and an "Add to Cart" button. My

3.​ Cart Functionality


○​ Allow users to add items to the cart from the Product Detail Page.
○​ Enable users to remove items from the cart.
Don’t

○​ Display the total cart value and the number of items in the cart in the footer

4.​ Navigation
○​ Implement navigation to allow users to move between the Home Page, Product Detail Page, and
Don’t

Cart.
○​ Provide a way to navigate back to the Home Page from the Product Detail Page.
5.​ Technical Requirements
○​ Typescript: Use typescript to create the assignment
Don’t and must use CRA

○​ React JS: Utilize React’s component-based structure and state management.


class

○​ Routing: Use React Router for navigation between pages. Don’t use useSearchParams.

○​ State Management: Manage cart state using React's Context API and MobX.

○​ Data Fetching: Use an API ([Link] to fetch product details as well as category
filters dynamically and once filters are applied, data should be refetched using apis for the
(using got)

selected filters. Don’t filter locally, always call the APIs.


○​ Responsiveness: Ensure the application is mobile-responsive with inline styling

○​ E2E Testing: Setup cypress ([Link] or playwright ([Link] for


basic page testing.
component

6.​ Bonus Points


○​ Implement a feature to persist the cart state using localStorage. session

○​ Include animations for transitions between pages or adding/removing items from the cart.
○​ Ensure accessibility by using appropriate html elements for different blocks.
Don’t

Submission Guidelines:

●​ Provide a GitHub repository link with clear instructions on how to set up and run the application in
README. Failure to do so will lead to auto-rejection.
●​ Document any assumptions, limitations, or additional features implemented.
●​ You may use AI tools for syntax lookups or debugging. Submissions will be automatically rejected if any
AI tools are used without putting your own logical efforts at all.

Common questions

Powered by AI

Persisting cart state using session localStorage can significantly enhance user experience by retaining cart information across browser sessions, reducing frustration from potential data loss after accidentally closing a tab or navigating away. Implementations should ensure synchronization between localStorage and application state, possibly using lifecycle methods to update localStorage on cart state changes and to hydrate cart state on page load, maintaining consistency and reliability .

Implementing mobile responsiveness with inline styling provides immediate feedback and control over individual component styles, enabling developers to quickly adjust the layout for responsiveness across devices. This approach can enhance initial development speed but may lead to maintenance challenges as styles become fragmented across components. Over time, managing these styles can become cumbersome, especially if an application's overall design evolves or needs consistent updates in diverse elements .

The Home Page must display a grid of products with essential details such as name, price, and thumbnail. Each product should link to its Detail Page. Users should not have the ability to filter or sort products based on categories simultaneously; however, when filters are applied, they should persist across page refreshes and back navigation so that a user can share filtered links without losing filter settings. Technically, the Home Page should avoid client-side product filtering by referring to server APIs whenever filters are changed .

The application restrictions dictate not using TypeScript, opting instead for JSX with Create React App (CRA) and React’s class components. This choice may simplify initial setup and reduce complexity for developers unfamiliar with TypeScript. Conversely, this excludes TypeScript’s benefits such as type-checking and error reduction. Navigation using React Router is allowed, but avoiding the use of useSearchParams could limit customization of URL parameters handling, potentially affecting developer productivity and URL parameter manipulations .

Using React's Context API and MobX for state management can centralize the application's state management, making it easier to manage global states such as those of the shopping cart. The Context API allows sharing of state across components without prop drilling, which simplifies maintaining component hierarchies, while MobX provides reactive state management capabilities enhancing performance by rendering updates only to components that need them. Their use in managing cart functionalities ensures a more responsive and efficient user interface .

E2E testing verifies the flow of an application from start to finish, ensuring all combined parts function together correctly. By recommending Cypress or Playwright, the document emphasizes robust testing frameworks that can handle asynchronous client-server interactions, offer fast testing processes, and present user-friendly error messages. This choice aims to help developers automate complex scenarios to ensure reliability and performance across different components and devices .

Neglecting accessibility can significantly limit the application’s reach and usability for users with disabilities, impacting compliance with legal standards like WCAG. It might lead to diminished user experiences, where individuals with impairments struggle to navigate or interact with the application. Proper use of HTML semantic elements and practices like ARIA roles can mitigate these issues by ensuring screen readers and other assistive technologies interpret and present information accurately .

Users can add items to the cart from the Product Detail Page, but they are not allowed to remove items from the cart, which means once an item is added, it remains until a session ends or the application is reset. This restriction may frustrate users accustomed to flexible cart management. However, information about total cart value and number of items in the cart is displayed in the footer, ensuring users are always aware of their cart's content .

Dynamic routing for the Product Detail Page is implemented using the product ID as a parameter in the URL, e.g., /product/:id/details. However, product data should not be fetched dynamically based on the ID; it suggests a static approach to data fetching where the data is already available or pre-fetched and accessed using the ID. This approach may lead to challenges in scalability and requires efficient pre-fetching of data or storing data locally .

Using external APIs for data fetching ensures that product data and categories are always up-to-date and consistent across devices. This method allows the application to scale effectively as it taps into external server capabilities without overburdening the client's local resources. By preventing local filtering, the architecture remains lightweight, optimizing performance and offloading complex data operations to the server, thus maintaining speed and reliability even as the dataset grows .

You might also like