diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 2cfa3149c..000000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.circleci/config.yml b/.circleci/config.yml index 3a02620bd..3c2021bd3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,20 +5,20 @@ jobs: checkout: working_directory: ~/nest-boilerplate docker: - - image: cimg/node:16.18.1-browsers + - image: cimg/node:20.12.2-browsers steps: - checkout - save_cache: - key: v0-src-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} + key: v1-src-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} paths: - ~/nest-boilerplate dependencies: working_directory: ~/nest-boilerplate docker: - - image: cimg/node:16.18.1-browsers + - image: cimg/node:20.12.2-browsers steps: - restore_cache: - key: v0-src-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} + key: v1-src-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} - restore_cache: key: v0-node-modules-{{ .Branch }}-{{ checksum "package.json" }} - run: @@ -31,10 +31,10 @@ jobs: lint: working_directory: ~/nest-boilerplate docker: - - image: cimg/node:16.18.1-browsers + - image: cimg/node:20.12.2-browsers steps: - restore_cache: - key: v0-src-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} + key: v1-src-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} - restore_cache: key: v0-node-modules-{{ .Branch }}-{{ checksum "package.json" }} - run: @@ -46,10 +46,10 @@ jobs: unit_test: working_directory: ~/nest-boilerplate docker: - - image: cimg/node:16.18.1-browsers + - image: cimg/node:20.12.2-browsers steps: - restore_cache: - key: v0-src-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} + key: v1-src-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} - restore_cache: key: v0-node-modules-{{ .Branch }}-{{ checksum "package.json" }} - run: @@ -58,7 +58,7 @@ jobs: integration_test: working_directory: ~/nest-boilerplate docker: - - image: cimg/node:16.18.1-browsers + - image: cimg/node:20.12.2-browsers - image: cimg/postgres:14.6 environment: POSTGRES_HOST: localhost @@ -68,12 +68,12 @@ jobs: POSTGRES_DB: postgres steps: - restore_cache: - key: v0-src-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} + key: v1-src-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} - restore_cache: key: v0-node-modules-{{ .Branch }}-{{ checksum "package.json" }} - run: name: Copy .env - command: cp .env.example .env + command: cp .env.example .env && source .env - run: name: Wait for Postgres to start command: dockerize -wait tcp://localhost:5432 -timeout 1m @@ -87,16 +87,19 @@ jobs: name: Run start background: true command: npm run start + - run: + name: Wait port + command: sleep 20 && node test/wait-on.js - run: name: Integration E2E test - command: npx wait-on http://localhost:3000 & npm run test:e2e + command: npx wait-on http://localhost:3000 --delay=10000 & npm run test:e2e build: working_directory: ~/nest-boilerplate docker: - - image: cimg/node:16.18.1-browsers + - image: cimg/node:20.12.2-browsers steps: - restore_cache: - key: v0-src-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} + key: v1-src-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} - restore_cache: key: v0-node-modules-{{ .Branch }}-{{ checksum "package.json" }} - run: @@ -110,10 +113,10 @@ jobs: working_directory: ~/nest-boilerplate executor: aws-cli/default docker: - - image: cimg/node:16.18.1-browsers + - image: cimg/node:20.12.2-browsers steps: - restore_cache: - key: v0-src-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} + key: v1-src-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} - restore_cache: key: v0-node-modules-{{ .Branch }}-{{ checksum "package.json" }} - restore_cache: @@ -127,16 +130,16 @@ jobs: command: npm run build:infra - run: name: Diff - command: npx cdk diff --all + command: npx cdk diff --all > diff.txt && cat diff.txt deployment: working_directory: ~/nest-boilerplate executor: aws-cli/default docker: - - image: cimg/node:16.18.1-browsers + - image: cimg/node:20.12.2-browsers steps: - restore_cache: - key: v0-src-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} + key: v1-src-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }} - restore_cache: key: v0-node-modules-{{ .Branch }}-{{ checksum "package.json" }} - restore_cache: @@ -171,48 +174,48 @@ workflows: - build: requires: - dependencies - - diff: - name: diff_to_development - context: development - requires: - - build - - integration_test - - unit_test - - diff: - name: diff_to_production - context: production - filters: - tags: - only: /^v.*/ - branches: - ignore: /.*/ - requires: - - build - - integration_test - - unit_test - - approve_deploy_to_development: - type: approval - context: development - filters: - branches: - only: - - master - - main - - develop - requires: - - diff_to_development - - approve_deploy_to_production: - type: approval - context: production - requires: - - diff_to_production - - deployment: - name: deployment_to_development - context: development - requires: - - approve_deploy_to_development - - deployment: - name: deployment_to_production - context: production - requires: - - approve_deploy_to_production \ No newline at end of file + # - diff: + # name: diff_to_development + # context: development + # requires: + # - build + # - integration_test + # - unit_test + # - diff: + # name: diff_to_production + # context: production + # filters: + # tags: + # only: /^v.*/ + # branches: + # ignore: /.*/ + # requires: + # - build + # - integration_test + # - unit_test + # - approve_deploy_to_development: + # type: approval + # context: development + # filters: + # branches: + # only: + # - master + # - main + # - develop + # requires: + # - diff_to_development + # - approve_deploy_to_production: + # type: approval + # context: production + # requires: + # - diff_to_production + # - deployment: + # name: deployment_to_development + # context: development + # requires: + # - approve_deploy_to_development + # - deployment: + # name: deployment_to_production + # context: production + # requires: + # - approve_deploy_to_production \ No newline at end of file diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..19dbfd591 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +/.data +/dist +/documentation +.env \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index ead57c7db..259de13c7 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,7 +2,7 @@ module.exports = { parser: '@typescript-eslint/parser', parserOptions: { project: 'tsconfig.json', - tsconfigRootDir : __dirname, + tsconfigRootDir: __dirname, sourceType: 'module', }, plugins: ['@typescript-eslint/eslint-plugin'], @@ -22,4 +22,4 @@ module.exports = { '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/no-explicit-any': 'off', }, -}; \ No newline at end of file +}; diff --git a/.gitignore b/.gitignore index 65aec6ae9..c2dde4bcc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # compiled output /dist /node_modules +/build # Logs logs @@ -27,6 +28,13 @@ lerna-debug.log* .settings/ *.sublime-workspace +# infra outputs +cdk.out/* +cdk.context.json + +# compodoc +documentation/* + # IDE - VSCode .vscode/* !.vscode/settings.json @@ -34,13 +42,22 @@ lerna-debug.log* !.vscode/launch.json !.vscode/extensions.json -# infra outputs -cdk.out/* - -# documentatin dist -documentation - -.data -/files +# dotenv environment variable files .env -/ormconfig.json \ No newline at end of file +.env.development.local +.env.test.local +.env.production.local +.env.local + +# temp directory +.temp +.tmp + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..3be886795 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "CodeGPT.apiKey": "OpenAI" +} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..a212dd24c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,107 @@ +### Commit Message Format + +Each commit message consists of a **header**, a **body** and a **footer**. The header has a special +format that includes a **type**, a **scope** and a **subject**: + +``` +(): + + + +