Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alvachon/nestjsrp
Simulating a NestJS structure from scratch
https://github.com/alvachon/nestjsrp
Last synced: about 2 months ago
JSON representation
Simulating a NestJS structure from scratch
- Host: GitHub
- URL: https://github.com/alvachon/nestjsrp
- Owner: alvachon
- Created: 2023-10-06T19:14:47.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-07T12:46:31.000Z (about 1 year ago)
- Last Synced: 2023-10-07T20:38:10.631Z (about 1 year ago)
- Language: TypeScript
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nestJsRP
Simulating a NestJS structure from scratch# Steps so far
1. Creating a directory named **myapp**, cd in.
2. ``npm init -y`` --> Create a package.json, that represent an empty nodejs project.
3. Installing the core and supporting files (with npm or yarn) with the command ``npm i --save @nestjs/core @nestjs/common rxjs reflect-metadata`` as cited in https://docs.nestjs.com/ A node_modules directory appear and package-lock.json
4. npm send me a notice to run ``npm install -g [email protected]`` for update !
5. Need to install 3 more packages to handle http request and typescript : ``npm i @nestjs/platform-express typescript``
6. We can see in the package.json an update of the new packages that were installed :
```
dependencies:
{
"@nestjs/common": "^10.2.7",
"@nestjs/core": "^10.2.7",
"@nestjs/platform-express": "^10.2.7",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.1",
"typescript": "^5.2.2"
}
```
7. Creating a config file for typescript in the root of the project. `` tsconfig.json``
8. He pasted inside a basic configuration that go as follow:
```
{
"compilerOptions": {
"module": "commonjs",
"target": "es2017",
"experimentalDecorators": true,
"emitDecoratorMetadata": true
}
}
```
``
Pipe : Validate Incoming request (Data Validation)
Controller : Request in, Response out
Service : Handle the data of the repository and the rest of the code (ex auth service ..)
Repository : Database
5.53
``
9. creating a main.ts file (starting point)
at 4.35 in https://www.youtube.com/watch?v=yNj_tzbX6BQEdit : I created a .gitignore and added node_modules