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.
Copy file name to clipboardExpand all lines: README.md
+77-10
Original file line number
Diff line number
Diff line change
@@ -39,14 +39,6 @@ For application constants which don't depend on the running environment use `src
39
39
|`npm run watch-tests`| Watch for file changes and run unit tests on changes |
40
40
|`npm run coverage`| Generate test code coverage report |
41
41
42
-
## Local Deployment
43
-
44
-
Inside the project folder run:
45
-
46
-
-`npm i` - install dependencies
47
-
-`npm run dev` - run app in development mode
48
-
- As this app can be loaded only inside a frame single-spa, you have to run a `micro-frontends-frame` frame app and configure it to use the URL `http://localhost:8501/topcoder-micro-frontends-teams.js`.
49
-
50
42
## Deployment to Production
51
43
52
44
-`npm i` - install dependencies
@@ -65,6 +57,81 @@ Make sure you have [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli
65
57
-`git push heroku master` - push changes to Heroku and trigger deploying
66
58
- Now you have to configure frame app to use the URL provided by Heroku like `https://<APP-NAME>.herokuapp.com/topcoder-micro-frontends-teams.js` to load this micro-app.
67
59
68
-
## Verification
60
+
## How to run Locally for Development
61
+
62
+
TaaS App is done using Single SPA micro-frontend architecture https://single-spa.js.org/. So to start it, we would also have to run Frame App and Navbar App. Here I would show the steps to run locally everything we need.
63
+
64
+
### Local Authentication
65
+
66
+
First of all, to authenticate locally we have to run a local authentication service.
67
+
- Clone this repository into `taas-app`.
68
+
- Inside the folder `taas-app/local/login-locally` run `npm run start`.
69
+
- You would need npm 5+ for it. This would start a local sever on port 5000 which could be used for local Authentication.
70
+
71
+
### Local Domain
72
+
73
+
Some config files are using domain `local.topcoder-dev.com`. You can change it to `localhost` in all the configs of each repo mentioned below. Or on your local machine, update file `/etc/hosts` add the line `127.0.0.1 local.topcoder-dev.com`. This file has another path on Windows.
Update in file `micro-frontends-navbar-app/blob/dev/config/dev.js` values for`ACCOUNTS_APP_CONNECTOR` and `AUTH` to `http://localhost:5000` so Navbar app which handles authentication uses our local Authentication service.
113
+
114
+
```sh
115
+
# inside folder "micro-frontends-navbar-app" run:
116
+
117
+
nvm use # or make sure to use Node 10
118
+
npm i # to install dependencies
119
+
120
+
npm run dev
121
+
```
122
+
123
+
3. Run **TaaS** micro-app:
124
+
```sh
125
+
# inside folder "taas-app" run:
126
+
127
+
nvm use # or make sure to use Node 10
128
+
npm i # to install dependencies
129
+
130
+
npm run dev
131
+
```
132
+
133
+
- Now open in the browser http://localhost:8080/taas/myteams.
134
+
- If you are not logged-in yet, you should be redirected to the login page.
135
+
- If you cannot see the application and redirect doesn't happen, make sure that file "http://local.topcoder-dev.com:8501/taas-app/topcoder-micro-frontends-teams.js" is loaded successfully in the Network tab.
Congratulations, you successfully run the project. If you had some issue, please, try to go through README of https://github.com/topcoder-platform/micro-frontends-frame and https://github.com/topcoder-platform/micro-frontends-navbar-app.
1. Run any static files server inside this directory, for example:
2
+
- `npx http-server . -p 5000`
3
+
- `php -S localhost:5000`
4
+
2. Run your application on http://localhost:3000.
5
+
3. Now you can open http://localhost:5000 in browser and click login (wait it a little bit, it may take time to redirect you). After you login, you should be redirected back to http://localhost:3000
6
+
7
+
PS. You may also download latest version of `setupAuth0WithRedirect.js` file from here - https://github.com/topcoder-platform/tc-auth-lib/blob/dev/web-assets/js/setupAuth0WithRedirect.js
0 commit comments