├── .dockerignore ├── .github └── workflows │ └── main.yml ├── .gitignore ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── README.md ├── cypress.json ├── cypress ├── fixtures │ └── example.json ├── integration │ ├── header.spec.js │ └── init.spec.js ├── plugins │ └── index.js └── support │ ├── commands.js │ └── index.js ├── lerna.json ├── package.json ├── packages ├── core-ui │ ├── .env.development │ ├── .env.production │ ├── .gitignore │ ├── README.md │ ├── package.json │ ├── public │ │ ├── favicon.ico │ │ ├── icon-128x128.png │ │ ├── icon-144x144.png │ │ ├── icon-152x152.png │ │ ├── icon-192x192.png │ │ ├── icon-384x384.png │ │ ├── icon-512x512.png │ │ ├── icon-72x72.png │ │ ├── icon-96x96.png │ │ ├── index.html │ │ ├── manifest.json │ │ └── robots.txt │ ├── src │ │ ├── App.test.tsx │ │ ├── App.tsx │ │ ├── GlobalStyles.ts │ │ ├── Routes │ │ │ ├── Routes.tsx │ │ │ └── index.tsx │ │ ├── ThemeProvider.tsx │ │ ├── actions-types │ │ │ └── index.ts │ │ ├── actions │ │ │ ├── app.ts │ │ │ └── counter.ts │ │ ├── assets │ │ │ └── images │ │ │ │ ├── hero-bg.png │ │ │ │ ├── pizza.png │ │ │ │ └── salmon.png │ │ ├── components │ │ │ ├── Counter.tsx │ │ │ ├── ErrorBoundary.tsx │ │ │ ├── Footer │ │ │ │ ├── Footer.tsx │ │ │ │ ├── Styled.ts │ │ │ │ └── index.tsx │ │ │ ├── Header.tsx │ │ │ ├── Hero │ │ │ │ ├── Hero.tsx │ │ │ │ ├── Styled.ts │ │ │ │ └── index.tsx │ │ │ ├── Loader │ │ │ │ ├── Styled.ts │ │ │ │ └── index.tsx │ │ │ ├── Navbar │ │ │ │ ├── Navbar.tsx │ │ │ │ ├── Styled.ts │ │ │ │ └── index.tsx │ │ │ ├── NotFound │ │ │ │ ├── NotFound.tsx │ │ │ │ ├── Styled.ts │ │ │ │ └── index.tsx │ │ │ ├── Recipes │ │ │ │ ├── Recipes.tsx │ │ │ │ ├── Styled.ts │ │ │ │ └── index.tsx │ │ │ ├── ToggleSwitch │ │ │ │ ├── Styled.ts │ │ │ │ ├── ToggleSwitch.tsx │ │ │ │ └── index.tsx │ │ │ ├── Welcome │ │ │ │ ├── Styled.ts │ │ │ │ ├── Welcome.tsx │ │ │ │ └── index.tsx │ │ │ └── Works │ │ │ │ ├── Styled.ts │ │ │ │ ├── Works.tsx │ │ │ │ └── index.tsx │ │ ├── config │ │ │ ├── env.ts │ │ │ ├── host.ts │ │ │ ├── images.ts │ │ │ ├── routes.ts │ │ │ └── routes_config.ts │ │ ├── index.tsx │ │ ├── micro-frontend │ │ │ ├── FeatureOne.tsx │ │ │ ├── MicroFrontend.tsx │ │ │ └── Styled.ts │ │ ├── pages │ │ │ ├── About.tsx │ │ │ ├── Home.tsx │ │ │ ├── NotFound.tsx │ │ │ └── Recipes.tsx │ │ ├── react-app-env.d.ts │ │ ├── reducers │ │ │ ├── app.ts │ │ │ ├── counter.ts │ │ │ └── index.ts │ │ ├── reportWebVitals.ts │ │ ├── scss │ │ │ ├── App.scss │ │ │ └── index.scss │ │ ├── service-worker.ts │ │ ├── serviceWorkerRegistration.ts │ │ ├── setupTests.ts │ │ └── store │ │ │ ├── configureStore.dev.ts │ │ │ ├── configureStore.prod.ts │ │ │ └── index.ts │ └── tsconfig.json ├── frontend-components │ └── feature-01 │ │ ├── .babelrc │ │ ├── .env.development │ │ ├── .env.production │ │ ├── .gitignore │ │ ├── README.md │ │ ├── package.json │ │ ├── public │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── logo192.png │ │ ├── logo512.png │ │ ├── manifest.json │ │ └── robots.txt │ │ ├── src │ │ ├── App.tsx │ │ ├── Routes │ │ │ └── Routes.tsx │ │ ├── StyleProvider.tsx │ │ ├── actions-types │ │ │ └── index.ts │ │ ├── actions │ │ │ └── alerts.ts │ │ ├── assets │ │ │ └── images │ │ │ │ └── Big-chicken.svg │ │ ├── components │ │ │ ├── Alerts.tsx │ │ │ ├── Order.tsx │ │ │ ├── RecipeDetails │ │ │ │ ├── RecipeDetails.tsx │ │ │ │ ├── Styled.ts │ │ │ │ └── index.tsx │ │ │ └── WishList.tsx │ │ ├── config │ │ │ ├── host.ts │ │ │ └── images.ts │ │ ├── index.tsx │ │ ├── react-app-env.d.ts │ │ ├── reducers │ │ │ ├── alerts.ts │ │ │ └── index.ts │ │ ├── reportWebVitals.ts │ │ ├── scss │ │ │ ├── App.scss │ │ │ └── index.scss │ │ ├── setupTests.ts │ │ └── store │ │ │ ├── configureStore.dev.ts │ │ │ ├── configureStore.prod.ts │ │ │ └── index.ts │ │ └── tsconfig.json └── shared-components │ ├── .babelrc │ ├── .env │ ├── .gitignore │ ├── .storybook │ └── main.js │ ├── README.md │ ├── package.json │ ├── rollup.config.ts │ ├── src │ ├── bundle.ts │ ├── components │ │ ├── Button │ │ │ ├── Button.test.tsx │ │ │ ├── Button.tsx │ │ │ └── index.tsx │ │ ├── Container │ │ │ └── index.tsx │ │ └── OutlineButton │ │ │ └── index.tsx │ ├── react-app-env.d.ts │ ├── scss │ │ ├── App.scss │ │ └── index.scss │ ├── services │ │ ├── HttpService.ts │ │ └── Toast.ts │ ├── setupTests.ts │ ├── stories │ │ ├── 0-Welcome.stories.tsx │ │ └── 1-Button.stories.tsx │ └── utils │ │ └── commonFunction.ts │ └── tsconfig.json ├── tsconfig.json └── yarn.lock /.dockerignore: -------------------------------------------------------------------------------- 1 | **/node_modules 2 | npm-debug.log -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: CI 4 | 5 | # Controls when the workflow will run 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the master branch 8 | push: 9 | branches: [ master ] 10 | pull_request: 11 | branches: [ master ] 12 | 13 | # Allows you to run this workflow manually from the Actions tab 14 | workflow_dispatch: 15 | 16 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 17 | jobs: 18 | # This workflow contains a single job called "build" 19 | build: 20 | # The type of runner that the job will run on 21 | runs-on: ubuntu-latest 22 | 23 | # Steps represent a sequence of tasks that will be executed as part of the job 24 | steps: 25 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 26 | - uses: actions/checkout@v2 27 | - name: Configure AWS Credentials 28 | uses: aws-actions/configure-aws-credentials@v1 29 | with: 30 | aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} 31 | aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 32 | aws-region: ${{ secrets.AWS_REGION }} 33 | - name: Install dependencies 34 | run: yarn 35 | - name: Linking packages 36 | run: yarn bootstrap 37 | - name: Make a build 38 | run: yarn build 39 | - name: Copy feature-one in core-ui build folder 40 | run : cp -r ./packages/frontend-components/feature-01/build ./packages/core-ui/build/feature-one 41 | - name: Deploy app build to S3 bucket 42 | run: aws s3 sync ./packages/core-ui/build/ s3://my-react-mfe --delete 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /node_modules/* 6 | /.pnp/* 7 | /.pnp.js 8 | 9 | # testing 10 | /coverage/* 11 | /junit.xml 12 | 13 | # production 14 | /build/* 15 | /dist/* 16 | 17 | # misc 18 | .DS_Store 19 | .idea 20 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute? 2 | - 1 Fork the project. 3 | - 2 Make required changes and commit. 4 | - 3 Generate pull request. Mention all the required description regarding changes you made. 5 | 6 | Happy coding. 🙂 -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # build environment 2 | FROM node:14.17.3 3 | 4 | # ARG FROM_IMAGE=react-mfe 5 | # ARG FROM_TAG=latest 6 | # FROM ${FROM_IMAGE}:${FROM_TAG} AS react-mfe-build 7 | ARG SRCDIR=/usr/src/app 8 | 9 | # set working directory 10 | WORKDIR ${SRCDIR} 11 | 12 | # Install app dependencies 13 | COPY package.json ${SRCDIR}/package.json 14 | COPY lerna.json ${SRCDIR}/lerna.json 15 | COPY yarn.lock ${SRCDIR}/yarn.lock 16 | COPY ./packages/core-ui/package.json ${SRCDIR}/packages/core-ui/ 17 | COPY ./packages/frontend-components/feature-01/package.json ${SRCDIR}/packages/frontend-components/feature-01/ 18 | COPY ./packages/shared-components/package.json ${SRCDIR}/packages/shared-components/ 19 | 20 | RUN yarn global add serve 21 | 22 | # RUN install dependencies 23 | RUN yarn 24 | 25 | # Bundle app source 26 | COPY . ${SRCDIR} 27 | RUN yarn lerna bootstrap 28 | RUN yarn lerna run build 29 | 30 | COPY ./packages/frontend-components/feature-01/build ${SRCDIR}/packages/core-ui/build/feature-one 31 | 32 | # Expose the port and start the application 33 | EXPOSE 9090 34 | 35 | # CMD [ "yarn", "workspace", "@mfe/core-ui", "run", "start" ] 36 | CMD [ "serve", "-s", "/usr/src/app/packages/core-ui/build"] -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Asif Vora 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

