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

Commit 94e2c8c

Browse files
authored
Merge pull request #123 from topcoder-platform/dev
Gigs Listing Integration Done
2 parents 3f2eb57 + de32b60 commit 94e2c8c

File tree

86 files changed

+6527
-1115
lines changed

Some content is hidden

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

86 files changed

+6527
-1115
lines changed

.eslintrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"extends": ["react-important-stuff", "plugin:prettier/recommended"],
3-
"parser": "babel-eslint"
3+
"parser": "babel-eslint",
4+
"env": {
5+
"node": true
6+
}
47
}

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": false
3+
}

README.md

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,19 @@ This is a [single-spa](https://single-spa.js.org/) example React microapp.
1313

1414
## NPM Commands
1515

16-
Command | Description
17-
--------------------- | -----------------------------------------------------------------
18-
`npm start` | Run server which serves production ready build from `dist` folder
19-
`npm run dev` | Run app in the development mode
20-
`npm run dev-https` | Run app in the development mode using HTTPS protocol
21-
`npm run build` | Build app for production and puts files to the `dist` folder
22-
`npm run analyze` | Analyze dependencies sizes and opens report in the browser
23-
`npm run lint` | Check code for lint errors
24-
`npm run format` | Format code using prettier
25-
`npm run test` | Run unit tests
26-
`npm run watch-tests` | Watch for file changes and run unit tests on changes
27-
`npm run coverage` | Generate test code coverage report
16+
| Command | Description |
17+
| --------------------- | ----------------------------------------------------------------- |
18+
| `npm start` | Run server which serves production ready build from `dist` folder |
19+
| `npm run dev` | Run app in the development mode |
20+
| `npm run dev-https` | Run app in the development mode using HTTPS protocol |
21+
| `npm run build` | Build app for production and puts files to the `dist` folder |
22+
| `npm run analyze` | Analyze dependencies sizes and opens report in the browser |
23+
| `npm run lint` | Check code for lint errors |
24+
| `npm run format` | Format code using prettier |
25+
| `npm run test` | Run unit tests |
26+
| `npm run watch-tests` | Watch for file changes and run unit tests on changes |
27+
| `npm run coverage` | Generate test code coverage report |
28+
| `npm run mock-api` | Start the mock api which mocks Recruit api |
2829

2930
## Local Deployment
3031

@@ -58,3 +59,20 @@ Make sure you have [Heroky CLI](https://devcenter.heroku.com/articles/heroku-cli
5859

5960
- Now you have to configure frame app to use the URL provided by Heroku like `https://<APP-NAME>.herokuapp.com/earn-app/topcoder-micro-frontends-earn-app.js` to load this microapp.
6061

62+
### Aggregator API
63+
64+
Please refer to [Swagger Doc](./src/api/docs/swagger.yaml) for Aggregator API endpoints
65+
66+
#### Aggregator API Configuration
67+
68+
In the `micro-frontends-earn-app` root directory create `.env` file with the next environment variables.
69+
70+
```bash
71+
# Auth0 config
72+
AUTH_SECRET=
73+
AUTH0_URL=
74+
AUTH0_AUDIENCE=
75+
AUTH0_CLIENT_ID=
76+
AUTH0_CLIENT_SECRET=
77+
```
78+
Once the earn app is started, the aggregator api will work as well

config/default.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require("dotenv").config();
12
module.exports = {
23
GUIKIT: {
34
DEBOUNCE_ON_CHANGE_TIME: 150,
@@ -9,5 +10,46 @@ module.exports = {
910
URL: {
1011
BASE: "https://www.topcoder-dev.com",
1112
COMMUNITY_APP: "https://community-app.topcoder-dev.com",
13+
PLATFORM_WEBSITE_URL: "https://platform.topcoder-dev.com",
1214
},
15+
RECRUIT_API: process.env.RECRUIT_API || "https://www.topcoder-dev.com",
16+
// the server api base path
17+
API_BASE_PATH: process.env.API_BASE_PATH || "/earn-app/api/my-gigs",
18+
// the log level, default is 'debug'
19+
LOG_LEVEL: process.env.LOG_LEVEL || "debug",
20+
// The authorization secret used during token verification.
21+
AUTH_SECRET:
22+
process.env.AUTH_SECRET ||
23+
"UgL4(SEAM*~yc7L~vWrKKN&GHrwyc9N[@nVxm,X?#b4}7:xbzM",
24+
// The valid issuer of tokens, a json array contains valid issuer.
25+
VALID_ISSUERS:
26+
process.env.VALID_ISSUERS ||
27+
'["https://api.topcoder-dev.com", "https://api.topcoder.com", "https://topcoder-dev.auth0.com/", "https://auth.topcoder-dev.com/"]',
28+
// Auth0 URL, used to get TC M2M token
29+
AUTH0_URL:
30+
process.env.AUTH0_URL || "https://topcoder-dev.auth0.com/oauth/token",
31+
// Auth0 audience, used to get TC M2M token
32+
AUTH0_AUDIENCE: process.env.AUTH0_AUDIENCE || "https://m2m.topcoder-dev.com/",
33+
// Auth0 client id, used to get TC M2M token
34+
AUTH0_CLIENT_ID:
35+
process.env.AUTH0_CLIENT_ID || "gZ6jt50HYHLBf4vhxjUhXPZOR7Q5lk4k",
36+
// Auth0 client secret, used to get TC M2M token
37+
AUTH0_CLIENT_SECRET:
38+
process.env.AUTH0_CLIENT_SECRET ||
39+
"zb-OV1Rl3QpUkt4BexJ-Rs58jYMazCre1_97aU4PJIvQdVB-DmQIs61W3gCfPyP4",
40+
// Proxy Auth0 URL, used to get TC M2M token
41+
AUTH0_PROXY_SERVER_URL: process.env.AUTH0_PROXY_SERVER_URL,
42+
m2m: {
43+
M2M_AUDIT_USER_ID:
44+
process.env.M2M_AUDIT_USER_ID || "00000000-0000-0000-0000-000000000000",
45+
M2M_AUDIT_HANDLE: process.env.M2M_AUDIT_HANDLE || "TopcoderService",
46+
},
47+
MOCK_API_PORT: process.env.MOCK_API_PORT || 4000,
48+
ALLOWED_FILE_TYPES: process.env.ALLOWED_FILE_TYPES || [
49+
"pdf",
50+
"doc",
51+
"docx",
52+
"txt",
53+
],
54+
MAX_ALLOWED_FILE_SIZE_MB: process.env.MAX_ALLOWED_FILE_SIZE_MB || 10,
1355
};

config/development.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ module.exports = {
99
URL: {
1010
BASE: "https://www.topcoder-dev.com",
1111
COMMUNITY_APP: "https://community-app.topcoder-dev.com",
12+
PLATFORM_WEBSITE_URL: "https://platform.topcoder-dev.com",
1213
},
1314
};

config/production.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ module.exports = {
99
URL: {
1010
BASE: "https://www.topcoder.com",
1111
COMMUNITY_APP: "https://community-app.topcoder.com",
12+
PLATFORM_WEBSITE_URL: "https://platform.topcoder.com",
1213
},
1314
};

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module.exports = {
33
transform: {
44
"^.+\\.(j|t)sx?$": "babel-jest",
55
},
6+
transformIgnorePatterns: ["node_modules/?!(react-dropzone)"],
67
moduleNameMapper: {
78
"\\.(css|scss)$": "identity-obj-proxy",
89
"\\.(png|eot|otf|ttf|woff|woff2|svg)$": "<rootDir>/__mocks__/fileMock.js",

0 commit comments

Comments
 (0)