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
+53-2Lines changed: 53 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,6 @@
3
3
## Dependencies
4
4
5
5
- nodejs (v10)
6
-
- Kafka (v2)
7
6
- Mongodb (v4)
8
7
9
8
## Configuration
@@ -14,6 +13,15 @@ The following parameters can be set in config files or in env variables:
14
13
- LOG_LEVEL: the log level
15
14
- PORT: the server port
16
15
- MONGODB_URL: Mongo DB URL
16
+
- CHALLENGE_API_URL: the Topcoder challenge API URL
17
+
- MEMBER_API_URL: the Topcoder member API URL
18
+
- GROUP_IDS: the valid group ids
19
+
- AUTH0_URL: Auth0 URL, used to get TC M2M token
20
+
- AUTH0_AUDIENCE: Auth0 audience, used to get TC M2M token
21
+
- TOKEN_CACHE_TIME: Auth0 token cache time, used to get TC M2M token
22
+
- AUTH0_CLIENT_ID: Auth0 client id, used to get TC M2M token
23
+
- AUTH0_CLIENT_SECRET: Auth0 client secret, used to get TC M2M token
24
+
- AUTH0_PROXY_SERVER_URL: Proxy Auth0 URL, used to get TC M2M token
17
25
18
26
## Local deployment
19
27
@@ -31,12 +39,23 @@ npm run lint
31
39
npm run lint:fix # To fix possible lint errors
32
40
```
33
41
42
+
- Clear and Insert data into database
43
+
44
+
```bash
45
+
npm run init-db
46
+
47
+
npm run test-data
48
+
```
49
+
34
50
- Start the express server
35
51
36
52
```bash
37
53
npm start
38
54
```
39
55
56
+
## Mock API
57
+
For verification purpose, we need a mock app for Topcoder Challenge API and Topcoder Member API. You can run command `npm run mock-api` to start the mock app.
58
+
40
59
## Heroku Deployment
41
60
42
61
- git init
@@ -48,4 +67,36 @@ npm start
48
67
49
68
## Verification
50
69
51
-
- Import the collection and environment into your POSTMAN app and check out the endpoints
70
+
### Tests
71
+
72
+
- Run the following command to execute unit test and generate coverage report
73
+
74
+
```bash
75
+
npm run test
76
+
```
77
+
78
+
- Run the following command to execute e2e test and generate coverage report
79
+
80
+
```bash
81
+
npm run e2e
82
+
```
83
+
84
+
### Postman
85
+
86
+
- Start mock app and it will listen on 3001 PORT.
87
+
88
+
```bash
89
+
npm run mock-api
90
+
```
91
+
92
+
- Ensure you have start MongoDB and properly configure `MONGODB_URL`. Run the following commands to clear and insert test data, step up environment variables and start the app.
0 commit comments