Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
a6023a2
Add EUA Nodejs service
Jun 15, 2021
6f9a755
Add pre-commit hook to check for linting, boilerplate code for search…
Jun 15, 2021
73e77d6
Added initial jwt auth
Jun 15, 2021
44d8c3e
Merge branch 'feature/eua-service' of github.com:Swasth-Digital-Healt…
Jun 15, 2021
63463f4
merged with search changes
Jun 15, 2021
850de7c
Removing useless pre-commit package
Jun 15, 2021
fd93edd
Refactoring jwt auth
Jun 15, 2021
279da8b
Merge branch 'feature/eua-service' of github.com:Swasth-Digital-Healt…
Jun 15, 2021
f2f7ef9
Updates for search controller to call the gateway broker
Jun 15, 2021
3fa23b5
Adding a verification middleware
Jun 16, 2021
c19a960
Fix JWT token expiry & others
nithindv Jun 16, 2021
6a5ddf7
Add apitoken verification for on_update endpoint
Jun 16, 2021
64fa3be
Refactored api calls into services
Jun 16, 2021
653cd8d
Add Jest testing setup for eua-service
Jun 17, 2021
c3cff27
Add .vscode to gitignore
Jun 17, 2021
620436a
Tests for search service
Jun 17, 2021
338acd2
Tests for services
Jun 17, 2021
6c4428d
Add custom error class for failure handling
Jun 18, 2021
6fc2d47
Slight change to error handling for the search endpoint
Jun 18, 2021
08d8332
Update Dockerfile
nithindv Jun 21, 2021
6f1708f
Resolving build issues
Jun 21, 2021
5fa4be2
Merge branch 'feature/eua-service' of github.com:Swasth-Digital-Healt…
Jun 21, 2021
9dade30
Changed timeout settings
Jun 21, 2021
54827b1
Add request body validation for search endpoint
Jun 21, 2021
51faf72
Tests for controllers
Jun 22, 2021
46410c4
Renamed test for onupdate
Jun 22, 2021
33215e9
Added tests for update controller
Jun 23, 2021
53371a8
Add EUA Nodejs service
Jun 15, 2021
484185c
Added initial jwt auth
Jun 15, 2021
7d69a05
Add pre-commit hook to check for linting, boilerplate code for search…
Jun 15, 2021
c754bf5
merged with search changes
Jun 15, 2021
e7be071
Refactoring jwt auth
Jun 15, 2021
948f5ff
Removing useless pre-commit package
Jun 15, 2021
f93563f
Updates for search controller to call the gateway broker
Jun 15, 2021
7848c09
Adding a verification middleware
Jun 16, 2021
8b9f62f
Fix JWT token expiry & others
nithindv Jun 16, 2021
7af34c3
Add apitoken verification for on_update endpoint
Jun 16, 2021
85f44e6
Refactored api calls into services
Jun 16, 2021
cbbba53
Add Jest testing setup for eua-service
Jun 17, 2021
d8fead0
Add .vscode to gitignore
Jun 17, 2021
7b4871d
Tests for search service
Jun 17, 2021
23f7f8b
Tests for services
Jun 17, 2021
fed9ab9
Add custom error class for failure handling
Jun 18, 2021
77bafba
Slight change to error handling for the search endpoint
Jun 18, 2021
33bd0e1
Resolving build issues
Jun 21, 2021
74e009e
Update Dockerfile
nithindv Jun 21, 2021
f04fd2b
Changed timeout settings
Jun 21, 2021
36922ec
Add request body validation for search endpoint
Jun 21, 2021
cad16ee
Tests for controllers
Jun 22, 2021
97e8270
Renamed test for onupdate
Jun 22, 2021
65e7eab
Added tests for update controller
Jun 23, 2021
2923d57
Merge branch 'feature/eua-service' of github.com:Swasth-Digital-Healt…
Jun 23, 2021
e11efab
Add README
Jun 24, 2021
f2abcc6
Update README
Jun 24, 2021
c9ee75f
Update README
Jun 24, 2021
b7af145
Update README
Jun 24, 2021
f85c51a
Merge branch 'feature/eua-service' of github.com:Swasth-Digital-Healt…
Jun 24, 2021
072f83d
Added comments
Jun 24, 2021
ab91a5f
Modify error handling and remove middleware
nithindv Jul 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions eua-service/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.history
build
.vscode
node_modules
log
.eslintignore
.eslintrc
.gitignore
11 changes: 11 additions & 0 deletions eua-service/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# /node_modules/* in the project root is ignored by default
# build artefacts
dist/*
build/
coverage/*
# data definition files
**/*.d.ts
# 3rd party libs
/src/public/
# custom definition files
/src/types/
39 changes: 39 additions & 0 deletions eua-service/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"plugin:@typescript-eslint/recommended",
"eslint:recommended"
],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"rules": {
"semi": "off",
"quotes": [
"error",
"single"
],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": 1,
"@typescript-eslint/no-inferrable-types": [
"warn",
{
"ignoreParameters": true
}
],
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/semi": [
"error"
],
"indent": [
"error",
2
],
"prefer-template": "error"
},
"env": {
"node": true,
"jest": true
}
}
7 changes: 7 additions & 0 deletions eua-service/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/
.vscode/
build/
log/
coverage/

env.*
20 changes: 20 additions & 0 deletions eua-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM node:14-alpine

#var
RUN apk --update --no-cache add g++ make python tzdata bash curl
# Create app directory
WORKDIR /local/services/eua-service

COPY package.json package-lock.json ./

RUN npm install --silent

# copy app dependencies
COPY . .

RUN cd /local/services/eua-service \
&& npm run build \
&& apk del g++ make python tzdata bash curl
EXPOSE 3000

CMD ["sh", "-c", "node build/app.js"]
33 changes: 33 additions & 0 deletions eua-service/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# EUA Service

Contract / Example service for an end user backend application.

## Setup local environment

### Initial setup

Install the dependencies of this project when setting it up initially using -

`npm i`

### Environment variables

`env.dev` file is needed in the root directory of this service to set the environment variables.
The variables that the service is expecting can be found in [this file](src/utils/secrets.ts).

## Run the service

Run the service using the following command -

`npm run start-dev`

## Run tests

`npm run test`

## Linting checks

The following command will check for linting errors in your code and try to fix the issues automatically.
The errors that are not fixed automatically will be displayed.

`npm run lint`
15 changes: 15 additions & 0 deletions eua-service/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const config = {
verbose: true,
preset: 'ts-jest',
collectCoverage: true,
collectCoverageFrom: [
'**/**/*.ts',
'**/*.ts',
'!jest.config.ts',
'!**/node_modules/**',
'!**/build/**',

]
};

export default config;
10 changes: 10 additions & 0 deletions eua-service/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"watch": [
"src"
],
"ext": "ts",
"ignore": [
"src/public"
],
"exec": "ts-node src/app.ts"
}
Loading