Skip to content

Commit

Permalink
feat: update template
Browse files Browse the repository at this point in the history
  • Loading branch information
AlreadyBored committed Jul 10, 2022
1 parent db6f5e8 commit eaecb78
Show file tree
Hide file tree
Showing 39 changed files with 9,483 additions and 7,118 deletions.
5 changes: 0 additions & 5 deletions .env

This file was deleted.

7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
PORT=4000

CRYPT_SALT=10
JWT_SECRET_KEY=secret123123
JWT_SECRET_REFRESH_KEY=secret123123
TOKEN_EXPIRE_TIME=1h
TOKEN_REFRESH_EXPIRE_TIME=24h
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

24 changes: 24 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
47 changes: 0 additions & 47 deletions .eslintrc.json

This file was deleted.

123 changes: 27 additions & 96 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,104 +1,35 @@
# compiled output
/dist
/node_modules

# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
# OS
.DS_Store

# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
7 changes: 3 additions & 4 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"tabWidth": 2,
"semi": true,
"singleQuote": true
}
"singleQuote": true,
"trailingComma": "all"
}
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RS School REST service
# Home Library Service

## Prerequisites

Expand Down Expand Up @@ -34,13 +34,13 @@ After application running open new terminal and enter:
To run all tests without authorization

```
npm test
npm run test
```

To run only one of all test suites (users, boards or tasks)
To run only one of all test suites

```
npm test <suite name>
npm run test -- <path to suite>
```

To run all test with authorization
Expand All @@ -49,22 +49,22 @@ To run all test with authorization
npm run test:auth
```

To run only specific test suite with authorization (users, boards or tasks)
To run only specific test suite with authorization

```
npm run test:auth <suite name>
npm run test:auth -- <path to suite>
```

## Development

If you're using VSCode, you can get a better developer experience from integration with [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) and [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) extensions.

### Auto-fix and format

```
npm run lint
```

```
npm run format
```

### Debugging in VSCode

Press <kbd>F5</kbd> to debug.
Expand Down
46 changes: 23 additions & 23 deletions doc/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ components:
- id
- name
- duration
Favourites:
Favorites:
type: object
properties:
artists:
Expand Down Expand Up @@ -743,16 +743,16 @@ paths:
/favs:
get:
tags:
- Favourites
summary: Get all favourites
description: Gets all favourites movies, tracks and books
- Favorites
summary: Get all favorites
description: Gets all favorites movies, tracks and books
responses:
200:
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/Favourites'
$ref: '#/components/schemas/Favorites'
401:
$ref: '#/components/responses/UnauthorizedError'
/favs/track/{id}:
Expand All @@ -765,9 +765,9 @@ paths:
format: uuid
post:
tags:
- Favourites
summary: Add track to the favourites
description: Add track to the favourites
- Favorites
summary: Add track to the favorites
description: Add track to the favorites
responses:
201:
description: Added succesfully
Expand All @@ -779,9 +779,9 @@ paths:
description: Track with id doesn't exist.
delete:
tags:
- Favourites
summary: Delete track from favourites
description: Delete track from favourites
- Favorites
summary: Delete track from favorites
description: Delete track from favorites
responses:
204:
description: Deleted succesfully
Expand All @@ -801,9 +801,9 @@ paths:
format: uuid
post:
tags:
- Favourites
summary: Add album to the favourites
description: Add album to the favourites
- Favorites
summary: Add album to the favorites
description: Add album to the favorites
responses:
201:
description: Added succesfully
Expand All @@ -815,9 +815,9 @@ paths:
description: Album with id doesn't exist.
delete:
tags:
- Favourites
summary: Delete album from favourites
description: Delete album from favourites
- Favorites
summary: Delete album from favorites
description: Delete album from favorites
responses:
204:
description: Deleted succesfully
Expand All @@ -837,9 +837,9 @@ paths:
format: uuid
post:
tags:
- Favourites
summary: Add artist to the favourites
description: Add artist to the favourites
- Favorites
summary: Add artist to the favorites
description: Add artist to the favorites
responses:
201:
description: Added succesfully
Expand All @@ -851,9 +851,9 @@ paths:
description: Artist with id doesn't exist.
delete:
tags:
- Favourites
summary: Delete artist from favourites
description: Delete artist from favourites
- Favorites
summary: Delete artist from favorites
description: Delete artist from favorites
responses:
204:
description: Deleted succesfully
Expand Down
4 changes: 4 additions & 0 deletions nest-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"collection": "@nestjs/schematics",
"sourceRoot": "src"
}
Loading

0 comments on commit eaecb78

Please sign in to comment.