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

Commit 7cada80

Browse files
Merge pull request #87 from topcoder-platform/PROD-2161_update-readme
PROD-2161 updating readme file -> Dev
2 parents fa5eb19 + 1df6c5b commit 7cada80

File tree

1 file changed

+39
-6
lines changed

1 file changed

+39
-6
lines changed

README.md

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,33 @@
33
This is the mfe-core [single-spa](https://single-spa.js.org/) application which loads all other Topcoder micro-frontend (MFE) applications.
44
It always loads the **Topcoder Header Microapp** which provides the top-level navigation, handles authorization, and loads other microapps depending on the current URL.
55

6+
## Content
7+
8+
Following are the list of sections defined in this document,
9+
10+
- [Overview](#overview)
11+
- [Requirements](#requirements)
12+
- [Local Development Setup](#local-development-setup)
13+
- [IDE](#ide)
14+
- [Hosting](#hosting)
15+
- [Terminal Configuration](#terminal-configuration)
16+
- [Linting](#linting)
17+
- [Git](#git)
18+
- [Branching](#branching)
19+
- [Commits](#commits)
20+
- [Application Configuration](#application-configuration)
21+
- [NPM Commands](#npm-commands)
22+
- [Local Deployment](#local-deployment)
23+
- [Deployment to Development](#deployment-to-development)
24+
- [Deployment to Production](#deployment-to-production)
25+
- [Segment Analytics](#segment-analytics)
26+
- [Add or Remove child app](#add-or-remove-child-app)
27+
- [Add-hoc child app replacement (import override)](#add-hoc-child-app-replacement-import-override)
28+
- [Creating child apps (microapps)](#creating-child-apps-microapps)
29+
- [Create new or use existent Angular child app](#create-new-or-use-existent-angular-child-app)
30+
- [Create new React child app](#create-new-react-child-app)
31+
- [Use existent React child app](#use-existent-react-child-app)
32+
633
## Overview
734

835
Topcoder Single Spa consist of 3 main components:
@@ -140,7 +167,9 @@ This `mfe-core` app has 2 types of configs:
140167
| `npm run format` | Format code using prettier |
141168
| `npm run test` | Run unit tests |
142169

143-
## Local Deployment from multi web servers (nodemon & webpack-dev-server) for local development - (most common)
170+
## Local Deployment
171+
172+
### Local Deployment from multi web servers (nodemon & webpack-dev-server) for local development - (most common)
144173

145174
To run the `mfe-core` app locally, run the following commands from the project root `./mfe-core`:
146175

@@ -154,7 +183,7 @@ Terminal 2
154183
$ npm run start-client
155184
```
156185
157-
## Local Deployment from web server (node)
186+
### Local Deployment from web server (node)
158187
159188
To deploy `mfe-core` app locally run inside the project root `./mfe-core`:
160189
@@ -169,7 +198,9 @@ To deploy `mfe-core` app locally run inside the project root `./mfe-core`:
169198
170199
⚠️ **NOTE** : that to make authorization work locally, you have to use domain `local.topcoder-dev.com` with port `3000`. On your local machine access file `/etc/hosts` add the line `127.0.0.1 local.topcoder-dev.com` and open app by URL http://local.topcoder-dev.com:3000
171200
172-
## Deployment to Development from web server (node) port 80
201+
## Deployment to Development
202+
203+
### Deployment to Development from web server (node) port 80
173204
174205
| Command | Description |
175206
| -------------------- | ---------------------- |
@@ -180,7 +211,9 @@ To deploy `mfe-core` app locally run inside the project root `./mfe-core`:
180211
| `$ npm start` | to start the app on port `80`, served from `dist/` |
181212
| `https://mfe.topcoder-dev.com/micro-frontends-react-route` | open url in browser to access the micro frame with react micro app and micro navbar app |
182213
183-
## Deployment to Production from web server (node) port 80
214+
## Deployment to Production
215+
216+
### Deployment to Production from web server (node) port 80
184217
185218
| Command | Description |
186219
| -------------------- | ---------------------- |
@@ -191,7 +224,7 @@ To deploy `mfe-core` app locally run inside the project root `./mfe-core`:
191224
| `$ npm start` | to start the app on port `80`, served from `dist/` |
192225
| `https://mfe.topcoder.com/micro-frontends-react-route` | open url in browser to access the micro frame with react micro app and micro navbar app |
193226
194-
### Deploying to Heroku
227+
#### Deploying to Heroku
195228
196229
Make sure you have [Heroky CLI](https://devcenter.heroku.com/articles/heroku-cli) installed and you have a Heroku account. And then inside the project folder run the next commands:
197230
@@ -221,7 +254,7 @@ Because analytics can be normally initialized once per website, we are initializ
221254
- We can enable debug mode by calling `analytics.debug();` inside browser console, see [debug documentation](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#debug).
222255
- TODO: we might consider implementing one global logic for calling `window.analytics.page()` inside Frame of Navbar app so child apps wouldn't worry about this. Though we have to make sure that it works smoothly. In particular we have to make sure that if child app updates page `<title>` then `window.analytics.page()` is called after that and logs to the analytic correct page title. Also, child apps might want to provide additional arguments when calling `window.analytics.page()`. So we might come to this improvement in some time, after we try the current approach.
223256

224-
## Add/Remove child app
257+
## Add or Remove child app
225258

226259
For adding a child app to the root app make the following steps:
227260

0 commit comments

Comments
 (0)