Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pintu544/product-app-api

There should be an input field where you have to add the name of the product. There should be a button to add that name in the list Clicking on the button should make an api call to insert item in the backend
https://github.com/pintu544/product-app-api

msw react-hooks react-router reactjs typescript

Last synced: 6 days ago
JSON representation

There should be an input field where you have to add the name of the product. There should be a button to add that name in the list Clicking on the button should make an api call to insert item in the backend

Awesome Lists containing this project

README

        




**# Product App


A simple React application that allows users to add product names and displays them in a list. This app demonstrates the usage of React with TypeScript, integration with a mock API using MSW, and unit testing with React Testing Library.


Home Page


Screenshot (651).png


View Page


Screenshot (652).png


Prerequisites




  • Node.js installed on your system




  • Git (optional)




Installation



  1. Clone the repository to your local machine (or download the ZIP file and extract it):




git clone <repository-url>



  1. Navigate to the project directory:




cd product-app



  1. Install dependencies using npm or yarn:




npm install

# or

yarn install


Usage


Running the Application



  1. Start the development server:




npm start

# or

yarn start



  1. Open your browser and go to http://localhost:3000 to view the application.


Project Structure




  • src/: Contains the source code of the application.




  • components/: Reusable UI components.




  • App.tsx: Main application component.




  • index.tsx: Entry point of the application.


    public/: Static assets and HTML template.




  • mocks/: MSW mock API handlers.




Dependencies




  • @reduxjs/toolkit: Redux toolkit for efficient Redux development (optional).




  • axios: HTTP client for making API requests.




  • msw: Mock Service Worker for intercepting and mocking API requests in development.




  • react-router-dom: React router for managing navigation in the application.




  • react-redux: Official React bindings for Redux (optional).




  • @testing-library/react: Testing utilities for React applications.




  • @types/jest, @types/react, @types/react-dom: Type definitions for Jest and React.




Running Unit Tests


Run unit tests using the following command:




npm test

# or

yarn test


This will execute all the tests and provide feedback on the test coverage and results.