-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d669043
Showing
22 changed files
with
16,962 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
BASIC_AUTH_INTERNAL_USERNAME=admin | ||
BASIC_AUTH_INTERNAL_PASSWORD=admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/node_modules/ | ||
.env | ||
.idea/ | ||
|
||
dist | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
############### Stage 1 ############### | ||
FROM node:16-alpine | ||
|
||
# Create build directory | ||
WORKDIR /usr/src/build | ||
|
||
# Install app dependencies | ||
# A wildcard is used to ensure both package.json AND package-lock.json are copied | ||
# where available (npm@5+) | ||
COPY package*.json ./ | ||
|
||
RUN npm ci | ||
|
||
# Bundle app source | ||
COPY . ./ | ||
|
||
RUN npm run build | ||
|
||
############### Stage 2 ############### | ||
|
||
FROM node:16-alpine | ||
|
||
# Create app directory | ||
WORKDIR /usr/src/app | ||
|
||
COPY package*.json ./ | ||
RUN npm ci --omit=dev --ignore-scripts | ||
|
||
# copy build file | ||
COPY --from=0 /usr/src/build/dist ./dist | ||
|
||
EXPOSE 8000 | ||
|
||
CMD [ "npm", "run", "start" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# decoder-service | ||
|
||
To run the server run and listen to new changes run | ||
`npm run dev` | ||
|
||
to build docker image run | ||
`docker build . --file Dockerfile --tag decoder-service:0.0.1` | ||
|
||
to run docker image | ||
`docker run -p 8001:8000 decoder-service:0.0.1` | ||
will be available under `http://localhost:8001` port can be changed in the previous command | ||
|
||
Project structure | ||
* routes - application routes | ||
* public - routes without protection | ||
* internal - routes with basic auth protection | ||
* config - middlewares, logger config, ... | ||
* models - DB models | ||
* services - business logic | ||
|
||
|
||
> **Warning** | ||
> | ||
> **Github action might fail** | ||
> | ||
> | ||
> We try to fetch contract service image from ECR which require token | ||
> the token is valid for 12 hours, and we will need to update it. | ||
> we have followup ticket to fix it for permanent solution but until then | ||
> we can generate new token by using this command and update it in the | ||
> Github secrets | ||
> | ||
> to get a new token run this command | ||
> ``aws ecr get-login-password --region us-east-1`` | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
presets: [ | ||
['@babel/preset-env', {targets: {node: 'current'}}], | ||
'@babel/preset-typescript', | ||
], | ||
exclude: /node_modules/, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: '3.7' | ||
services: | ||
mongodb_container: | ||
image: mongo:latest | ||
environment: | ||
MONGO_INITDB_ROOT_USERNAME: root | ||
MONGO_INITDB_ROOT_PASSWORD: rootpassword | ||
ports: | ||
- 27017:27017 | ||
volumes: | ||
- mongodb_data_container:/data/db | ||
|
||
volumes: | ||
mongodb_data_container: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
require('dotenv').config({path: `.env.test`}); | ||
|
||
|
||
module.exports = { | ||
"coveragePathIgnorePatterns": [ | ||
"/node_modules/" | ||
], | ||
// make sure that logs will appear only for failed tests | ||
reporters: [ | ||
'./test/resource/reporter.js', | ||
] | ||
} |
Oops, something went wrong.