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
Copy file name to clipboardExpand all lines: README.md
+45-15Lines changed: 45 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -4,20 +4,23 @@ Microservice to manage CRUD operations for all things Projects.
4
4
5
5
**Note : Steps mentioned below are best to our capability as guide for local deployment, however, we expect from contributor, being a developer, to resolve run-time issues (e.g. OS and node version issues etc), if any.**
-[Export database to json file](#export-database-to-json-file)
12
+
-[Import database from json file, and index it](#import-database-from-json-file-and-index-it)
13
+
-[Import sample metadata projects(Using projects service apis)](#import-sample-metadata-projectsusing-projects-service-apis)
14
+
-[Run Connect App with Project Service locally](#run-connect-app-with-project-service-locally)
15
+
-[Test](#test)
16
+
-[JWT Authentication](#jwt-authentication)
17
+
-[Deploying with docker (might need updates)](#deploying-with-docker-might-need-updates)
18
+
-[Kafka commands](#kafka-commands)
19
+
-[Create Topic](#create-topic)
20
+
-[List Topics](#list-topics)
21
+
-[Watch Topic](#watch-topic)
22
+
-[Post Message to Topic (from stdin)](#post-message-to-topic-from-stdin)
23
+
-[References](#references)
21
24
22
25
## Local Development
23
26
@@ -180,7 +183,34 @@ Local setup should work good on **Linux** and **macOS**. But **Windows** is not
180
183
npm run startKafkaConsumers:dev
181
184
```
182
185
183
-
### Import sample metadata projects
186
+
### Export database to json file
187
+
188
+
To export data of certain models from database to json file.
189
+
190
+
`npm run data:export -- --file path/to-file.json`
191
+
192
+
List of models that will be exported is defined in `scripts/data/dataModels.js`. You can add new models to this list,
193
+
but make sure that new models are added to list such that each model comes after its dependencies.
194
+
195
+
When we run `npm run data:export` without specifying json file , data will be exported to `data/demo-data.json`.
196
+
197
+
### Import database from json file, and index it
198
+
199
+
To import data of certain models from file to database, and create ES indices.
200
+
201
+
`npm run data:import -- --file path/to-file.json`
202
+
203
+
List of models that will be imported is defined in `scripts/data/dataModels.js`. You can add new models to this list,
204
+
but make sure that new models are added to list such that each model comes after its dependencies.
205
+
206
+
When we run `npm run data:import` without specifying json file , data will be imported from `data/demo-data.json`.
207
+
There is sample file located at `data/demo-data.json` that can used to import and index sample data.
208
+
209
+
Because this commands calls topcoder services to get data like members details, so you have to set environment variables AUTH0_CLIENT_ID, AUTH0_CLIENT_SECRET, AUTH0_URL, AUTH0_AUDIENCE, AUTH0_PROXY_SERVER_URL
210
+
211
+
If you encounter conflicts errors, you may need to clear database using `npm run sync:db`, and clear ES (Elasticsearch) indices using `NODE_ENV=development npm run sync:es`
212
+
213
+
### Import sample metadata projects(Using projects service apis)
184
214
185
215
```bash
186
216
CONNECT_USER_TOKEN=<connect user token> npm run demo-data
0 commit comments