Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 1411b5e

Browse files
author
Maria Mattlin
committed
Merge branch 'dev' into PROD-1531_update_documentation
2 parents 6f70ab8 + debbe6d commit 1411b5e

18 files changed

+241
-77
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ install_dependency: &install_dependency
1111
install_deploysuite: &install_deploysuite
1212
name: Installation of install_deploysuite.
1313
command: |
14-
git clone --branch v1.4.2 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
14+
git clone --branch v1.4.8 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
1515
cp ./../buildscript/master_deploy.sh .
1616
cp ./../buildscript/buildenv.sh .
1717
cp ./../buildscript/awsconfiguration.sh .
@@ -53,15 +53,15 @@ jobs:
5353
environment:
5454
DEPLOY_ENV: "DEV"
5555
LOGICAL_ENV: "dev"
56-
APPNAME: "micro-frontends-frame"
56+
APPNAME: "mfe-core"
5757
steps: *builddeploy_steps
5858

5959
"build-prod":
6060
<<: *defaults
6161
environment:
6262
DEPLOY_ENV: "PROD"
6363
LOGICAL_ENV: "prod"
64-
APPNAME: "micro-frontends-frame"
64+
APPNAME: "mfe-core"
6565
steps: *builddeploy_steps
6666

6767
workflows:

README.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Topcoder Frame Single-Spa Application (micro-frontends-frame)
1+
# Topcoder Frame Single-Spa Application (mfe-core)
22

3-
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.
55

66
## Overview
77

88
Topcoder Single Spa consist of 3 main components:
99

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.
1212
- Any other micro application can be loaded as main content of the overall application.
1313

