Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tutods/nlw06-node

Project developed on NLW#06 of NodeJS
https://github.com/tutods/nlw06-node

eslint express node nodejs nodemon prettier typescript

Last synced: 9 days ago
JSON representation

Project developed on NLW#06 of NodeJS

Awesome Lists containing this project

README

        


NLW#06 NodeJS



This project is created from the NLW#06 of NodeJS





NodeJS


TypeScript


VS Code


Stargazers




📋 How to execute:

To run this project follow commands below:

1. `yarn install`;
2. `yarn typeorm migration:run`;
3. `yarn dev`: this run the development server;




💬 Changes:

- I use **Nodemon** with **TS-Node** instead **TS-Node-Dev**;
- Add **ESLint** configuration (`.eslintrc`) and add hook to run on `git push`;
- Custom folder structure;
- Use one controller for all **CRUD** services (`getAll`, `getOne`, `create`, `update` and `delete`);
- Use **JOI** to validate parameters and body of requests;
- I create 3 middlewares to validade the body, query parameters or url parameters;
- Set **Babel** to build;
- Use `classToClass` (form `class-transformer` package) to hide password on result of requests;




How to fix Husky to run hooks:

In `package.json` add on scripts:

```json
"postinstall": "husky install",
```

After that run on your terminal:

- **With Yarn:**
- `yarn husky add .husky/pre-push "yarn lint"`
- `yarn husky add .husky/pre-commit "yarn lint-staged"`
- **With NPM:**
- `npx husky add .husky/pre-push "npm run lint`
- `npx husky add .husky/pre-commit "npm lint-staged`





🧑🏻‍💻 About Me


Daniel Sousa @TutoDS


Daniel Sousa @TutoDS


Github Badge


Linkedin


Twitter


Facebook



YouTube


Instagram


GitLab


Rocketseat