Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[*]
charset=utf-8
end_of_line=lf
insert_final_newline=true
indent_style=space
indent_size=2
trim_trailing_whitespace=true

[{.babelrc,.prettierrc,.stylelintrc,.eslintrc,jest.config,*.json,*.jsb3,*.jsb2,*.bowerrc}]
indent_style=space
indent_size=2

[{tsconfig.app.json,tsconfig.spec.json,tsconfig.json,tsconfig.e2e.json}]
indent_style=space
indent_size=2

[*.js.map]
indent_style=space
indent_size=2
12 changes: 12 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Application back-end port
APP_PORT=XXXX

# Postgres DB credentials
DB_HOST=XXXX
DB_PORT=XXXX
DB_BASE=XXXX
DB_USER=XXXX
DB_PSWD=XXXX

# DB Extended port
DB_PORT_EXT=XXXX
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
data_volumes/
node_modules/
31 changes: 31 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = {
env: {
browser: true,
es6: true,
commonjs: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'prettier',
'prettier/@typescript-eslint',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
rules: {
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'require-atomic-updates': 'off',
'object-curly-spacing': ['warn', 'always'],
},
};
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Docker Data Files
data_volumes

# Runtime data
pids
*.pid
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/*
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 120,
"tabWidth": 2,
"bracketSpacing": true,
"useTabs": false
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"cSpell.words": [
"PSWD",
"Yevhenko",
"pino",
"typeorm"
]
}
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:12-alpine

WORKDIR /usr/src/app

COPY package*.json ./
RUN npm ci

COPY ./ ./
40 changes: 40 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: '3'
services:
service_finder:
container_name: service_finder
build:
context: .
dockerfile: Dockerfile
command: sh -c "npm run db:start && npm start"
env_file:
- .env
ports:
- ${APP_PORT}:${APP_PORT}
volumes:
- ./src:/usr/src/app/src
depends_on:
- postgres
links:
- postgres
networks:
- services_network
restart: always

postgres:
container_name: postgres
image: "postgres:9.6.1"
ports:
- ${DB_PORT_EXT}:5432
environment:
POSTGRES_USER: "admin"
POSTGRES_PASSWORD: "admin"
POSTGRES_DB: "admin"
volumes:
- ./data_volumes/postgres:/var/lib/postgresql/data
networks:
- services_network
restart: always

networks:
services_network:

24 changes: 24 additions & 0 deletions ormconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"type": "postgres",
"host": "postgres",
"port": 5432,
"username": "admin",
"password": "admin",
"database": "admin",
"synchronize": true,
"logging": false,
"entities": [
"src/db/entity/**/*.ts"
],
"migrations": [
"src/db/migration/**/*.ts"
],
"subscribers": [
"src/db/subscriber/**/*.ts"
],
"cli": {
"entitiesDir": "src/db/entity",
"migrationsDir": "src/db/migration",
"subscribersDir": "src/db/subscriber"
}
}
Loading