4
4
5
5
- nodejs https://nodejs.org/en/ (v12+)
6
6
- Postgres
7
+ - ElasticSearch (7.x)
7
8
8
9
## Configuration
9
10
@@ -15,27 +16,48 @@ The following parameters can be set in config files or in env variables:
15
16
- ` BASE_PATH ` : the server api base path
16
17
- ` AUTH_SECRET ` : The authorization secret used during token verification.
17
18
- ` VALID_ISSUERS ` : The valid issuer of tokens, a json array contains valid issuer.
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
18
25
- ` POSTGRES_URL ` : Postgres database url.
19
26
- ` DB_SCHEMA_NAME ` : string - postgres database target schema
20
27
- ` PROJECT_API_URL ` : the project service url
28
+ - ` TC_API ` : the topcoder v5 url
29
+ - ` ORG_ID ` : the organization id
30
+ - ` HOST ` : the elasticsearch host
31
+ - ` ES_INDEX_JOB ` : the job index
32
+ - ` ES_INDEX_JOB_CANDIDATE ` : the job candidate index
33
+ - ` ES_INDEX_RESOURCE_BOOKING ` : the resource booking index
21
34
22
35
23
36
## Postgres Database Setup
24
37
Go to https://www.postgresql.org/ download and install the Postgres.
25
38
Modify ` POSTGRES_URL ` under ` config/default.js ` to meet your environment.
26
39
Run ` npm run init-db ` to create table
27
40
41
+ ## ElasticSearch Setup
42
+ Go to https://www.elastic.co/downloads/ download and install the elasticsearch.
43
+ Modify ` esConfig ` under ` config/default.js ` to meet your environment.
44
+ Run ` npm run create-index ` to create ES index.
45
+ Run ` npm run delete-index ` to delete ES index.
46
+
28
47
## Local Deployment
29
48
30
49
- Install dependencies ` npm install `
31
50
- Run lint ` npm run lint `
32
51
- Run lint fix ` npm run lint:fix `
33
52
- Clear and init db ` npm run init-db `
53
+ - Clear and create es index ` npm run delete-index, npm run create-index `
34
54
- Start app ` npm start `
35
55
- App is running at ` http://localhost:3000 `
36
56
37
57
## Testing
38
- - Run mock-project-service app
58
+ - Run tools/mock-project-service app
59
+ - Run ` npm run init-db `
60
+ - Run ` npm run create-index `
39
61
- Run ` npm run test ` to execute unit tests
40
62
- Run ` npm run cov ` to execute unit tests and generate coverage report.
41
63
0 commit comments