This app lists products in their corresponding categories using the Gousto APIs. The app uses the create-react-app node module.
- Node / npm (see package.json engine properties)
To download all required dependencies run npm install
.
In the project directory, you can run:
Runs the app in the development mode. Open http://localhost:3000 to view it in the browser.
Launches the test runner in the interactive watch mode. You may need to press a
after this to run all tests. There will be 2 error messages logged to the console when the tests to fail the api calls are run.
Calculates code coverage for all test suites.
The majority of code is in the src/
folder, with App
and index
files in the root of src/
and all components and related files in components/
.
gousto-tech-test/
README.md
node_modules/
package.json
public/
index.html
favicon.ico
manifest.json
src/
App.css
App.js
App.test.js
index.css
index.js
components/
categories/
categoryItem/
productItem/
products/
Products.css
Products.js
Products.test.js
search/
App.js
is the main wrapper component that renders the Categories
, Search
and Products
components. The Categories
component is a list that renders individual CategoryItem
components. Similarly the Products
component is a list that renders ProductItem
components, while the Search
component just renders the search input box.
App/
Categories/
CategoryItem
Search/
Products/
ProductItem