Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kammradt/learning-nestjs
๐บWe are on quarentine, so lets study another JS framework ๐คท๐ปโโ๏ธ ๐บ
https://github.com/kammradt/learning-nestjs
api nest nestjs rest typescript
Last synced: 6 days ago
JSON representation
๐บWe are on quarentine, so lets study another JS framework ๐คท๐ปโโ๏ธ ๐บ
- Host: GitHub
- URL: https://github.com/kammradt/learning-nestjs
- Owner: kammradt
- Created: 2020-04-06T00:44:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-21T19:50:02.000Z (about 3 years ago)
- Last Synced: 2024-08-03T11:09:38.667Z (3 months ago)
- Topics: api, nest, nestjs, rest, typescript
- Language: TypeScript
- Size: 1.61 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Welcome to my learning proccess with NestJS โ๏ธ
## Description ๐
> Hi there!
> I will update this repo with new information as soon as I build something cool ๐
> **Update**: Course finished! ๐ฅฐ Now I just need to find a problem to be solved ๐ค## Sections ๐คน๐ปโโ๏ธ
- [X] Basic structure to perform CRUD ([this tag](https://github.com/kammradt/learning-nestjs/tree/crud-with-fake-data))
- [X] Basic usage of pipes and validation on DTOs ([this tag](https://github.com/kammradt/learning-nestjs/tree/using-pipes-and-validation))
- [X] Using persistence and queryBuilder([this tag](https://github.com/kammradt/learning-nestjs/tree/persistence-and-query-builder))
- [X] Adding basic Jwt Authentication ([this tag](https://github.com/kammradt/learning-nestjs/tree/adding-basic-auth))
- [X] Adding Authorization ([this tag](https://github.com/kammradt/learning-nestjs/tree/adding-authorization))
- [X] Adding Tests with Jest ([this tag](https://github.com/kammradt/learning-nestjs/tree/adding-tests))
- [X] Adding secure responses (@Exclude instead of DTOs) ([this tag](https://github.com/kammradt/learning-nestjs/tree/adding-global-dto-solution))
- [X] Adding role based authorization (ADMIN section)([this tag](https://github.com/kammradt/learning-nestjs/tree/adding-role-based-authorization))## Useful links ๐
- `class-validator` Annotations can be found [here](https://github.com/typestack/class-validator#validation-decorators)
- `TypeORM` [here](https://typeorm.io/)
- `queryBuilder` by `TypeORM` [here](https://github.com/typeorm/typeorm/blob/master/docs/select-query-builder.md)
- `queryBuilder with find { }` [here](https://github.com/typeorm/typeorm/blob/master/docs/find-options.md)
- Using a `ClassSerializerInterceptor` to hide sensitive data (instead of ResponseDTOs) [here](https://docs.nestjs.com/techniques/serialization#exclude-properties)
- How to add it globally [here](https://stackoverflow.com/questions/55720448/nestjs-how-to-setup-classserializerinterceptor-as-global-interceptor)
- Using roles on handlers [here](https://docs.nestjs.com/guards#setting-roles-per-handler)
- More details can be found [here](https://docs.nestjs.com/fundamentals/execution-context#reflection-and-metadata).
I chose the `.getAndOverride` approach, where a `Controller` level has a default `Role`, and some `actions (methods)` inside it can have more specific/restricted roles.## Stay in touch ๐ค ๐จ๐ปโ๐ป
- Author - [Vinicius Kammradt](https://kammradt.now.sh)
- Twitter - [@kammzinho](https://twitter.com/kammzinho)