1414
## Requirements
@@ -53,15 +53,15 @@ Given this complexity, it is recommended that you use a tool like [iTerm2](https
5353

5454
## Application Configuration
5555

56-
This `micro-frontends-frame` app has 2 types of configs:
56+
This `mfe-core` app has 2 types of configs:
5757

5858
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.
5959

6060
i. What needs to be added for a new micro-app:
6161
```json
6262
{
6363
"imports": {
64-
"@topcoder/micro-frontends-navbar-app": "https://mfe.topcoder-dev.com/navbar/topcoder-micro-frontends-navbar-app.js",
64+
"@topcoder/mfe-header": "https://mfe.topcoder-dev.com/navbar/topcoder-mfe-header.js",
6565
"<MICRO_APP_NAME>": "<RELATIVE_URL_PATH>"
6666
}
6767
}
@@ -70,7 +70,7 @@ This `micro-frontends-frame` app has 2 types of configs:
7070
ii. Location of the AWS S3 files:
7171
- 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`
7272
- 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`
7474

7575

7676
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:
8484
ii. Location of the AWS S3 files:
8585
- 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`
8686
- 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`
8888

8989
⚠️ **NOTE** : When a configuration files is updated on TC AWS S3, make sure to give public access to the file.
9090

@@ -102,7 +102,7 @@ This `micro-frontends-frame` app has 2 types of configs:
102102

103103
## Local Deployment from multi web servers (nodemon & webpack-dev-server) for local development
104104

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`:
106106

107107
| Command | Description |
108108
| -------------------- | ---------------------- |
@@ -117,7 +117,7 @@ To deploy `micro-frontends-frame` app locally run inside the project root `./mic
117117

118118
## Local Deployment from web server (node)
119119

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`:
121121

122122
| Command | Description |
123123
| -------------------- | ---------------------- |
@@ -189,7 +189,7 @@ For adding a child app to the root app make the following steps:
189189
1. Add child app path to importmap. File underpath
190190
- `https://tc-platform-prod.s3.amazonaws.com/micro-frontends/micro-frontends-config-production.json` for production deployment
191191
- `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
193193

194194
React example:
195195

@@ -206,7 +206,7 @@ For adding a child app to the root app make the following steps:
206206
2. Add a route which should show the app. File underpath
207207
- `https://tc-platform-prod.s3.amazonaws.com/micro-frontends/micro-frontends-routes-production.txt` for production deployment
208208
- `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
210210

211211
```html
212212
<route path="<RELATIVE_URL_PATH>">
@@ -216,7 +216,7 @@ For adding a child app to the root app make the following steps:
216216

217217
## Add-hoc child app replacement (import override)
218218

219-
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:
220220

221221
- Load already deployed frame app in the browser.
222222
- 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.
349349
350350
351351
### Checkout 4 repos and apply patches:
352-
- git clone https://github.com/topcoder-platform/micro-frontends-frame.git
353-
- git clone https://github.com/topcoder-platform/micro-frontends-navbar-app.git
352+
- git clone https://github.com/topcoder-platform/mfe-core.git
353+
- git clone https://github.com/topcoder-platform/mfe-header.git
354354
- git clone https://github.com/topcoder-platform/micro-frontends-react-app.git
355355
- git clone https://github.com/topcoder-platform/micro-frontends-angular-app.git
356356
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
375375
(1). root-config:
376376
open Terminal #1
377377
change the current dir to the root-config folder and apply patch:
378-
- cd micro-frontends-frame
379-
- git apply ../micro-frontends-frame.diff --ignore-whitespace --whitespace=nowarn
378+
- cd mfe-core
379+
- git apply ../mfe-core.diff --ignore-whitespace --whitespace=nowarn
380380
install dependencies:
381381
- npm install
382382
build and run the app:
@@ -385,8 +385,8 @@ build and run the app:
385385
(2). navbar-app:
386386
open Terminal #2
387387
change the current dir to the navbar-app folder and apply patch:
388-
- cd micro-frontends-navbar-app
389-
- git apply ../micro-frontends-navbar-app.diff --ignore-whitespace --whitespace=nowarn
388+
- cd mfe-header
389+
- git apply ../mfe-header.diff --ignore-whitespace --whitespace=nowarn
390390
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.
391391
```
392392
URL: {
@@ -443,9 +443,9 @@ The app can be open at the browser url: 'http://localhost:5000' (this page will
443443
444444
### Checkout 4 repos and apply patches:
445445
446-
- git clone https://github.com/topcoder-platform/micro-frontends-frame.git
446+
- git clone https://github.com/topcoder-platform/mfe-core.git
447447
448-
- git clone https://github.com/topcoder-platform/micro-frontends-navbar-app.git
448+
- git clone https://github.com/topcoder-platform/mfe-header.git
449449
450450
- git clone https://github.com/topcoder-platform/micro-frontends-react-app.git
451451
@@ -495,9 +495,9 @@ open Terminal #1
495495
496496
change the current dir to the root-config folder and apply patch:
497497
498-
- cd micro-frontends-frame
498+
- cd mfe-core
499499
500-
- git apply ../micro-frontends-frame.diff --ignore-whitespace --whitespace=nowarn
500+
- git apply ../mfe-core.diff --ignore-whitespace --whitespace=nowarn
501501
502502
install dependencies:
503503
@@ -515,9 +515,9 @@ open Terminal #2
515515
516516
change the current dir to the navbar-app folder and apply patch:
517517
518-
- cd micro-frontends-navbar-app
518+
- cd mfe-header
519519
520-
- git apply ../micro-frontends-navbar-app.diff --ignore-whitespace --whitespace=nowarn
520+
- git apply ../mfe-header.diff --ignore-whitespace --whitespace=nowarn
521521
522522
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.
523523
@@ -619,4 +619,4 @@ change the current dir to the 'auth0-local-login' folder and serve with the inde
619619
620620
- npx http-server . -p 5000
621621
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')

config/constants.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ module.exports = Object.freeze({
22
APP_CONFIG: [
33
{
44
'appEnv': 'dev',
5-
'mfeConfigPath': 'https://tc-public-static-files.topcoder-dev.com/micro-frontends/micro-frontends-config-development.json',
5+
'mfeConfigPath': '/config/micro-frontends-config-dev.json',
66
'mfeIndexPath': '/index.html',
7-
'mfeRoutesPath': 'https://tc-public-static-files.topcoder-dev.com/micro-frontends/micro-frontends-routes-development.txt'
7+
'mfeRoutesPath': '/config/micro-frontends-routes-dev.txt'
88
},
99
{
1010
'appEnv': 'prod',
11-
'mfeConfigPath': 'https://tc-public-static-files.topcoder.com/micro-frontends/micro-frontends-config-production.json',
11+
'mfeConfigPath': '/config/micro-frontends-config-prod.json',
1212
'mfeIndexPath': '/index.html',
13-
'mfeRoutesPath': 'https://tc-public-static-files.topcoder.com/micro-frontends/micro-frontends-routes-production.txt'
13+
'mfeRoutesPath': '/config/micro-frontends-routes-prod.txt'
1414
},
1515
{
1616
'appEnv': 'local-multi',

config/docs/adr-01.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# ADR-01 2022-05-06
2+
3+
4+
5+
We moved the source of the config json and routes txt files to source control
6+
from the S3 server in order to simplify modifications.
7+
8+
There is no sensitive info in these files, so there is no need to host
9+
them any differently in prod or dev envs.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"imports": {
3+
"@topcoder/mfe-header": "https://platform.topcoder-dev.com/navbar/topcoder-mfe-header.js",
4+
"@topcoder/micro-frontends-react-app": "https://platform.topcoder-dev.com/react/topcoder-micro-frontends-react-app.js",
5+
"@topcoder/micro-frontends-angular-app": "https://platform.topcoder-dev.com/angular/main.js",
6+
"@topcoder/micro-frontends-teams": "https://platform.topcoder-dev.com/taas-app/topcoder-micro-frontends-teams.js",
7+
"@topcoder/micro-frontends-task-marketplace-app": "https://platform.topcoder-dev.com/tasks/topcoder-micro-frontends-task-marketplace-app.js",
8+
"@topcoder/micro-frontends-earn-app": "https://platform.topcoder-dev.com/earn-app/topcoder-micro-frontends-earn-app.js",
9+
"@topcoder/micro-frontends-submission-review-app": "https://platform.topcoder-dev.com/submissionreview/topcoder-micro-frontends-submission-review-app.js",
10+
"@topcoder/micro-frontends-model-app": "https://platform.topcoder-dev.com/model-app/topcoder-micro-frontends-model-app.js",
11+
"@topcoder/micro-frontends-community-admin-app": "https://tc-micro-community-admin.herokuapp.com/community-admin-app/topcoder-micro-frontends-community-admin-app.js",
12+
"@topcoder/micro-frontends-taas-admin-app": "https://platform.topcoder-dev.com/taas-admin-app/topcoder-micro-frontends-taas-admin-app.js",
13+
"@topcoder/micro-frontends-profile-app": "https://platform.topcoder-dev.com/profile-app/topcoder-micro-frontends-profile-app.js",
14+
"@topcoder/micro-frontends-onboarding-app": "https://platform.topcoder-dev.com/onboarding-app/topcoder-micro-frontends-onboarding-app.js",
15+
"@topcoder/micro-frontends-forums-app": "https://platform.topcoder-dev.com/forums-app/topcoder-micro-frontends-forums-app.js",
16+
"@topcoder/mfe-customer-work": "https://platform.topcoder-dev.com/self-service-app/topcoder-mfe-customer-work.js"
17+
}
18+
}

config/micro-frontends-config-local.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"imports": {
3-
"@topcoder/micro-frontends-navbar-app": "http://localhost:3001/navbar/topcoder-micro-frontends-navbar-app.js",
3+
"@topcoder/mfe-header": "http://localhost:3001/navbar/topcoder-mfe-header.js",
44
"@topcoder/micro-frontends-taas-admin-app": "https://platform.topcoder-dev.com/taas-admin-app/topcoder-micro-frontends-taas-admin-app.js",
55
"@topcoder/micro-frontends-react-app": "https://platform.topcoder-dev.com/react/topcoder-micro-frontends-react-app.js",
66
"@topcoder/micro-frontends-angular-app": "https://platform.topcoder-dev.com/angular/main.js",
@@ -13,6 +13,6 @@
1313
"@topcoder/micro-frontends-profile-app": "http://localhost:8009/profile-app/topcoder-micro-frontends-profile-app.js",
1414
"@topcoder/micro-frontends-onboarding-app": "http://localhost:8510/onboarding-app/topcoder-micro-frontends-onboarding-app.js",
1515
"@topcoder/micro-frontends-forums-app": "http://localhost:8510/forums-app/topcoder-micro-frontends-forums-app.js",
16-
"@topcoder/micro-frontends-self-service-app": "http://localhost:8519/self-service-app/topcoder-micro-frontends-self-service-app.js"
16+
"@topcoder/mfe-customer-work": "http://localhost:8519/self-service-app/topcoder-mfe-customer-work.js"
1717
}
1818
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"imports": {
3+
"@topcoder/mfe-header": "https://platform.topcoder.com/navbar/topcoder-mfe-header.js",
4+
"@topcoder/micro-frontends-react-app": "https://platform.topcoder.com/react/topcoder-micro-frontends-react-app.js",
5+
"@topcoder/micro-frontends-angular-app": "https://platform.topcoder.com/angular/main.js",
6+
"@topcoder/micro-frontends-teams": "https://platform.topcoder.com/taas-app/topcoder-micro-frontends-teams.js",
7+
"@topcoder/micro-frontends-task-marketplace-app": "https://platform.topcoder.com/tasks/topcoder-micro-frontends-task-marketplace-app.js",
8+
"@topcoder/micro-frontends-earn-app": "https://platform.topcoder.com/earn-app/topcoder-micro-frontends-earn-app.js",
9+
"@topcoder/micro-frontends-submission-review-app": "https://platform.topcoder.com/submissionreview/topcoder-micro-frontends-submission-review-app.js",
10+
"@topcoder/micro-frontends-model-app": "https://platform.topcoder.com/model-app/topcoder-micro-frontends-model-app.js",
11+
"@topcoder/micro-frontends-taas-admin-app": "https://platform.topcoder.com/taas-admin-app/topcoder-micro-frontends-taas-admin-app.js",
12+
"@topcoder/micro-frontends-profile-app": "https://platform.topcoder.com/profile-app/topcoder-micro-frontends-profile-app.js",
13+
"@topcoder/micro-frontends-onboarding-app": "https://platform.topcoder.com/onboarding-app/topcoder-micro-frontends-onboarding-app.js",
14+
"@topcoder/mfe-customer-work": "https://platform.topcoder.com/self-service-app/topcoder-mfe-customer-work.js"
15+
}
16+
}

0 commit comments

Comments
 (0)