Skip to content

Commit

Permalink
Refactor/v0.1.0 (#21)
Browse files Browse the repository at this point in the history
* feat(): security group generic structure + security

* fix(): package-lock

* fix(): removing comment

* fix(): lint

* ifx(): webpack link

* ifx(): webpack package

* fix(): missing sdk dependencies

* fix(): testing cli output fix

* refactor: refactor code and update dependencies and nodejs version

* cicd: change pipeline nodejs version

* cicd: change pipeline nodejs version

* feature: add oidc and update tsconfigs and reestructure auth service

* fix: pretier fix all codebase

* refact: infraestructure refactoring to bundle swagger

* fix: hotfix in cdk vpc warning

* fix: fix in environment

* refactor: infra multiples security groups

* fix: source .env in pipeline

* lint: fix eslint files

* lint: fix eslint files

* lint: fix eslint files

* lint: fix eslint files

* fix: fix in unit test

* fix: fix in migration command load env

* fix: fix in migration command load env

* fix: fix in migration command load env

* fix: fix in migration command load env

* fix: fix in migration command load env

* fix: fix in migration command load env

* fix: fix in migration command load env

* fix: fix in migration command load env

* fix: fix in migration command load env

* fix: fix in migration command load env

* cicd: add wait on pipeline script

* cicd: add wait on pipeline script

* cicd: add wait on pipeline script

* cicd: add wait on pipeline script

* cicd: add wait on pipeline script

* cicd: add wait on pipeline script

* cicd: add wait on pipeline script

* fix: docker environment overide

* fix: swagger dependencies

* fix: swagger dependencies

* fix: lint project

* fix pipeline: fix pipeline deploy

* fix pipeline: fix pipeline deploy

* doc: update project title and description

---------

Co-authored-by: Luiz Grigio <[email protected]>
  • Loading branch information
douglasgc and lhgrigio authored Apr 26, 2024
1 parent 3819c8d commit 5a235c9
Show file tree
Hide file tree
Showing 89 changed files with 13,432 additions and 23,939 deletions.
Binary file removed .DS_Store
Binary file not shown.
131 changes: 67 additions & 64 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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
# - 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
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.data
/dist
/documentation
.env
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -22,4 +22,4 @@ module.exports = {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
};
35 changes: 26 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# compiled output
/dist
/node_modules
/build

# Logs
logs
Expand All @@ -27,20 +28,36 @@ lerna-debug.log*
.settings/
*.sublime-workspace

# infra outputs
cdk.out/*
cdk.context.json

# compodoc
documentation/*

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# infra outputs
cdk.out/*

# documentatin dist
documentation

.data
/files
# dotenv environment variable files
.env
/ormconfig.json
.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
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"CodeGPT.apiKey": "OpenAI"
}
Loading

0 comments on commit 5a235c9

Please sign in to comment.