Skip to content

Commit

Permalink
feat(server): nestjs setup
Browse files Browse the repository at this point in the history
  • Loading branch information
lykalabrada committed Nov 6, 2023
1 parent 4d6cac9 commit 86e53db
Show file tree
Hide file tree
Showing 230 changed files with 30,029 additions and 2,912 deletions.
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
node_modules/
/.pnp
.pnp.js

# testing
/coverage
coverage

# next.js
/.next/
.next/
/out/
dist

# production
/build
Expand All @@ -34,3 +35,6 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# nyc test coverage
.nyc_output
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

10 changes: 0 additions & 10 deletions .lintstagedrc.js

This file was deleted.

11 changes: 8 additions & 3 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,21 @@ public-hoist-pattern[]=*jest*
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*prettier*
public-hoist-pattern[]=@types/*
public-hoist-pattern[]=*defichain*
public-hoist-pattern[]=*react*
public-hoist-pattern[]=*next*
public-hoist-pattern[]=next*
public-hoist-pattern[]=*react*
public-hoist-pattern[]=*@waveshq*
public-hoist-pattern[]=*@netlify*
public-hoist-pattern[]=*follow-redirects*
public-hoist-pattern[]=*@waveshq*
public-hoist-pattern[]=*defichain*
public-hoist-pattern[]=*nestjs*
public-hoist-pattern[]=*fastify*
public-hoist-pattern[]=async-mutex
public-hoist-pattern[]=cache-manager
public-hoist-pattern[]=helmet

engine-strict=true
auto-install-peers=true
strict-peer-dependencies=false
enable-pre-post-scripts=true
node-linker=hoisted
29 changes: 29 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"editor.formatOnSave": true,
"editor.formatOnPaste": false,
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"eslint.workingDirectories": [
{
"mode": "auto"
}
],
"files.exclude": {
"**/node_modules": true,
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true
},
"cSpell.words": [
"birthdaycloud",
"fastify",
"Middie"
]
}
8 changes: 8 additions & 0 deletions apps/server/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
preset: 'ts-jest',
testRegex: '((\\.|/)(e2e|test|spec))\\.[jt]sx?$',
verbose: true,
clearMocks: true,
testTimeout: 300000,
coveragePathIgnorePatterns: ['/node_modules/', '/examples/', '/website/', '.*/__tests__/.*', '.*/testing/.*'],
};
8 changes: 8 additions & 0 deletions apps/server/nest-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"deleteOutDir": true
}
}
110 changes: 110 additions & 0 deletions apps/server/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"name": "server",
"version": "1.0.0",
"description": "",
"keywords": [],
"license": "ISC",
"author": "",
"main": "index.js",
"scripts": {
"build": "nest build",
"lint": "eslint .",
"playground:start": "docker-compose rm -fsv && docker-compose up",
"prettier": "npx prettier --write .",
"start": "nest start",
"start:debug": "nest start --debug --watch",
"start:dev": "nest start --watch",
"start:prod": "node dist/main",
"test": "jest",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"test:watch": "jest --watch"
},
"lint-staged": {
"*": [
"prettier --write --ignore-unknown"
],
"*.{js,ts}": [
"eslint --fix"
]
},
"prettier": "@stickyjs/prettier",
"eslintConfig": {
"parserOptions": {
"project": "./tsconfig.json"
},
"extends": [
"@stickyjs"
],
"overrides": [
{
"files": [
"*.ts"
],
"rules": {
"no-prototype-builtins": "off",
"no-restricted-properties": "warn",
"check-file/filename-naming-convention": "off",
"unused-imports/no-unused-vars": "warn"
}
}
]
},
"dependencies": {
"@defichain/jellyfish-api-core": "^4.0.0-beta.11",
"@defichain/jellyfish-network": "^4.0.0-beta.11",
"@defichain/jellyfish-transaction": "^4.0.0-beta.11",
"@defichain/whale-api-client": "^4.0.0-beta.11",
"@nestjs/common": "^10.2.5",
"@nestjs/config": "^3.1.1",
"@nestjs/core": "^10.2.5",
"@nestjs/platform-express": "^10.2.5",
"@waveshq/standard-defichain-jellyfishsdk": "^2.6.1",
"@waveshq/walletkit-core": "^1.3.4",
"axios": "^1.5.0",
"bignumber.js": "^9.1.2",
"class-validator": "^0.14.0",
"ethers": "^6.7.1",
"express": "^4.18.2",
"joi": "^17.10.1",
"node-fetch": "^3.3.2",
"pg": "^8.11.3",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.1",
"smart-buffer": "^4.2.0",
"viem": "^1.10.14"
},
"devDependencies": {
"@defichain/jellyfish-testing": "4.0.0-beta.11",
"@defichain/playground-api-client": "4.0.0-beta.11",
"@defichain/testcontainers": "4.0.0-beta.11",
"@nestjs/cli": "^10.1.17",
"@nestjs/platform-fastify": "^10.2.5",
"@nestjs/schematics": "^10.0.2",
"@nestjs/testing": "^10.2.5",
"@stickyjs/eslint-config": "^1.3.3",
"@stickyjs/prettier": "^1.3.3",
"@stickyjs/testcontainers": "^1.3.3",
"@stickyjs/typescript": "^1.3.3",
"@types/express": "^4.17.17",
"@types/jest": "^29.5.4",
"@types/node": "^20.5.0",
"@types/supertest": "^2.0.12",
"@waveshq/standard-web-linter": "^2.6.1",
"dotenv": "^16.3.1",
"husky": "^8.0.3",
"jest": "^29.7.0",
"lint-staged": "^14.0.1",
"nodemon": "^3.0.1",
"prettier": "^3.0.3",
"source-map-support": "^0.5.21",
"supertest": "^6.3.3",
"testcontainers": "^9.12.0",
"ts-jest": "^29.1.1",
"ts-loader": "^9.4.4",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.2.2"
}
}
Loading

0 comments on commit 86e53db

Please sign in to comment.