@@ -20,11 +20,12 @@ docker run -d --name memberdb -p 5432:5432 \
2020After that, please set db URL environment variables:
2121``` bash
2222export DATABASE_URL=" postgresql://johndoe:mypassword@localhost:5432/memberdb"
23+ export SKILLS_DB_URL=" postgresql://johndoe:mypassword@localhost:5432/skillsdb"
2324```
2425
25- This variable is important since it's required by prisma .
26+ These variables are important since they're required by Prisma clients .
2627
27- If you want to do anything with database, this variable is necessary.
28+ If you want to do anything with database, these variables are necessary.
2829
2930## Database Scripts
3031
@@ -33,6 +34,7 @@ Before running db scripts, please make sure you have setup db and config db url
3334``` bash
3435# set db url values
3536export DATABASE_URL=" postgresql://johndoe:mypassword@localhost:5432/memberdb"
37+ export SKILLS_DB_URL=" postgresql://johndoe:mypassword@localhost:5432/skillsdb"
3638
3739# install dependencies
3840npm install
@@ -61,7 +63,7 @@ I have created a script to download data from dev environment and a script to lo
6163To use them, you should:
6264- Make sure you have started db.
6365- Check configs in ` src/scripts/config.js ` . Add some handle if you like.
64- - Open a terminal and navigate to codebase folder. Set ` DATABASE_URL ` above.
66+ - Open a terminal and navigate to codebase folder. Set ` DATABASE_URL ` and ` SKILLS_DB_URL ` above.
6567- Run ` npm install ` .
6668- Use ` node src/scripts/download.js ` to download profile data.
6769- Run ` npm run clear-db ` to clear db data first
@@ -86,7 +88,7 @@ The following parameters can be set in config files or in env variables:
8688- BUSAPI_URL: Bus API URL
8789- KAFKA_ERROR_TOPIC: Kafka error topic used by bus API wrapper
8890- GROUPS_API_URL: Groups API URL
89- - AMAZON.AWS_ACCESS_KEY_ID: The Amazon certificate key to use when connecting.
91+ - AMAZON.AWS_ACCESS_KEY_ID: The Amazon certificate key to use when connecting.
9092- AMAZON.AWS_SECRET_ACCESS_KEY: The Amazon certificate access key to use when connecting.
9193- AMAZON.AWS.SESSION_TOKEN: The user session token, used when developing locally against the TC dev AWS services
9294- AMAZON.AWS_REGION: The Amazon certificate region to use when connecting.
@@ -138,6 +140,8 @@ To make local development easier, I create a mock server at `mock`.
138140
139141You can start it with ` node mock/mock-api.js ` and it will listen to port ` 4000 `
140142
143+ This mock service will simulate request and responses for other APIs like auth0 and event bus API.
144+
141145## Local Configs
142146
143147Please run following commands to set necessary configs:
@@ -147,13 +151,11 @@ export AUTH0_URL="http://localhost:4000/v5/auth0"
147151export BUSAPI_URL=" http://localhost:4000/v5"
148152export AUTH0_CLIENT_ID=xyz
149153export AUTH0_CLIENT_SECRET=xyz
150- export LOOKER_API_BASE_URL=" http://localhost:4000/v5/looker"
151- export LOOKER_API_CLIENT_ID=xyz
152- export LOOKER_API_CLIENT_SECRET=xyz
153154export USERFLOW_PRIVATE_KEY=mysecret
155+ export GROUPS_API_URL=" http://localhost:4000/v5/groups"
154156```
155157
156- These commands will set auth0, event bus pi and looker api to local mock server.
158+ These commands will set auth0 and event bus api to local mock server.
157159
158160## Local Deployment
159161
@@ -167,12 +169,11 @@ These commands will set auth0, event bus pi and looker api to local mock server.
167169## Tests
168170
169171
170- Make sure you have followed above steps to
172+ Make sure you have followed above steps to
171173- setup db and config db url
172174- setup local mock api and set local configs
173175 - it will really call service and mock api
174176
175- Unit tests use ` aws-sdk-mock ` to mock S3 operations. So you can safely run tests without S3 configs.
176177
177178Then you can run:
178179``` bash
0 commit comments