React-mfe ✨️

2 |

A micro frontend implementation for react js

3 | 4 |

5 | 6 | react-mfe licence 7 | 8 | 9 | react-mfe forks 10 | 11 | 12 | react-mfe stars 13 | 14 | 15 | react-mfe issues 16 | 17 | 18 | react-mfe pull-requests 19 |

20 | 21 | [![React](https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB)](https://reactjs.org/) 22 | [![Redux](https://img.shields.io/badge/Redux-593D88?style=for-the-badge&logo=redux&logoColor=white)](https://redux.js.org/) 23 | [![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white)](https://www.typescriptlang.org/) 24 | [![ReactRouter](https://img.shields.io/badge/React_Router-CA4245?style=for-the-badge&logo=react-router&logoColor=white)](https://reactrouter.com/) 25 | [![Storybook](https://img.shields.io/badge/storybook-FF4785?style=for-the-badge&logo=storybook&logoColor=white)](https://storybook.js.org/) 26 | [![lerna](https://img.shields.io/badge/Lerna-blueviolet?style=for-the-badge&logo=lerna&logoColor=white)](https://lerna.js.org/) 27 | [![style: styled-components](https://img.shields.io/badge/style-%F0%9F%92%85%20styled--components-orange.svg?colorB=daa357&colorA=db748e)](https://github.com/styled-components/styled-components) 28 | [![Cypress.io](https://img.shields.io/badge/tested%20with-Cypress-04C38E.svg)](https://www.cypress.io/) 29 | 30 | 31 | 32 | 33 | # Why? 34 | ### To scale with multiple teams in a micro services environment 35 | 36 | - More cohesive codebase 37 | - Simplify maintenance 38 | - Allows to scale development teams 39 | - Simplify updates 40 | - Independent deploy 41 | 42 | # Read more about Micro frontends 43 | 44 | 45 | # 📖 App architecture 46 | 47 | - packages 48 | - core-ui 49 | - frontend-components 50 | - feature-01 51 | - feature-02 52 | - feature-03 53 | - feature-04 54 | - feature-05 55 | - ... 56 | - shared-components 57 | 58 | # 💻 Built With 59 | - [Lerna 🐉](https://lerna.js.org/) 60 | - [React](https://reactjs.org/) 61 | - [Redux](https://redux.js.org/) 62 | - [TypeScript](https://www.typescriptlang.org/) 63 | - [Rollup](https://rollupjs.org/) 64 | - [Styled Component](https://styled-components.com/) 65 | - [SCSS](https://sass-lang.com/) 66 | - [Storybook](https://storybook.js.org/) 67 | - [Router](https://reactrouter.com/) 68 | - Some services and utils 69 | 70 | # 🛠️ Installation Steps 71 | 72 | ### Clone the repository ⎘ 73 | ```bash 74 | git clone https://github.com/asifvora/react-mfe.git 75 | 76 | ``` 77 | 78 | ### Change the working directory 📂 79 | ```bash 80 | cd react-mfe 81 | ``` 82 | 83 | ### Install dependency 🚚 84 | ```bash 85 | yarn 86 | ``` 87 | 88 | ### Linking dependencies... 🔗 89 | ```bash 90 | yarn bootstrap 91 | ``` 92 | 93 | ### Start core-ui app :rocket: 94 | ```bash 95 | yarn start:core-ui 96 | ``` 97 | 98 | ### Start feature-01 app :rocket: 99 | ```bash 100 | yarn start:feature-01 101 | ``` 102 | 103 | ### Build all packages 🔨 104 | ```bash 105 | yarn build 106 | ``` 107 | 108 | You are all set! Open [localhost:3000](http://localhost:3000/) to see the app. 109 | 110 | 111 | # :whale: Docker 112 | ### Build 113 | ```bash 114 | docker build -t 115 | docker build -t react-mfe . 116 | docker image ls 117 | ``` 118 | 119 | ### Run a Container 120 | ```bash 121 | docker run -d -p : 122 | docker run -d -p 9090:5000 react-mfe 123 | 124 | ``` 125 | ### Check the running container 126 | ```bash 127 | docker ps -a 128 | ``` 129 | 130 | # 🛡️ License 131 | 132 | This project is licensed under the MIT License - see the [`LICENSE`](LICENSE) file for details. 133 | 134 | # 👨‍💻 Author 135 | ### 👤 Asif Vora 136 | - Github: [@asifvora](https://github.com/asifvora) 137 | - LinkedIn: [@asif-vora](https://www.linkedin.com/in/asif-vora/) 138 | - Twitter: [@007_dark_shadow](https://twitter.com/007_dark_shadow) 139 | - Instagram: [@007_dark_shadow](https://www.instagram.com/007_dark_shadow/) 140 | 141 | # 🍰 Contributing 142 | 143 | - Please contribute using [GitHub Flow](https://guides.github.com/introduction/flow). Create a branch, add commits, and [open a pull request](https://github.com/asifvora/react-mfe/compare). 144 | 145 | - Please read [`CONTRIBUTING`](CONTRIBUTING.md) for details. 146 | 147 | # 🙏 Support 148 | This project needs a ⭐️ from you. Don't forget to leave a star ⭐️ -------------------------------------------------------------------------------- /cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "baseUrl": "http://localhost:3000" 3 | } -------------------------------------------------------------------------------- /cypress/fixtures/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Using fixtures to represent data", 3 | "email": "hello@cypress.io", 4 | "body": "Fixtures are a great way to mock data for responses to routes" 5 | } 6 | -------------------------------------------------------------------------------- /cypress/integration/header.spec.js: -------------------------------------------------------------------------------- 1 | describe("Header", () => { 2 | beforeEach(() => { 3 | cy.visit("/"); 4 | }); 5 | 6 | it("render Food HQ link in header", () => { 7 | cy.get("a").contains("Food HQ"); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /cypress/integration/init.spec.js: -------------------------------------------------------------------------------- 1 | describe("Cypress", () => { 2 | it("is working", () => { 3 | expect(true).to.equal(true); 4 | }); 5 | 6 | it("visits the app", () => { 7 | cy.visit("/"); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /cypress/plugins/index.js: -------------------------------------------------------------------------------- 1 | 2 | // *********************************************************** 3 | // This example plugins/index.js can be used to load plugins 4 | // 5 | // You can change the location of this file or turn off loading 6 | // the plugins file with the 'pluginsFile' configuration option. 7 | // 8 | // You can read more here: 9 | // https://on.cypress.io/plugins-guide 10 | // *********************************************************** 11 | 12 | // This function is called when a project is opened or re-opened (e.g. due to 13 | // the project's config changing) 14 | 15 | module.exports = (on, config) => { 16 | // `on` is used to hook into various events Cypress emits 17 | // `config` is the resolved Cypress config 18 | } -------------------------------------------------------------------------------- /cypress/support/commands.js: -------------------------------------------------------------------------------- 1 | // *********************************************** 2 | // This example commands.js shows you how to 3 | // create various custom commands and overwrite 4 | // existing commands. 5 | // 6 | // For more comprehensive examples of custom 7 | // commands please read more here: 8 | // https://on.cypress.io/custom-commands 9 | // *********************************************** 10 | // 11 | // 12 | // -- This is a parent command -- 13 | // Cypress.Commands.add('login', (email, password) => { ... }) 14 | // 15 | // 16 | // -- This is a child command -- 17 | // Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) 18 | // 19 | // 20 | // -- This is a dual command -- 21 | // Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) 22 | // 23 | // 24 | // -- This will overwrite an existing command -- 25 | // Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) 26 | -------------------------------------------------------------------------------- /cypress/support/index.js: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example support/index.js is processed and 3 | // loaded automatically before your test files. 4 | // 5 | // This is a great place to put global configuration and 6 | // behavior that modifies Cypress. 7 | // 8 | // You can change the location of this file or turn off 9 | // automatically serving support files with the 10 | // 'supportFile' configuration option. 11 | // 12 | // You can read more here: 13 | // https://on.cypress.io/configuration 14 | // *********************************************************** 15 | 16 | // Import commands.js using ES2015 syntax: 17 | import './commands' 18 | 19 | // Alternatively you can use CommonJS syntax: 20 | // require('./commands') 21 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | "packages/core-ui", 4 | "packages/frontend-components/*", 5 | "packages/shared-components" 6 | ], 7 | "version": "0.0.0", 8 | "npmClient": "yarn", 9 | "useWorkspaces": true 10 | } 11 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "workspaces": { 4 | "packages": [ 5 | "packages/core-ui", 6 | "packages/frontend-components/*", 7 | "packages/shared-components" 8 | ] 9 | }, 10 | "devDependencies": { 11 | "@types/react": "^17.0.5", 12 | "@types/react-dom": "^17.0.3", 13 | "@types/react-redux": "^7.1.16", 14 | "@types/react-router-dom": "^5.1.7", 15 | "@types/redux-logger": "^3.0.8", 16 | "axios": "^0.21.1", 17 | "lerna": "^4.0.0", 18 | "react": "^17.0.2", 19 | "react-dom": "^17.0.2", 20 | "react-redux": "^7.2.4", 21 | "react-router-dom": "^5.2.0", 22 | "react-scripts": "4.0.1", 23 | "react-toastify": "^7.0.4", 24 | "redux": "^4.1.0", 25 | "redux-devtools-extension": "^2.13.9", 26 | "redux-logger": "^3.0.6", 27 | "redux-thunk": "^2.3.0", 28 | "react-icons": "^4.2.0" 29 | }, 30 | "scripts": { 31 | "build": "yarn lerna run build --ignore=@mfe/shared", 32 | "prebuild": "yarn lerna run build --scope=@mfe/shared", 33 | "start:core-ui": "yarn workspace @mfe/core-ui start", 34 | "start:feature-01": "yarn workspace @mfe/feature-01 start", 35 | "link": "yarn lerna run link", 36 | "clean": "yarn lerna run clean", 37 | "bootstrap": "yarn lerna bootstrap", 38 | "cypress": "cypress open" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /packages/core-ui/.env.development: -------------------------------------------------------------------------------- 1 | GENERATE_SOURCEMAP=true 2 | SKIP_PREFLIGHT_CHECK=true 3 | REACT_APP_FEATURE_ONE_HOST=http://localhost:9692 4 | -------------------------------------------------------------------------------- /packages/core-ui/.env.production: -------------------------------------------------------------------------------- 1 | GENERATE_SOURCEMAP=false 2 | SKIP_PREFLIGHT_CHECK=true 3 | REACT_APP_FEATURE_ONE_HOST=/feature-one -------------------------------------------------------------------------------- /packages/core-ui/.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 | 25 | #cache 26 | .eslintcache -------------------------------------------------------------------------------- /packages/core-ui/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 the browser. 13 | 14 | The page will reload if you make edits.\ 15 | You will 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 | -------------------------------------------------------------------------------- /packages/core-ui/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@mfe/core-ui", 3 | "version": "0.1.0", 4 | "private": true, 5 | "author": "asifvora", 6 | "license": "MIT", 7 | "peerDependencies": { 8 | "react": "^17.0.2", 9 | "react-dom": "^17.0.2", 10 | "react-redux": "^7.2.4", 11 | "react-router-dom": "^5.2.0", 12 | "redux": "^4.1.0", 13 | "redux-devtools-extension": "^2.13.9", 14 | "redux-logger": "^3.0.6", 15 | "redux-thunk": "^2.3.0" 16 | }, 17 | "devDependencies": { 18 | "@mfe/feature-01": "link: ../frontend-components/feature-01", 19 | "@mfe/shared": "link: ../shared-components/", 20 | "@testing-library/jest-dom": "^5.12.0", 21 | "@testing-library/react": "^11.2.6", 22 | "@testing-library/user-event": "^12.8.3", 23 | "@types/jest": "^26.0.23", 24 | "@types/node": "^12.20.11", 25 | "@types/node-sass": "^4.11.1", 26 | "@types/prettier": "^2.2.3", 27 | "@types/react": "^17.0.4", 28 | "@types/react-dom": "^17.0.3", 29 | "@types/react-redux": "^7.1.16", 30 | "@types/react-router-dom": "^5.1.7", 31 | "@types/redux-logger": "^3.0.8", 32 | "@types/testing-library__jest-dom": "^5.9.5", 33 | "cross-env": "^7.0.3", 34 | "cypress": "^8.3.1", 35 | "husky": "^6.0.0", 36 | "lint-staged": "^10.5.4", 37 | "node-sass": "^4.0.0", 38 | "prettier": "^2.2.1", 39 | "react-scripts": "4.0.1", 40 | "stylis-plugin-extra-scope": "^0.3.0", 41 | "typescript": "^4.0.3", 42 | "typesync": "^0.8.0", 43 | "web-vitals": "^1.1.1", 44 | "workbox-background-sync": "^5.1.3", 45 | "workbox-broadcast-update": "^5.1.3", 46 | "workbox-cacheable-response": "^5.1.3", 47 | "workbox-core": "^5.1.3", 48 | "workbox-expiration": "^5.1.3", 49 | "workbox-google-analytics": "^5.1.3", 50 | "workbox-navigation-preload": "^5.1.3", 51 | "workbox-precaching": "^5.1.3", 52 | "workbox-range-requests": "^5.1.3", 53 | "workbox-routing": "^5.1.3", 54 | "workbox-strategies": "^5.1.3", 55 | "workbox-streams": "^5.1.3" 56 | }, 57 | "resolutions": { 58 | "**/react": "^17.0.2", 59 | "**/react-dom": "^17.0.2" 60 | }, 61 | "scripts": { 62 | "postinstall": "typesync", 63 | "start": "react-scripts start", 64 | "build": "react-scripts build", 65 | "test": "react-scripts test", 66 | "eject": "react-scripts eject" 67 | }, 68 | "eslintConfig": { 69 | "extends": [ 70 | "react-app", 71 | "react-app/jest" 72 | ] 73 | }, 74 | "browserslist": { 75 | "production": [ 76 | ">0.2%", 77 | "not dead", 78 | "not op_mini all" 79 | ], 80 | "development": [ 81 | "last 1 chrome version", 82 | "last 1 firefox version", 83 | "last 1 safari version" 84 | ] 85 | }, 86 | "prettier": { 87 | "singleQuote": true 88 | }, 89 | "lint-staged": { 90 | "src/**/*.{js,jsx,ts,tsx,json,css,scss,md}": [ 91 | "prettier --write", 92 | "git add" 93 | ] 94 | }, 95 | "husky": { 96 | "hooks": { 97 | "pre-commit": "lint-staged" 98 | } 99 | }, 100 | "dependencies": { 101 | "react-loader-spinner": "^4.0.0" 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /packages/core-ui/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asifvora/react-mfe/d3ba690e30d75aa863dc04735b6d72e2ac62fd4c/packages/core-ui/public/favicon.ico -------------------------------------------------------------------------------- /packages/core-ui/public/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asifvora/react-mfe/d3ba690e30d75aa863dc04735b6d72e2ac62fd4c/packages/core-ui/public/icon-128x128.png -------------------------------------------------------------------------------- /packages/core-ui/public/icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asifvora/react-mfe/d3ba690e30d75aa863dc04735b6d72e2ac62fd4c/packages/core-ui/public/icon-144x144.png -------------------------------------------------------------------------------- /packages/core-ui/public/icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asifvora/react-mfe/d3ba690e30d75aa863dc04735b6d72e2ac62fd4c/packages/core-ui/public/icon-152x152.png -------------------------------------------------------------------------------- /packages/core-ui/public/icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asifvora/react-mfe/d3ba690e30d75aa863dc04735b6d72e2ac62fd4c/packages/core-ui/public/icon-192x192.png -------------------------------------------------------------------------------- /packages/core-ui/public/icon-384x384.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asifvora/react-mfe/d3ba690e30d75aa863dc04735b6d72e2ac62fd4c/packages/core-ui/public/icon-384x384.png -------------------------------------------------------------------------------- /packages/core-ui/public/icon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asifvora/react-mfe/d3ba690e30d75aa863dc04735b6d72e2ac62fd4c/packages/core-ui/public/icon-512x512.png -------------------------------------------------------------------------------- /packages/core-ui/public/icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asifvora/react-mfe/d3ba690e30d75aa863dc04735b6d72e2ac62fd4c/packages/core-ui/public/icon-72x72.png -------------------------------------------------------------------------------- /packages/core-ui/public/icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asifvora/react-mfe/d3ba690e30d75aa863dc04735b6d72e2ac62fd4c/packages/core-ui/public/icon-96x96.png -------------------------------------------------------------------------------- /packages/core-ui/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 16 | 17 | 26 | Food HQ 27 | 28 | 29 | 30 |
31 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /packages/core-ui/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Food HQ", 3 | "name": "Food HQ", 4 | "theme_color": "#e38b06", 5 | "background_color": "#ffffff", 6 | "display": "standalone", 7 | "orientation": "portrait", 8 | "Scope": "/", 9 | "start_url": "/", 10 | "icons": [ 11 | { 12 | "src": "icon-72x72.png", 13 | "sizes": "72x72", 14 | "type": "image/png" 15 | }, 16 | { 17 | "src": "icon-96x96.png", 18 | "sizes": "96x96", 19 | "type": "image/png" 20 | }, 21 | { 22 | "src": "icon-128x128.png", 23 | "sizes": "128x128", 24 | "type": "image/png" 25 | }, 26 | { 27 | "src": "icon-144x144.png", 28 | "sizes": "144x144", 29 | "type": "image/png" 30 | }, 31 | { 32 | "src": "icon-152x152.png", 33 | "sizes": "152x152", 34 | "type": "image/png" 35 | }, 36 | { 37 | "src": "icon-192x192.png", 38 | "sizes": "192x192", 39 | "type": "image/png" 40 | }, 41 | { 42 | "src": "icon-384x384.png", 43 | "sizes": "384x384", 44 | "type": "image/png" 45 | }, 46 | { 47 | "src": "icon-512x512.png", 48 | "sizes": "512x512", 49 | "type": "image/png" 50 | } 51 | ], 52 | "splash_pages": null 53 | } -------------------------------------------------------------------------------- /packages/core-ui/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /packages/core-ui/src/App.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /packages/core-ui/src/App.tsx: -------------------------------------------------------------------------------- 1 | import React, { Suspense } from 'react'; 2 | import { Router } from 'react-router-dom'; 3 | import { history } from './config/routes'; 4 | import { Routes } from './Routes'; 5 | import { Loader } from './components/Loader'; 6 | import { Footer } from './components/Footer'; 7 | import { Hero } from './components/Hero'; 8 | import ErrorBoundary from './components/ErrorBoundary'; 9 | 10 | export const App: React.FC = () => { 11 | return ( 12 | 13 | 14 | 15 | 16 | 17 | 18 |