Skip to content

Commit c328858

Browse files
committed
Initial public release
1 parent 615cf6d commit c328858

File tree

86 files changed

+20090
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+20090
-0
lines changed

.env.default

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# app
2+
DATABASE_URL=mysql://root:rootpass@localhost:3306/service_db
3+
APP_PORT=3000
4+
APP_BIND_ADDRESS=0.0.0.0
5+
APP_ENV=development
6+
PASSWORD_SALT=frefre74879
7+
LOG_LEVEL=info
8+
SAMPLE_FAKE_STORE_BASE_URL=https://fakestoreapi.com
9+
JWT_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----||MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAzi4k4ful8Q65RWbHvZwD||jKNfspb89typkUATf8KXlYcWp6ibUG9nKpYrig3jmlCdMvCm+S7kZedACshFyRmm||1ocaWjRIt/jJyzntxnMIgWetTedZXXzlFbparDMrdEMmsPbM7LrByCU57iKloZEl||BhOSQZk/JbJK1YpozTCxcs28YlpnTuMBaXvXddrQuNHo+HYhK53XlFXyiOBzmEFY||cBrVqptdjA3z7uNNd6A4IAfEkRYp4lZxZgwTPyjYZ1oXmhalvbr6OAs9ujLIZPSM||QoP1VoHLdOqrs7QTmi2rrNCfIcFkFp02N39TovMm9zZQJjQvFEJqIKe4db2457vr||uJ5qxkWmbBu+/tf6ytKfbiA433neLSvpfquPXbq3OLGzJ4H2YHiHa0ddfUCqdN49||t5nCPEMp6OTa5kXuwObf8yvHyoP8HgQQD+/sftHUIE/1sdQ6fzB/9L+smzp5SW/X||nI8NY0k1SH9MLlweGuXi6M1jS62kPWk4HTDQmiqUTImcG0XYRrVd5ISXPdfnVgnq||KKht+SUmkPrfaWMDc21FsXXmmVSRTjvBhA6Cy6PLPzGZaeA4TVkOZUkp1OvcyfiI||HixuZca1OASxGeUM8lcPi9my8TJCtw5ZR0M/uqVV/1o3U0nx+U5z54ulWN9leMLY||vgv+lGrqfFWRemajGXSm8L0CAwEAAQ==||-----END PUBLIC KEY-----"
10+
11+
# redis
12+
REDIS_HOST=localhost
13+
REDIS_DB=0
14+
REDIS_PORT=6379
15+
REDIS_USERNAME=
16+
REDIS_PASSWORD=sOmE_sEcUrE_pAsS
17+
REDIS_USE_TLS=false
18+
SCHEDULER_REDIS_HOST=localhost
19+
SCHEDULER_REDIS_DB=1
20+
SCHEDULER_REDIS_PORT=6379
21+
SCHEDULER_REDIS_USERNAME=
22+
SCHEDULER_REDIS_PASSWORD=sOmE_sEcUrE_pAsS
23+
SCHEDULER_REDIS_USE_TLS=false
24+
25+
# jobs
26+
27+
DELETE_OLD_USERS_JOB_PERIOD_IN_SECS=60000
28+
PROCESS_LOGS_FILES_JOB_PERIOD_IN_SECS=6000
29+
SEND_EMAILS_JOB_CRON="0 * * * *"
30+
31+
# new relic
32+
NEW_RELIC_LICENSE_KEY=
33+
NEW_RELIC_APP_NAME=prod.yourapp.yourdomain.com
34+
NEW_RELIC_ENABLED=false
35+
36+
# bugsnag
37+
BUGSNAG_KEY=
38+
BUGSNAG_ENABLED=false

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
coverage/
3+
dist/

.eslintrc.json

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": {
4+
"ecmaVersion": 2022,
5+
"sourceType": "module",
6+
"project": "./tsconfig.json"
7+
},
8+
"ignorePatterns": ["node_modules"],
9+
"plugins": ["@typescript-eslint", "prettier", "jest", "import"],
10+
"extends": [
11+
"eslint:recommended",
12+
"plugin:@typescript-eslint/recommended",
13+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
14+
"plugin:prettier/recommended",
15+
"plugin:jest/recommended",
16+
"plugin:jest/style",
17+
"plugin:import/recommended",
18+
"plugin:import/typescript"
19+
],
20+
"rules": {
21+
"prettier/prettier": "error",
22+
"@typescript-eslint/no-empty-interface": "warn",
23+
"@typescript-eslint/ban-ts-comment": "off",
24+
"@typescript-eslint/no-use-before-define": "off",
25+
"@typescript-eslint/no-non-null-assertion": "warn",
26+
"@typescript-eslint/no-var-requires": "off",
27+
"@typescript-eslint/indent": "off",
28+
"@typescript-eslint/no-explicit-any": "warn",
29+
"@typescript-eslint/no-unsafe-member-access": "warn",
30+
"@typescript-eslint/explicit-function-return-type": "off",
31+
"@typescript-eslint/consistent-type-imports": "warn",
32+
"@typescript-eslint/no-unused-vars": [
33+
"warn", // or "error"
34+
{
35+
"argsIgnorePattern": "^_",
36+
"varsIgnorePattern": "^_",
37+
"caughtErrorsIgnorePattern": "^_"
38+
}
39+
],
40+
"@typescript-eslint/member-delimiter-style": [
41+
"error",
42+
{
43+
"multiline": {
44+
"delimiter": "none",
45+
"requireLast": false
46+
},
47+
"singleline": {
48+
"delimiter": "comma",
49+
"requireLast": false
50+
}
51+
}
52+
],
53+
"import/order": [
54+
"warn",
55+
{
56+
"alphabetize": { "order": "asc" },
57+
"newlines-between": "always"
58+
}
59+
]
60+
},
61+
"overrides": [
62+
{
63+
"files": ["*.test.ts", "*.spec.ts"],
64+
"rules": {
65+
"@typescript-eslint/no-non-null-assertion": "off"
66+
}
67+
}
68+
]
69+
}

