diff --git a/README.md b/README.md index 8372941..0f71480 100644 --- a/README.md +++ b/README.md @@ -1,73 +1,127 @@ -

- Nest Logo -

+# NestJS TypeORM Boilerplate -[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456 -[circleci-url]: https://circleci.com/gh/nestjs/nest +Este repositório é um boilerplate para iniciar um projeto usando [NestJS](https://nestjs.com/) com [TypeORM](https://typeorm.io/). Ele fornece uma estrutura inicial para desenvolver APIs com suporte a banco de dados relacional, incluindo scripts para gerenciamento de migrações, testes, linting e formatação de código. -

A progressive Node.js framework for building efficient and scalable server-side applications.

-

-NPM Version -Package License -NPM Downloads -CircleCI -Coverage -Discord -Backers on Open Collective -Sponsors on Open Collective - - Support us - -

- +## Estrutura do Projeto -## Description +A estrutura do projeto segue as melhores práticas recomendadas pelo NestJS, incluindo a organização de módulos, controladores, serviços e entidades. O TypeORM é configurado para trabalhar com PostgreSQL, mas pode ser facilmente adaptado para outros bancos de dados suportados. -[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository. +## Pré-requisitos -## Installation +- Node.js v16 ou superior +- npm v8 ou superior +- Banco de dados PostgreSQL -```bash -$ yarn install -``` +## Instalação -## Running the app +1. Clone o repositório: + ```bash + git clone https://gitea.pradoc.com.br/Rhuan/NestJS-Boilerplate.git + cd nestjs_typeorm + ``` -```bash -# development -$ yarn run start +2. Instale as dependências: + ```bash + npm install + ``` -# watch mode -$ yarn run start:dev +3. Configure as variáveis de ambiente criando um arquivo `.env` na raiz do projeto. Exemplo: + ```env + DATABASE_HOST=localhost + DATABASE_PORT=5432 + DATABASE_USER=seu-usuario + DATABASE_PASSWORD=sua-senha + DATABASE_NAME=seu-banco-de-dados + JWT_SECRET=sua-chave-secreta + ``` -# production mode -$ yarn run start:prod -``` +## Scripts Disponíveis -## Test +### Desenvolvimento -```bash -# unit tests -$ yarn run test +- Iniciar o servidor em modo de desenvolvimento: + ```bash + npm run start:dev + ``` -# e2e tests -$ yarn run test:e2e +- Iniciar o servidor com depuração: + ```bash + npm run start:debug + ``` -# test coverage -$ yarn run test:cov -``` +### Produção -## Support +- Construir o projeto: + ```bash + npm run build + ``` -Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support). +- Iniciar o servidor em modo de produção: + ```bash + npm run start:prod + ``` -## Stay in touch +### Linting e Formatação -- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com) -- Website - [https://nestjs.com](https://nestjs.com/) -- Twitter - [@nestframework](https://twitter.com/nestframework) +- Lint do código: + ```bash + npm run lint + ``` -## License +- Formatar o código: + ```bash + npm run format + ``` -Nest is [MIT licensed](LICENSE). +### Testes + +- Executar todos os testes: + ```bash + npm run test + ``` + +- Executar os testes em modo de observação: + ```bash + npm run test:watch + ``` + +- Executar testes com cobertura: + ```bash + npm run test:cov + ``` + +- Executar testes end-to-end: + ```bash + npm run test:e2e + ``` + +### Migrações TypeORM + +- Criar uma nova migração: + ```bash + npm run typeorm:create + ``` + +- Gerar uma nova migração com base nas mudanças nas entidades: + ```bash + npm run typeorm:generate + ``` + +- Executar as migrações: + ```bash + npm run typeorm:run + ``` + +- Reverter a última migração: + ```bash + npm run typeorm:revert + ``` + + +## Autor + +[Rhuan Prado](https://gitea.pradoc.com.br/Rhuan) + +--- + +Este boilerplate é uma excelente base para projetos NestJS utilizando TypeORM, com suporte completo a desenvolvimento, testes, linting, formatação e gerenciamento de migrações de banco de dados. \ No newline at end of file