Math magicians is a website for all fans of mathematics. It is a Single Page App (SPA) that allows users to:
- Make simple calculations.
- Read a random math-related quote.
It exposes the Calculator component for any other project to consume using Module Federation.
This application is built with React and Bootstrap.
- React
- Bootstrap
- Module Federation
- VSCode
- Gitflow & GitHub
To get this project up and running, follow these simple steps:
- Clone the repository into your machine.
- Open the project's folder with your preferred source-code editor.
- Run
pnpm install. - Run
pnpm dev.
- Any modern web browser.
- Any source-code editor (VSCode recommended).
To consume the Calculator component from a host Vite app, follow these simple steps:
- Install @originjs/vite-plugin-federation as a dev dependency.
pnpm i -D @originjs/vite-plugin-federation
- Configure the remote in your
vite.config.tsfile.
// vite.config.js
import federation from '@originjs/vite-plugin-federation';
export default defineConfig({
// ...
plugins: [
// ...
federation({
name: 'your-app-name',
remotes: {
mathMagicians: 'https://math-magicians.dicodiaz.com.co/assets/remoteEntry.js',
},
shared: ['react', 'react-dom', 'bootstrap'],
}),
// ...
],
// ...
});- Consume the component in your application
// App.jsx
import Calculator from 'mathMagicians/Calculator';
const App = () => {
return <Calculator />;
};👤 Dico Diaz Dussan
- GitHub: @dicodiaz
- LinkedIn: Dico Diaz Dussan
- Portfolio: portfolio.dicodiaz.com.co
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
This project is MIT licensed.

