Skip to content

Commit df95ef1

Browse files
authored
Added a example that includes a admin dashboard with 5 react projects over rspack (#3761)
* added example dashboard-admin-react-rspack-material-ui * added example dashboard-admin-react-rspack-material-ui
1 parent c07b515 commit df95ef1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+73221
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
**/dist
14+
15+
# misc
16+
**/.DS_Store
17+
**/.env.local
18+
**/.env.development.local
19+
**/.env.test.local
20+
**/.env.production.local
21+
22+
**/npm-debug.log*
23+
**/yarn-debug.log*
24+
**/yarn-error.log*
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// Use o IntelliSense para saber mais sobre os atributos possíveis.
3+
// Focalizar para exibir as descrições dos atributos existentes.
4+
// Para obter mais informações, acesse: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
8+
{
9+
"type": "chrome",
10+
"request": "launch",
11+
"name": "Iniciar o Chrome em relação a localhost",
12+
"url": "http://localhost:3000",
13+
"webRoot": "${workspaceFolder}"
14+
}
15+
]
16+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Érky Lima
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.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# React + Admin Dashboard + Material UI and Webpack 5 Module Federation
2+
3+
Welcome to our web application, featuring a dashboard that seamlessly integrates various technologies. This showcase highlights the synergy of React, Webpack, Rspack, Module Federation, and Material UI working harmoniously to deliver a powerful and visually appealing user experience. Through this innovative amalgamation, we aim to demonstrate the seamless collaboration of these technologies, showcasing their collective potential in crafting dynamic and responsive web interfaces. This project was based on a [Dashboard](https://codesandbox.io/p/sandbox/react-dashboard-pnm6fh) implementation
4+
5+
6+
<img src="https://raw.githubusercontent.com/erkylima/react-microapps/main/imgs/img1.jpg" width="500" />
7+
8+
## Introduction
9+
10+
This system seamlessly integrates modular components, allowing for efficient code splitting and loading only the necessary resources on-demand. The Material UI design system ensures a sleek and responsive user interface, while the Webpack 5 and Rspack (using Module Federation) enhances scalability by enabling the sharing of modules across different micro-apps. With real-time data updates and a user-friendly interface, this dashboard provides an intuitive and visually appealing experience for users navigating complex datasets.
11+
12+
## Getting started
13+
14+
To run this project use docker-compose to quickstart:
15+
16+
> ```
17+
> git clone https://github.com/erkylima/react-microapps.git
18+
> cd react-microapps
19+
> docker-compose up
20+
> ```
21+
22+
Open [http://localhost:3000](http://localhost:3000) to view Webpack 5 module federated Root App\
23+
Open [http://localhost:3001](http://localhost:3001) to view Webpack 5 module federated Dashboard App\
24+
Open [http://localhost:3002](http://localhost:3002) to view Webpack 5 module federated Navigation App\
25+
Open [http://localhost:3003](http://localhost:3003) to view Webpack 5 module federated FAQ App\
26+
Open [http://localhost:3004](http://localhost:3004) to view Rspack module federated Team App
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM node:21.5.0-alpine as builder
2+
WORKDIR '/app'
3+
COPY package.json .
4+
RUN npm install
5+
COPY . .
6+
RUN npm run build
7+
8+
FROM nginx
9+
COPY --from=builder /app/build /usr/share/nginx/html
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM node:21.5.0-alpine
2+
3+
WORKDIR '/app'
4+
5+
COPY package.json .
6+
7+
RUN rm -rf node_modules/ && yarn
8+
9+
COPY . .
10+
11+
CMD ["yarn", "start"]
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"name": "header-app",
3+
"version": "0.1.0",
4+
"private": true,
5+
"homepage": "./",
6+
"dependencies": {
7+
"@emotion/react": "11.11.0",
8+
"@emotion/styled": "11.11.0",
9+
"@mui/icons-material": "5.15.2",
10+
"@mui/material": "5.15.2",
11+
"@nivo/bar": "0.80.0",
12+
"@nivo/core": "0.80.0",
13+
"@nivo/geo": "0.80.0",
14+
"@nivo/line": "0.80.0",
15+
"@nivo/pie": "0.80.0",
16+
"react": "18.2.0",
17+
"react-dom": "18.2.0",
18+
"react-router-dom": "6.21.3"
19+
},
20+
"scripts": {
21+
"start": "webpack serve",
22+
"build": "webpack --mode production"
23+
},
24+
"eslintConfig": {
25+
"extends": [
26+
"react-app",
27+
"react-app/jest"
28+
]
29+
},
30+
"browserslist": {
31+
"production": [
32+
">0.2%",
33+
"not dead",
34+
"not op_mini all"
35+
],
36+
"development": [
37+
"last 1 chrome version",
38+
"last 1 firefox version",
39+
"last 1 safari version"
40+
]
41+
},
42+
"devDependencies": {
43+
"@babel/core": "7.18.13",
44+
"@babel/plugin-proposal-class-properties": "7.18.6",
45+
"@babel/preset-env": "7.18.10",
46+
"@babel/preset-react": "7.18.6",
47+
"babel-loader": "8.2.5",
48+
"css-loader": "6.7.1",
49+
"html-webpack-plugin": "5.5.0",
50+
"style-loader": "3.3.3",
51+
"webpack": "5.74.0",
52+
"webpack-cli": "4.10.0",
53+
"webpack-dev-server": "4.10.0"
54+
}
55+
}
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Home</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
12+
</body>
13+
</html>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
import Dashboard from "./scenes/dashboard";
3+
4+
5+
6+
export default Dashboard;

0 commit comments

Comments
 (0)