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
+78
Original file line number
Diff line number
Diff line change
@@ -115,6 +115,84 @@ This script will load the data from `scripts/data` directory into ES
115
115
npm run start
116
116
```
117
117
118
+
### Local Deployment
119
+
0. Make sure to use Node v10+ by command `node -v`. We recommend using [NVM](https://github.com/nvm-sh/nvm) to quickly switch to the right version:
120
+
121
+
```bash
122
+
nvm use
123
+
```
124
+
125
+
1. 📦 Install npm dependencies
126
+
127
+
```bash
128
+
npm install
129
+
```
130
+
131
+
2. ⚙ Local config
132
+
In the `submissions-api` root directory create `.env` file with the next environment variables. Values for **Auth0 config** should be shared with you on the forum.<br>
133
+
```bash
134
+
# AWS related config
135
+
AWS_ACCESS_KEY_ID=
136
+
AWS_SECRET_ACCESS_KEY=
137
+
AWS_REGION=
138
+
S3_BUCKET=
139
+
ARTIFACT_BUCKET=
140
+
141
+
# Auth0 config
142
+
AUTH0_URL=
143
+
AUTH0_PROXY_SERVER_URL=
144
+
TOKEN_CACHE_TIME=
145
+
AUTH0_AUDIENCE=
146
+
AUTH0_CLIENT_ID=
147
+
AUTH0_CLIENT_SECRET=
148
+
149
+
# Locally deployed services (via docker-compose)
150
+
ES_HOST=localhost:9200
151
+
```
152
+
153
+
- Values from this file would be automatically used by many `npm` commands.
154
+
- ⚠️ Never commit this file or its copy to the repository!
155
+
156
+
3. 🚢 Start docker-compose with services which are required to start Topcoder Submissions API locally
157
+
158
+
```bash
159
+
npm run services:up
160
+
```
161
+
- `npm run services:down` can be used to shutdown the docker services
162
+
- `npm run services:logs` can be used to view the logs from the docker services
163
+
164
+
4. ♻ Create tables.
165
+
166
+
```bash
167
+
npm run create-tables
168
+
```
169
+
5. ♻ Create ES index.
170
+
171
+
```bash
172
+
npm run create-index
173
+
```
174
+
175
+
6. ♻ Init DB, ES
176
+
177
+
```bash
178
+
npm run local:init
179
+
```
180
+
181
+
This command will do 2 things:
182
+
- Import the data to the database and index it to ElasticSearch
183
+
- Note, to migrate the existing data from DynamoDB to ES, run the following script
184
+
```
185
+
npm run db-to-es
186
+
```
187
+
188
+
7. 🚀 Start Topcoder Submissions API
189
+
190
+
```bash
191
+
npm run start
192
+
```
193
+
The Topcoder Submissions API will be served on `http://localhost:3000`
0 commit comments