You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 13, 2025. It is now read-only.
This is the micro-frontends-frame[single-spa](https://single-spa.js.org/) application which loads all other Topcoder micro-frontend applications.
4
-
It always loads **Topcoder Navbar Microapp** which provides the top-level navigation, handles authorization, and loads other microapps depend on the current URL.
3
+
This is the mfe-core[single-spa](https://single-spa.js.org/) application which loads all other Topcoder micro applications.
4
+
It always loads **Topcoder Navbar Microapp** which show the top navigation and handles authorization and loads other microapps depend on the current URL.
5
5
6
6
## Overview
7
7
8
8
Topcoder Single Spa consist of 3 main components:
9
9
10
-
- This frame application which is `micro-frontends-frame`[single-spa](https://single-spa.js.org/) application. The only function of this application is to register other micro applications to load.
11
-
-**Topcoder Navbar Microapp** - micro application which is always loaded by the frame application and shows the top-level navigation bar and handles user authorization.
10
+
- This frame application which is `mfe-core`[single-spa](https://single-spa.js.org/) application. The only function of this application is to register other micro applications to load.
11
+
-**Topcoder Navbar Microapp** - micro application which is always loaded by the frame application and shows top navigation bar and handles user authorization.
12
12
- Any other micro application can be loaded as main content of the overall application.
13
13
14
14
## Requirements
@@ -53,15 +53,15 @@ Given this complexity, it is recommended that you use a tool like [iTerm2](https
53
53
54
54
## Application Configuration
55
55
56
-
This `micro-frontends-frame` app has 2 types of configs:
56
+
This `mfe-core` app has 2 types of configs:
57
57
58
58
1. Import mapping for the frame, containg `micro app name` and `relative url path` for each micro app. The configuration files are available on TC AWS S3 and have public access.
@@ -70,7 +70,7 @@ This `micro-frontends-frame` app has 2 types of configs:
70
70
ii. Location of the AWS S3 files:
71
71
- Configure micro app names and relative URL to be used when deployed to production environment in file at location : `https://tc-platform-prod.s3.amazonaws.com/micro-frontends/micro-frontends-config-production.json`
72
72
- Configure micro app names and relative URL to be used when deployed to development environment in file at location : `https://tc-platform-dev.s3.amazonaws.com/micro-frontends/micro-frontends-config-development.json`
73
-
- Configure micro app names and relative URL to be used when deployed to local environment in file at location : `./micro-frontends-frame/config/micro-frontends-config-local.json`
73
+
- Configure micro app names and relative URL to be used when deployed to local environment in file at location : `./mfe-core/config/micro-frontends-config-local.json`
74
74
75
75
76
76
2. Route mapping handled by the frame, containing `route path` and `micro app name` for each micro app. The configuration files are available on TC AWS S3 and have public access.
@@ -84,7 +84,7 @@ This `micro-frontends-frame` app has 2 types of configs:
84
84
ii. Location of the AWS S3 files:
85
85
- Configure route path and micro app name to be used when deployed to production environment in file at location : `https://tc-platform-prod.s3.amazonaws.com/micro-frontends/micro-frontends-routes-production.txt`
86
86
- Configure route path and micro app name to be used when deployed to development environment in file at location : `https://tc-platform-dev.s3.amazonaws.com/micro-frontends/micro-frontends-routes-development.txt`
87
-
- Configure route path and micro app name to be used when deployed to development environment in file at location : `./micro-frontends-frame/config/micro-frontends-routes-local.txt`
87
+
- Configure route path and micro app name to be used when deployed to development environment in file at location : `./mfe-core/config/micro-frontends-routes-local.txt`
88
88
89
89
⚠️ **NOTE** : When a configuration files is updated on TC AWS S3, make sure to give public access to the file.
90
90
@@ -102,7 +102,7 @@ This `micro-frontends-frame` app has 2 types of configs:
102
102
103
103
## Local Deployment from multi web servers (nodemon & webpack-dev-server) for local development
104
104
105
-
To deploy `micro-frontends-frame` app locally run inside the project root `./micro-frontends-frame`:
105
+
To deploy `mfe-core` app locally run inside the project root `./mfe-core`:
106
106
107
107
| Command | Description |
108
108
| -------------------- | ---------------------- |
@@ -117,7 +117,7 @@ To deploy `micro-frontends-frame` app locally run inside the project root `./mic
117
117
118
118
## Local Deployment from web server (node)
119
119
120
-
To deploy `micro-frontends-frame` app locally run inside the project root `./micro-frontends-frame`:
120
+
To deploy `mfe-core` app locally run inside the project root `./mfe-core`:
121
121
122
122
| Command | Description |
123
123
| -------------------- | ---------------------- |
@@ -189,7 +189,7 @@ For adding a child app to the root app make the following steps:
189
189
1. Add child app path to importmap. File underpath
190
190
-`https://tc-platform-prod.s3.amazonaws.com/micro-frontends/micro-frontends-config-production.json` for production deployment
191
191
-`https://tc-platform-dev.s3.amazonaws.com/micro-frontends/micro-frontends-config-development.json` for development deployment
192
-
-`./micro-frontends-frame/config/micro-frontends-config-local.json` for local deployment
192
+
-`./mfe-core/config/micro-frontends-config-local.json` for local deployment
193
193
194
194
React example:
195
195
@@ -206,7 +206,7 @@ For adding a child app to the root app make the following steps:
206
206
2. Add a route which should show the app. File underpath
207
207
-`https://tc-platform-prod.s3.amazonaws.com/micro-frontends/micro-frontends-routes-production.txt` for production deployment
208
208
-`https://tc-platform-dev.s3.amazonaws.com/micro-frontends/micro-frontends-routes-development.txt` for development deployment
209
-
-`./micro-frontends-frame/config/micro-frontends-routes-local.txt` for local deployment
209
+
-`./mfe-core/config/micro-frontends-routes-local.txt` for local deployment
210
210
211
211
```html
212
212
<routepath="<RELATIVE_URL_PATH>">
@@ -216,7 +216,7 @@ For adding a child app to the root app make the following steps:
To run a child app locally we always need to have frame (`micro-frontends-frame`) which would load a child app. But the cool thing is that we don't have to deploy the frame locally and we can use already deployed frame app. We can use a dev tool to override a child app URL so it would be loaded from the local machine by following the next steps:
219
+
To run a child app locally we always need to have frame (`mfe-core`) which would load a child app. But the cool thing is that we don't have to deploy the frame locally and we can use already deployed frame app. We can use a dev tool to override a child app URL so it would be loaded from the local machine by following the next steps:
220
220
221
221
- Load already deployed frame app in the browser.
222
222
- Open browser console and set `devtools` flag in the local storage by executing the next command:
@@ -349,8 +349,8 @@ There is no universal approach to run any React app as child app in Single SPA.
and create a folder (ex: 'auth0-local-login'), and save the following file: 'https://accounts-auth0.topcoder-dev.com/setupAuth0WithRedirect.js' into that folder. After 'setupAuth0WithRedirect.js' file was saved, create an empty 'index.html' file with the following content:
@@ -375,8 +375,8 @@ and create a folder (ex: 'auth0-local-login'), and save the following file: 'htt
375
375
(1). root-config:
376
376
open Terminal #1
377
377
change the current dir to the root-config folder and apply patch:
there is a config file: '{navbar-app-repo}/config/development.js'. To login locally, change 'ACCOUNTS_APP_CONNECTOR', and 'AUTH' to point to the server that will be served in folder 'auth0-local-login' which was setup in the previous step.
391
391
```
392
392
URL: {
@@ -443,9 +443,9 @@ The app can be open at the browser url: 'http://localhost:5000' (this page will
there is a config file: '{navbar-app-repo}/config/development.js'. To login locally, change 'ACCOUNTS_APP_CONNECTOR', and 'AUTH' to point to the server that will be served in folder 'auth0-local-login' which was setup in the previous step.
523
523
@@ -619,4 +619,4 @@ change the current dir to the 'auth0-local-login' folder and serve with the inde
619
619
620
620
- npx http-server . -p 5000
621
621
622
-
The app can be open at the browser url: 'http://localhost:5000' (this page will redirect to the actual page: 'http://localhost:3000')
622
+
The app can be open at the browser url: 'http://localhost:5000' (this page will redirect to the actual page: 'http://localhost:3000')
0 commit comments