Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
justnyx authored Nov 9, 2024
0 parents commit a400fe2
Show file tree
Hide file tree
Showing 51 changed files with 5,803 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.idea
dist
.next
47 changes: 47 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
module.exports = {
plugins: ['prettier', 'simple-import-sort'],
extends: ['plugin:@typescript-eslint/recommended', 'eslint:recommended'],
root: true,
env: {
node: true,
},
ignorePatterns: ['.eslintrc.js', '.prettierrc.js'],
rules: {
'prettier/prettier': 'error',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
camelcase: [
'error',
{
properties: 'never',
},
],
eqeqeq: 'error',
'max-depth': 'error',
'max-lines': 'error',
'no-alert': 'error',
'no-array-constructor': 'error',
'no-console': [
'error',
{
allow: ['warn', 'error'],
},
],
'no-eval': 'error',
'no-implicit-coercion': 'error',
'no-lonely-if': 'error',
'no-nested-ternary': 'error',
'no-negated-condition': 'error',
'no-unneeded-ternary': 'error',
'no-undef-init': 'error',
'no-underscore-dangle': 'error',
'no-useless-concat': 'error',
'no-void': 'error',
'no-var': 'error',
'prefer-const': 'error',
'prefer-promise-reject-errors': 'error',
'prefer-template': 'error',
yoda: 'error',
'no-unused-vars': 'off',
},
};
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
69 changes: 69 additions & 0 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Static Analysis

on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev

jobs:
lint-check:
name: ESLint Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: yarn install

- name: Run ESLint check
run: yarn lint

format-check:
name: Prettier Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: yarn install

- name: Run Prettier check
run: yarn format:check

build:
name: Build
runs-on: ubuntu-latest
needs:
- lint-check
- format-check
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: yarn install

- name: Build
run: yarn build:backend
43 changes: 43 additions & 0 deletions .github/workflows/prisma-migrations-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Check Prisma Migrations

on:
pull_request:
paths:
- 'apps/backend/prisma/schema.prisma'
- 'apps/backend/prisma/migrations/**'

jobs:
check_prisma_changes:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches

- name: Fetch base branch
run: git fetch origin ${{ github.base_ref }}

- name: Check if `schema.prisma` was modified in the PR
id: check_schema
run: |
if git diff --name-only origin/${{ github.base_ref }}... | grep -q 'apps/backend/prisma/schema.prisma'; then
echo "schema_changed=true" >> $GITHUB_ENV
else
echo "schema_changed=false" >> $GITHUB_ENV
fi
- name: Check if a new migration was added in the PR
id: check_migrations
run: |
if git diff --name-only --diff-filter=A origin/${{ github.base_ref }}... | grep -q 'apps/backend/prisma/migrations/'; then
echo "migration_added=true" >> $GITHUB_ENV
else
echo "migration_added=false" >> $GITHUB_ENV
fi
- name: Fail if `schema.prisma` was modified and no migration was added
if: env.schema_changed == 'true' && env.migration_added == 'false'
run: |
echo "The schema.prisma file was modified, but no new migration was added."
exit 1
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dist
build
node_modules
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.DS_Store
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 63 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/next-nest-template.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.idea
dist
.next
10 changes: 10 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
semi: true,
singleQuote: true,
trailingComma: 'es5',
bracketSpacing: true,
printWidth: 120,
jsxSingleQuote: true,
bracketSameLine: false,
endOfLine: 'lf',
};
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint", "Prisma.prisma"]
}
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug backend",
"cwd": "${workspaceFolder}/apps/backend",
"runtimeArgs": ["run", "start:debug"],
"runtimeExecutable": "yarn",
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"outputCapture": "std",
"type": "node",
"restart": true
}
]
}
24 changes: 24 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.renderWhitespace": "boundary",
"editor.rulers": [120],
"editor.formatOnSave": true,
"files.encoding": "utf8",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.eol": "\n",
"search.exclude": {
"public/**": true,
"node_modules/**": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit",
"source.formatDocument": "explicit",
"source.fixAll.eslint": "explicit"
},
"[prisma]": {
"editor.defaultFormatter": "Prisma.prisma"
}
}
Loading

0 comments on commit a400fe2

Please sign in to comment.