├── .gitignore
├── README.md
├── React_README.md
├── babel.config.js
├── jest.config.js
├── package-lock.json
├── package.json
├── public
├── favicon.ico
├── index.html
├── logo192.png
├── logo512.png
├── manifest.json
└── robots.txt
├── src
├── App.css
├── App.tsx
├── components
│ ├── BreedGridDialog.tsx
│ ├── BreedsTable.tsx
│ ├── Header.test.tsx
│ └── Header.tsx
├── context
│ └── app-state-context.ts
├── index.scss
├── index.tsx
├── layouts
│ └── MainLayout.tsx
├── logo.svg
├── mock
│ └── db.json
├── pages
│ ├── Home.tsx
│ └── hoc
│ │ └── MainLayoutWrapHOC.tsx
├── redux
│ ├── redux-slice.ts
│ └── store.ts
├── reportWebVitals.ts
├── routes
│ └── MainRoute.tsx
├── service
│ ├── api-service.ts
│ └── http-client.ts
├── setupTests.ts
├── theme
│ └── theme.config.ts
└── types
│ └── index.ts
└── tsconfig.json
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Dog Poster Generator Description
2 |
3 | > - Created a React project and setup TypeScript engine.
4 | > - Installed Mui node module and set the theme configuration.
5 | > - Structured the whole project with layouts, pages, components, types and so on.
6 | > - Used Dog apis with this link: https://dog.ceo/dog-api/documentation/
7 | > - Setup redux flow to the project for managing application states.
8 | > - Display dog data from the server in to the MUI table. Created a Table component made it as a re-usable component. Using it on Home page.
9 | > - Created Breed images dialog and displaying breed images with Grid view.
10 | > - Used React.suspense for lazy loading component
11 | > - Created a mainLayoutWrapHOC
12 | > - Setup jest testing environment and add an unit test case for Header component
13 |
14 | ## Launch Script
15 |
16 | #### Start up the project
17 | This script will launch the project with 3001 port
18 | > npm run start
19 |
20 | #### Other scripts
21 | > npm run preinstall
22 | > npm run build
23 | > npm run test
24 | > npm run eject
25 | > npm run unit-test
26 |
27 | #### Mock server start script
28 | json-server --watch src/mock/db.json
--------------------------------------------------------------------------------
/React_README.md:
--------------------------------------------------------------------------------
1 | # Getting Started with Create React App
2 |
3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4 |
5 | ## Available Scripts
6 |
7 | In the project directory, you can run:
8 |
9 | ### `npm start`
10 |
11 | Runs the app in the development mode.\
12 | Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
13 |
14 | The page will reload when you make changes.\
15 | You may also see any lint errors in the console.
16 |
17 | ### `npm test`
18 |
19 | Launches the test runner in the interactive watch mode.\
20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21 |
22 | ### `npm run build`
23 |
24 | Builds the app for production to the `build` folder.\
25 | It correctly bundles React in production mode and optimizes the build for the best performance.
26 |
27 | The build is minified and the filenames include the hashes.\
28 | Your app is ready to be deployed!
29 |
30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31 |
32 | ### `npm run eject`
33 |
34 | **Note: this is a one-way operation. Once you `eject`, you can't go back!**
35 |
36 | If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37 |
38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
39 |
40 | You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
41 |
42 | ## Learn More
43 |
44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45 |
46 | To learn React, check out the [React documentation](https://reactjs.org/).
47 |
48 | ### Code Splitting
49 |
50 | This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51 |
52 | ### Analyzing the Bundle Size
53 |
54 | This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55 |
56 | ### Making a Progressive Web App
57 |
58 | This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59 |
60 | ### Advanced Configuration
61 |
62 | This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63 |
64 | ### Deployment
65 |
66 | This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67 |
68 | ### `npm run build` fails to minify
69 |
70 | This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
71 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@babel/preset-react',
4 | [
5 | '@babel/preset-env',
6 | {
7 | targets: {
8 | node: 'current',
9 | },
10 | },
11 | ],
12 | ],
13 | };
--------------------------------------------------------------------------------
/jest.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('jest').Config} */
2 | const config = {
3 | verbose: true,
4 | };
5 |
6 | module.exports = config;
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "dog-poster-generator",
3 | "version": "1.0.0",
4 | "private": true,
5 | "dependencies": {
6 | "@emotion/react": "^11.9.0",
7 | "@emotion/styled": "^11.8.1",
8 | "@mui/icons-material": "^5.8.0",
9 | "@mui/material": "^5.8.1",
10 | "@reduxjs/toolkit": "^1.8.2",
11 | "@testing-library/jest-dom": "^5.16.4",
12 | "@testing-library/react": "^13.2.0",
13 | "@testing-library/user-event": "^13.5.0",
14 | "@types/jest": "^27.5.1",
15 | "@types/node": "^17.0.35",
16 | "@types/react": "^18.0.9",
17 | "@types/react-dom": "^18.0.5",
18 | "axios": "^0.27.2",
19 | "node-sass": "^7.0.1",
20 | "react": "^18.1.0",
21 | "react-dom": "^18.1.0",
22 | "react-redux": "^8.0.2",
23 | "react-router-dom": "^6.3.0",
24 | "react-scripts": "5.0.1",
25 | "styled-components": "^5.3.5",
26 | "typescript": "^4.7.2",
27 | "web-vitals": "^2.1.4"
28 | },
29 | "resolutions": {
30 | "@types/react": "^18.0.9",
31 | "@types/react-dom": "^18.0.5"
32 | },
33 | "scripts": {
34 | "start": "react-scripts start",
35 | "build": "react-scripts build",
36 | "test": "react-scripts test",
37 | "unit-test": "jest --env=jsdom",
38 | "eject": "react-scripts eject",
39 | "preinstall": "npm install --package-lock-only --ignore-scripts && npx npm-force-resolutions"
40 | },
41 | "eslintConfig": {
42 | "extends": [
43 | "react-app",
44 | "react-app/jest"
45 | ]
46 | },
47 | "browserslist": {
48 | "production": [
49 | ">0.2%",
50 | "not dead",
51 | "not op_mini all"
52 | ],
53 | "development": [
54 | "last 1 chrome version",
55 | "last 1 firefox version",
56 | "last 1 safari version"
57 | ]
58 | },
59 | "devDependencies": {
60 | "@babel/preset-env": "^7.20.2",
61 | "@babel/preset-react": "^7.18.6",
62 | "@types/react-test-renderer": "^18.0.0",
63 | "babel-jest": "^29.3.1",
64 | "jest": "^27.5.1",
65 | "react-test-renderer": "^18.2.0"
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DarkHorseCorder/React-Redux-ReactRoute-MUI-API-Lasyloading-TS-DogPoster/553beffe987938f9536467743be8bd15bb68b14a/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |