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

Commit eaafa61

Browse files
authored
Merge pull request #432 from topcoder-platform/dev
[PROD] Next Release
2 parents 3a25e96 + aae6999 commit eaafa61

File tree

109 files changed

+3378
-1420
lines changed

Some content is hidden

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

109 files changed

+3378
-1420
lines changed

README.md

+32-27
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ TaaS App is done using Single SPA micro-frontend architecture https://single-spa
6464
### Local Authentication
6565

6666
First of all, to authenticate locally we have to run a local authentication service.
67+
6768
- Clone this repository into `taas-app`.
6869
- Inside the folder `taas-app/local/login-locally` run `npm run start`.
6970
- You would need npm 5+ for it. This would start a local sever on port 5000 which could be used for local Authentication.
@@ -76,36 +77,36 @@ Some config files are using domain `local.topcoder-dev.com`. You can change it t
7677

7778
1. Run **Frame** App:
7879

79-
```sh
80-
git clone https://github.com/topcoder-platform/micro-frontends-frame.git
81-
cd micro-frontends-frame
82-
# inside folder "micro-frontends-frame" run:
80+
```sh
81+
git clone https://github.com/topcoder-platform/micro-frontends-frame.git
82+
cd micro-frontends-frame
83+
# inside folder "micro-frontends-frame" run:
8384

84-
nvm use # or make sure to use Node 10
85-
npm i # to install dependencies
85+
nvm use # or make sure to use Node 10
86+
npm i # to install dependencies
8687

87-
# set environment variables:
88+
# set environment variables:
8889

89-
export APPMODE="development"
90-
export APPENV="local-multi"
90+
export APPMODE="development"
91+
export APPENV="local-multi"
9192

92-
npm run local-server
93+
npm run local-server
9394

94-
# this would start frame server on http://localhost:3000
95-
```
95+
# this would start frame server on http://localhost:3000
96+
```
9697

97-
open one more terminal window in the same folder and run:
98+
open one more terminal window in the same folder and run:
9899

99-
```sh
100-
# set environment variables:
100+
```sh
101+
# set environment variables:
101102

102-
export APPMODE="development"
103-
export APPENV="local-multi"
103+
export APPMODE="development"
104+
export APPENV="local-multi"
104105

105-
npm run local-client
106+
npm run local-client
106107

107-
# this host frame client code on http://localhost:8080
108-
```
108+
# this host frame client code on http://localhost:8080
109+
```
109110

110111
2. Run **Navbar** micro-app:
111112

@@ -135,23 +136,27 @@ Some config files are using domain `local.topcoder-dev.com`. You can change it t
135136
nvm use # or make sure to use Node 10
136137
npm i # to install dependencies
137138

139+
# set environment variables:
140+
141+
export STRIPE_PUBLIC_KEY=""
142+
138143
npm run dev
139144

140145
# this host TaaS App as http://localhost:8501/taas-app/topcoder-micro-frontends-teams.js
141146
```
142147

143148
4. Now we have to update the `micro-frontends-frame` app to show our local version of TaaS App, instead of remote one. Update file `micro-frontends-frame/config/micro-frontends-config-local.json`:
144149

145-
```js
146-
// replace line
147-
"@topcoder/micro-frontends-teams": "https://platform.topcoder-dev.com/taas-app/topcoder-micro-frontends-teams.js",
150+
```js
151+
// replace line
152+
"@topcoder/micro-frontends-teams": "https://platform.topcoder-dev.com/taas-app/topcoder-micro-frontends-teams.js",
148153

149-
// with line:
150-
"@topcoder/micro-frontends-teams": "http://localhost:8501/taas-app/topcoder-micro-frontends-teams.js",
151-
```
154+
// with line:
155+
"@topcoder/micro-frontends-teams": "http://localhost:8501/taas-app/topcoder-micro-frontends-teams.js",
156+
```
152157

153158
- Now open in the browser http://localhost:8080/taas/myteams.
154159
- If you are not logged-in yet, you should be redirected to the login page.
155160
- 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.
156161

157-
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.
162+
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.

build.sh

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ APP_NAME=$1
44
UPDATE_CACHE=""
55

66
docker build -f docker/Dockerfile -t $APP_NAME:latest \
7+
--build-arg STRIPE_PUBLIC_KEY=$STRIPE_PUBLIC_KEY \
78
--build-arg APPMODE=$APPMODE \
89
--build-arg APPENV=$APPENV .
910

docker/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ FROM node:10
33

44
ARG APPMODE
55
ARG APPENV
6+
ARG STRIPE_PUBLIC_KEY
67

78
ENV APPMODE=$APPMODE
89
ENV APPENV=$APPENV
10+
ENV STRIPE_PUBLIC_KEY=$STRIPE_PUBLIC_KEY
911

1012
# Copy the current directory into the Docker image
1113
COPY . /taas-app

local/login-locally/README

-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,3 @@
55
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
66

77
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
8-
9-
10-
11-

local/login-locally/index.html

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
<!DOCTYPE html>
22
<html>
3-
4-
<head>
3+
<head>
54
<title>Auth0</title>
65
<meta charset="utf-8" />
7-
<script language="javascript" type="text/javascript" src="./setupAuth0WithRedirect.js"></script>
8-
</head>
6+
<script
7+
language="javascript"
8+
type="text/javascript"
9+
src="./setupAuth0WithRedirect.js"
10+
></script>
11+
</head>
912

10-
<body>
13+
<body>
1114
Loaded...redirecting to auth0.(see browser console log)
1215
<script>
13-
window.onload = authSetup;
16+
window.onload = authSetup;
1417
</script>
15-
<a href="?retUrl=http://localhost:3000" >Login</a>
16-
</body>
17-
18+
<a href="?retUrl=http://localhost:3000">Login</a>
19+
</body>
1820
</html>

0 commit comments

Comments
 (0)