.github/dependabot.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: 'github-actions'
4+
directory: '/'
5+
schedule:
6+
interval: 'monthly'
7+
open-pull-requests-limit: 10
8+
9+
- package-ecosystem: 'npm'
10+
directory: '/'
11+
schedule:
12+
interval: 'weekly'
13+
open-pull-requests-limit: 10
14+
ignore:
15+
- dependency-name: '@typescript-eslint/eslint-plugin'
16+
- dependency-name: '@typescript-eslint/parser'
17+
- dependency-name: '@types/node'

.github/workflows/ci.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: ci
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v3
12+
13+
- name: Setup Node.js
14+
uses: actions/setup-node@v3
15+
with:
16+
node-version: 18.x
17+
18+
- name: Install
19+
run: |
20+
npm install --ignore-scripts
21+
npx prisma generate
22+
23+
- name: DB start
24+
run: |
25+
docker compose up waitmysql
26+
docker compose up -d redis
27+
28+
- name: Build TS
29+
run: |
30+
npm run build
31+
32+
- name: Schema preparation
33+
run: |
34+
npm run copy:config
35+
npm run db:migration:run
36+
37+
- name: Generate client
38+
run: |
39+
npm run db:update-client
40+
41+
- name: Run Tests
42+
run: |
43+
npm run test:ci
44+
45+
- name: DB stop
46+
run: |
47+
docker compose down
48+
49+
- name: Generate and validate OpenAPI schema
50+
run: |
51+
npm run spec:generate
52+
53+
automerge:
54+
needs: build
55+
runs-on: ubuntu-latest
56+
permissions:
57+
pull-requests: write
58+
contents: write
59+
steps:
60+
- uses: fastify/github-action-merge-dependabot@v3
61+
with:
62+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/linting.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: linting
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
name: linting
16+
17+
steps:
18+
- name: Checkout Repository
19+
uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 1
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v3
25+
with:
26+
always-auth: false
27+
node-version: 18.x
28+
29+
- name: Install
30+
run: |
31+
npm install --ignore-scripts
32+
npx prisma generate
33+
34+
- name: Run lint
35+
run: npm run lint

.gitignore

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
*.pid.lock
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# nyc test coverage
21+
.nyc_output
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# Bower dependency directory (https://bower.io/)
27+
bower_components
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (https://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# TypeScript v1 declaration files
40+
typings/
41+
42+
# Optional npm cache directory
43+
.npm
44+
45+
# Optional eslint cache
46+
.eslintcache
47+
48+
# Optional REPL history
49+
.node_repl_history
50+
51+
# Output of 'npm pack'
52+
*.tgz
53+
54+
# Yarn Integrity file
55+
.yarn-integrity
56+
57+
# dotenv environment variables file
58+
.env
59+
60+
# next.js build output
61+
.next
62+
/dist/
63+
/.idea/
64+
/.fleet/
65+
/serviceSpec.yaml

.npmignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.idea/
2+
.npmignore
3+
node_modules/
4+
README.md
5+
test/
6+
.nyc_output/
7+
coverage/
8+
lib/
9+
jest.config.json
10+
package-lock.json
11+
tsconfig.json
12+
.eslintrc.json

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
coverage

.prettierrc.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"printWidth": 100,
3+
"singleQuote": true,
4+
"bracketSpacing": true,
5+
"semi": false,
6+
"arrowParens": "always",
7+
"endOfLine": "lf",
8+
"trailingComma": "all"
9+
}

CODEOWNERS

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.yml @kibertoad @rupert-mckay @lokankr @drdaemos @andris-sevcenko @ForterLokalise
2+
*.md @kibertoad @rupert-mckay @lokankr @drdaemos @andris-sevcenko @ForterLokalise
3+
*.ts @kibertoad @rupert-mckay @lokankr @drdaemos @andris-sevcenko @ForterLokalise
4+
package.json @kibertoad @rupert-mckay @lokankr @drdaemos @andris-sevcenko @ForterLokalise

0 commit comments

Comments
 (0)