Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit c8da5bf

Browse files
Implement api
1 parent 64d9ab8 commit c8da5bf

37 files changed

+4749
-1259
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
.idea
3+
**/.DS_Store
4+
docs
5+
.env
6+
coverage

.gitignore

Lines changed: 6 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,8 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
lerna-debug.log*
8-
9-
# Diagnostic reports (https://nodejs.org/api/report.html)
10-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11-
12-
# Runtime data
13-
pids
14-
*.pid
15-
*.seed
16-
*.pid.lock
17-
18-
# Directory for instrumented libs generated by jscoverage/JSCover
19-
lib-cov
20-
21-
# Coverage directory used by tools like istanbul
22-
coverage
23-
*.lcov
24-
25-
# nyc test coverage
1+
node_modules
2+
.idea
3+
**/.DS_Store
4+
upload
5+
scripts/generate
266
.nyc_output
27-
28-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29-
.grunt
30-
31-
# Bower dependency directory (https://bower.io/)
32-
bower_components
33-
34-
# node-waf configuration
35-
.lock-wscript
36-
37-
# Compiled binary addons (https://nodejs.org/api/addons.html)
38-
build/Release
39-
40-
# Dependency directories
41-
node_modules/
42-
jspm_packages/
43-
44-
# TypeScript v1 declaration files
45-
typings/
46-
47-
# TypeScript cache
48-
*.tsbuildinfo
49-
50-
# Optional npm cache directory
51-
.npm
52-
53-
# Optional eslint cache
54-
.eslintcache
55-
56-
# Microbundle cache
57-
.rpt2_cache/
58-
.rts2_cache_cjs/
59-
.rts2_cache_es/
60-
.rts2_cache_umd/
61-
62-
# Optional REPL history
63-
.node_repl_history
64-
65-
# Output of 'npm pack'
66-
*.tgz
67-
68-
# Yarn Integrity file
69-
.yarn-integrity
70-
71-
# dotenv environment variables file
727
.env
73-
.env.test
74-
75-
# parcel-bundler cache (https://parceljs.org/)
76-
.cache
77-
78-
# Next.js build output
79-
.next
80-
81-
# Nuxt.js build / generate output
82-
.nuxt
83-
dist
84-
85-
# Gatsby files
86-
.cache/
87-
# Comment in the public line in if your project uses Gatsby and *not* Next.js
88-
# https://nextjs.org/blog/next-9-1#public-directory-support
89-
# public
90-
91-
# vuepress build output
92-
.vuepress/dist
93-
94-
# Serverless directories
95-
.serverless/
96-
97-
# FuseBox cache
98-
.fusebox/
99-
100-
# DynamoDB Local files
101-
.dynamodb/
102-
103-
# TernJS port file
104-
.tern-port
8+
coverage

.swagger-codegen-ignore

Lines changed: 0 additions & 23 deletions
This file was deleted.

.swagger-codegen/VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

Procfile

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

100644100755
Lines changed: 48 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,48 @@
1-
# Swagger generated server
2-
3-
# u-bahn-search-ui-api
4-
Universal Identity Search UI API
5-
6-
7-
## Overview
8-
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub.
9-
10-
### Running the server
11-
To run the server, run:
12-
13-
```
14-
npm start
15-
```
16-
17-
To view the Swagger UI interface:
18-
19-
```
20-
open http://localhost:8080/docs
21-
```
22-
23-
This project leverages the mega-awesome [swagger-tools](https://github.com/apigee-127/swagger-tools) middleware which does most all the work.
1+
# UBahn Search UI API
2+
3+
## Install software
4+
5+
- node 12.x
6+
- npm 6.x
7+
- docker
8+
- S3
9+
10+
## Local database deployment
11+
12+
1. Navigate to docker-db run `docker-compose up -d`
13+
2. Follow *Configuration* section to update config values
14+
3. Run `npm i` and `npm run lint`
15+
4. Create table, `npm run create-tables`, this will create tables (if you need this)
16+
5. Startup server `npm run start`
17+
18+
## Configuration
19+
20+
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:
21+
22+
- LOG_LEVEL: the log level
23+
- PORT: the server port
24+
- API_VERSION: the API version
25+
- AUTH_SECRET: TC Authentication secret
26+
- VALID_ISSUERS: valid issuers for TC authentication
27+
- AMAZON.AWS_REGION: The Amazon region to use when connecting. For local dynamodb you can set fake value.
28+
- AMAZON.IS_LOCAL_DB: Use local or AWS Amazon DynamoDB
29+
- AMAZON.DYNAMODB_URL: The local url, if using local Amazon DynamoDB
30+
- AMAZON.DYNAMODB_READ_CAPACITY_UNITS: the AWS DynamoDB read capacity units, if using local Amazon DynamoDB
31+
- AMAZON.DYNAMODB_WRITE_CAPACITY_UNITS: the AWS DynamoDB write capacity units, if using local Amazon DynamoDB
32+
- AMAZON.DYNAMODB_UPLOAD_TABLE: DynamoDB table name for upload
33+
- AMAZON.DYNAMODB_TEMPLATE_TABLE: DynamoDB table name for template
34+
- AUTH0_URL: Auth0 URL, used to get TC M2M token
35+
- AUTH0_AUDIENCE: Auth0 audience, used to get TC M2M token
36+
- TOKEN_CACHE_TIME: Auth0 token cache time, used to get TC M2M token
37+
- AUTH0_CLIENT_ID: Auth0 client id, used to get TC M2M token
38+
- AUTH0_CLIENT_SECRET: Auth0 client secret, used to get TC M2M token
39+
- AUTH0_PROXY_SERVER_URL: Proxy Auth0 URL, used to get TC M2M token
40+
- BUSAPI_URL: the bus api, default value is `https://api.topcoder-dev.com/v5`
41+
- KAFKA_ERROR_TOPIC: Kafka error topic, default value is 'common.error.reporting'
42+
- KAFKA_MESSAGE_ORIGINATOR: the Kafka message originator, default value is 'ubahn-search-ui-api'
43+
- UPLOAD_CREATE_TOPIC: the upload create Kafka topic, default value is 'ubahn.action.create'
44+
- TEMPLATE_FILE_MAX_SIZE: the template file restrict size, default value is '2MB'
45+
- TEMPLATE_FILE_MIMETYPE: the template file accept type, default value is 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
46+
- TEMPLATE_S3_BUCKET: the template s3 bucket name, default value is 'ubahn'
47+
- UPLOAD_S3_BUCKET: the upload s3 bucket name, default value is 'ubahn'
48+
- S3_OBJECT_URL_EXPIRY_TIME: the s3 url expiry time, default value is '1 hour'

0 commit comments

Comments
 (0)