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.
Configuration for the application is at config/default.js and config/production.js. The following parameters can be set in config files or in env variables:
13
14
14
15
- LOG_LEVEL: the log level
15
16
- PORT: the server port
17
+
- CASCADE_PAUSE_MS: how many milliseconds to pause between deleting records during cascade delete (default to 1000)
16
18
- AUTH_SECRET: TC Authentication secret
17
19
- VALID_ISSUERS: valid issuers for TC authentication
18
20
- PAGE_SIZE: the default pagination limit
19
21
- MAX_PAGE_SIZE: the maximum pagination size
20
22
- API_VERSION: the API version
21
-
- AWS_ACCESS_KEY_ID: The AWS access key
22
-
- AWS_SECRET_ACCESS_KEY: The AWS secret key
23
-
- AWS_REGION: The Amazon region to use when connecting.
24
-
- DATABASE: The QLDB ledger name
23
+
- DB_NAME: the database name
24
+
- DB_USERNAME: the database username
25
+
- DB_PASSWORD: the database password
26
+
- DB_HOST: the database port
27
+
- DB_PORT: the database port
25
28
- AUTH0_URL: Auth0 URL, used to get TC M2M token
26
29
- AUTH0_AUDIENCE: Auth0 audience, used to get TC M2M token
27
30
- TOKEN_CACHE_TIME: Auth0 token cache time, used to get TC M2M token
@@ -57,26 +60,24 @@ For `ES.DOCUMENTS` configuration, you will find multiple other configurations be
57
60
58
61
Setup your Elasticsearch instance and ensure that it is up and running.
59
62
60
-
1. Visit [this link](https://console.aws.amazon.com/qldb/home?region=us-east-1#gettingStarted), login and create one **ledger** databases named `ubahn-db`
61
-
2. Visit [this link](https://console.aws.amazon.com/iam/home?region=us-east-1#/security_credentials) to download your "Access keys"
62
-
3. Follow *Configuration* section to update config values, like database, aws key/secret etc ..
63
-
4. Goto *UBahn-api*, run `npm i` and `npm run lint`
64
-
5. Import mock data, `node scripts/db/genData.js`, this will create tables and gen some data for test (if you need this)
65
-
6. Startup server `node app.js` or `npm run start`
63
+
1. Follow *Configuration* section to update config values, like database, etc ..
64
+
2. Goto *UBahn-api*, run `npm i` and `npm run lint`
65
+
3. Import mock data, `node scripts/db/genData.js`, this will gen some data for test (if you need this)
66
+
4. Startup server `node app.js` or `npm run start`
66
67
67
68
## Working with mock data
68
69
69
-
You can use the scripts `npm run insert-data` (and `npm run delete-data`) to insert mock data (and delete mock data respectively). The data is inserted into QLDB and Elasticsearch. You need to setup the configurations beforehand and also start the elasticsearch instance before you run these scripts
70
+
You can use the scripts `npm run insert-data` (and `npm run delete-data`) to insert mock data (and delete mock data respectively). The data is inserted into Postgres and Elasticsearch. You need to setup the configurations beforehand and also start the elasticsearch instance before you run these scripts. You can run the script `npm run migrate-db-to-es` to dump data in db into es.
70
71
71
72
## Local Deployment with Docker
72
73
73
-
Make sure all config values are right(aws key and secret), and you can run on local successful, then run below commands
74
+
Make sure all config values are right, and you can run on local successfully, then run below commands
74
75
75
76
1. Navigate to the directory `docker`
76
77
77
-
2. Rename the file `sample.api.env` to `api.env`
78
+
2. Rename the file `sample.env` to `.env`
78
79
79
-
3. Set the required AUTH0 configurations, AWS credentials and ElasticSearch host in the file `api.env`
80
+
3. Set the required AUTH0 configurations, DB configurations and ElasticSearch host in the file `.env`
80
81
81
82
4. Once that is done, run the following command
82
83
@@ -86,128 +87,6 @@ Make sure all config values are right(aws key and secret), and you can run on lo
86
87
87
88
5. When you are running the application for the first time, It will take some time initially to download the image and install the dependencies
88
89
89
-
## API endpoints verification
90
-
91
-
1. open postman
92
-
2. import *docs/UBahn_API.postman_collection.json* , *UBahn_ENV.postman_environment.json* and then check endpoints
93
-
94
-
## Test token
95
-
96
-
you can use below token to test role and permissions
0 commit comments