Git Product home page Git Product logo

simple-micro-frontend's Introduction

Simple Micro Frontend

This project is an example of a micro frontend using Module Feredation

pt-br

πŸ’ͺ Motivation

More and more front-end projects get bigger and complex, in 2016 I had a really cool experience with micro frontends, at that time it was not very common and our approach can be said that it was not the best possible but it worked very well. This project intend to be a simple and scalable boilerplate of a micro frontend, in it I used the Module Federation, to better understand I recommend accessing the following links:

What's?

Webpack 5 Module Federation - Zack Jackson

🧩 Installation

After cloning the repository, you must run the command below at the root of the project:

yarn install-all

You need Node.js e Yarn

πŸƒβ€β™‚οΈRunning

Run the command below to start the applications: dashboard, profile and projects

yarn start-all

or if you prefer you can run the command below for each project: dashboard, profile and projects

yarn start

The ports of each project:

Project Port
dashboard 3000
profile 3001
projects 3002

πŸ— Project structure

The project structure presented is just an example, here I tried to make it as simple and scalable as possible:

.
β”œβ”€β”€ dashboard                # Full dashboard using the `profile` and` projects` page.
β”œβ”€β”€ profile                  # Profile containing only the profile page and related components.
β”œβ”€β”€ projects                 # Projects containing only the projects page and related components.

Internal structure of each project:

.
β”œβ”€β”€ public                   # Public files
β”œβ”€β”€ src                      # Application code source
β”‚ β”œβ”€β”€ components             # Generic application components
β”‚ β”œβ”€β”€ styles                 # Generic application styles
β”‚ β”œβ”€β”€ views                  # Pages used on the router
β”‚ β”œβ”€β”€ App.js                 # Main application bootstrap with routes
β”‚ β”œβ”€β”€ bootstrap.js           # Responsible for importing App.js and rendering in the DOM
β”‚ β”œβ”€β”€ index.js               # Performs async import from bootstrap.js
└── webpack.config.js        # Bundler the all project and also where modules are exported so that projects can be reused

✏️ License

This project is distributed under the MIT license.

simple-micro-frontend's People

Contributors

pepoeverton avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.