{"id":20988715,"url":"https://github.com/franciscowallison/nlw-04-nodejs","last_synced_at":"2026-04-14T05:31:06.265Z","repository":{"id":54238645,"uuid":"341698574","full_name":"FranciscoWallison/nlw-04-nodejs","owner":"FranciscoWallison","description":"Projeto desenvolvido durante a 4° edição da NLW na trilha de NODE JS Da Rocketseat .","archived":false,"fork":false,"pushed_at":"2021-08-08T11:40:02.000Z","size":2523,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-31T23:56:08.751Z","etag":null,"topics":["docker","docker-compose","jenkins","jenkins-pipeline","jenkinsfile","mysql","nodejs","postgres","sqlite","testing"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FranciscoWallison.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-23T21:43:43.000Z","updated_at":"2021-08-08T11:40:05.000Z","dependencies_parsed_at":"2022-08-13T09:50:30.229Z","dependency_job_id":null,"html_url":"https://github.com/FranciscoWallison/nlw-04-nodejs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FranciscoWallison/nlw-04-nodejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranciscoWallison%2Fnlw-04-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranciscoWallison%2Fnlw-04-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranciscoWallison%2Fnlw-04-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranciscoWallison%2Fnlw-04-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FranciscoWallison","download_url":"https://codeload.github.com/FranciscoWallison/nlw-04-nodejs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FranciscoWallison%2Fnlw-04-nodejs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31784251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","jenkins","jenkins-pipeline","jenkinsfile","mysql","nodejs","postgres","sqlite","testing"],"created_at":"2024-11-19T06:22:45.278Z","updated_at":"2026-04-14T05:31:06.248Z","avatar_url":"https://github.com/FranciscoWallison.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [NLW#4] Start Project NodeJs e ...Docker, Docker-Compose, Jenkis, DockerHub, Sqlit, Mysql, Porstgres, Testing e CI/CD\r\n\r\n[![Wallpaper-1920c1080.png](https://i.postimg.cc/257MFQX8/Wallpaper-1920c1080.png)](https://postimg.cc/SXjgmMhw)\r\n\r\n\r\n\r\n\r\n\r\n  \u003ch1 align=\"center\"\u003e  NPS-API Net Promoter Score  \u003c/h1\u003e\r\n\r\n  \u003cp align=\"center\"\u003eProjeto desenvolvido durante a 4° edição da NLW \u003ca href\"https://rocketseat.com.br/\"\u003ena trilha de NODE JS\u003c/a\u003e Da \u003ca href\"https://rocketseat.com.br/\"\u003e Rocketseat\u003c/a\u003e . \u003c/p\u003e\r\n\r\n\u003cp align=\"center\"\u003e\r\n\r\n\r\n  \u003cimg alt=\"GitHub contagem de linguagens\" src=\"https://img.shields.io/github/languages/count/FranciscoWallison/nlw-04-nodejs?color=%2304D361\u0026style=plastic\"\u003e\r\n\r\n  \u003cimg alt=\"Tamanho do repositório\" src=\"https://img.shields.io/github/languages/code-size/FranciscoWallison/nlw-04-nodejs?style=plastic\"\u003e\r\n\r\n  \r\n  \r\n  \u003cimg alt=\"licensa\" src=\"https://img.shields.io/github/license/FranciscoWallison/nlw-04-nodejs?style=plastic\"\u003e\r\n\r\n  \u003cimg src=\"https://img.shields.io/github/forks/FranciscoWallison/nlw-04-nodejs?style=plastic\"\u003e\r\n\r\n\u003ca href=\"https://github.com/FranciscoWallison/nlw-04-nodejs/commits/master\"\u003e\r\n    \u003cimg alt=\"GitHub último commit\" src=\"https://img.shields.io/github/last-commit/FranciscoWallison/nlw-04-nodejs?style=plastic\"\u003e\r\n  \u003c/a\u003e\r\n\r\n  \u003cp align=\"center\" \u003e\u003ca href=\"https://github.com/FranciscoWallison\" \u003e \u003cimg alt=\"Wallison\" src=\"https://img.shields.io/badge/Desenvolvido%20por-Wallison%20-brightgreen\"\u003e\u003c/a\u003e\u003c/p\u003e\r\n\r\n  ## 📕 Indice\r\n\r\n\r\n* [📋 Sobre](#-sobre-o-projeto)\r\n* [🚀 Milhas Extras:](#-milhas-extras)\r\n* [:cyclone: CI/CD](#cicd)\r\n*  -[:artificial_satellite: Pipeline Jenkis](#pipeline)\r\n*  -[:white_check_mark: Testing sqlite, mysql e postgres](#testing-sqlite-mysql-e-postgres)\r\n*  -[:shopping_cart: Deliveri](#repo)\r\n* [🦸 Observações e dicas para esta utilizando projeto.](#obs)\r\n\r\n  \r\n  \r\n ## 📋 Sobre o projeto\r\n\r\nO \u003cstrong\u003eNPS-API\u003c/strong\u003e é uma API Restful para Net Promoter Score.\r\n\r\nAplicação web construída na trilha \u003cstrong\u003eNodeJS\u003c/strong\u003e da \u003cstrong\u003eNext Level Week\u003c/strong\u003e distribuída pela [Rocketseat](https://rocketseat.com.br/).\r\n\r\n\r\n````\r\nO NPS-NLW é uma aplicação que consiste em calcular o NPS da empresa. \r\nNele fazemos o cadastro de usuários, cadastro de pesquisas, envio de e-mail \r\npara os usuários responderem as pesquisas de satisfação e com isso podemos realizar o cálculo do NPS.\r\n\r\nEsse projeto foi desenvolvido durante a trilha de NodeJS, na quarta edição da NLW. \r\nAprendemos conceitos sobre o que é um API, como iniciar um projeto utilizando \r\nTypescript e Express para gerenciamento das rotas, \r\nTypeORM para manipulação dos dados, testes automatizados e envio de e-mail.\r\n````\r\n\r\n\r\n## 🚀 Milhas Extras\r\nEsse projeto foi desenvolvido com as seguintes tecnologias:\r\n- [Typescript](https://www.typescriptlang.org/)\r\n- [Node.js](https://nodejs.org/en/)\r\n- [Express](https://expressjs.com/pt-br/)\r\n- [NPM](https://www.npmjs.com/)\r\n- [Typeorm](https://typeorm.io/)\r\n- [Jestjs](https://jestjs.io/)\r\n- [Sqlite](https://www.sqlite.org/)\r\n- [MySql](https://www.mysql.com/)\r\n- [Postgres](https://www.postgresql.org/)\r\n- [Docker](https://www.docker.com/)\r\n- [DockerHub](https://hub.docker.com/)\r\n- [Jenkins](https://www.jenkins.io/)\r\n\r\n## CI/CD\r\n#### Pipeline\r\n![jenkis](https://github.com/FranciscoWallison/nlw-04-nodejs/blob/master/inforFiles/jenkis.png)\r\n#### Testing sqlite, mysql e postgres\r\n![sqlite](https://github.com/FranciscoWallison/nlw-04-nodejs/blob/master/inforFiles/test_sqlit.png) ![mysql](https://github.com/FranciscoWallison/nlw-04-nodejs/blob/master/inforFiles/test_mysql.png) ![jenkis](https://github.com/FranciscoWallison/nlw-04-nodejs/blob/master/inforFiles/test_postgres.png)\r\n### Repo\r\n[Link DockerHub](https://hub.docker.com/repository/docker/chicowall/nlw-04-nodejs/)\r\n![deliveri](https://github.com/FranciscoWallison/nlw-04-nodejs/blob/master/inforFiles/ltimoDelivere.png) \r\n\r\n## OBS: COMANDOS RAPIDOS E ACESSIBILIDADE \r\n#### 1 Lembrar de abrir o bash e instalar o \"npm install\".\r\n#### 2 Para estar selecionando os [DRIVES](https://github.com/FranciscoWallison/nlw-04-nodejs/blob/main/docker-compose.yml#L21).\r\n#### 3 O comando [yarn dev-mr](https://github.com/FranciscoWallison/nlw-04-nodejs/blob/main/nodejs/package.json#L10) ajudará a startar o projeto com as migrações.\r\n#### 4 O comando [yarn typeorm-mc](https://github.com/FranciscoWallison/nlw-04-nodejs/blob/main/nodejs/package.json#L11) ajudará a criar a migração na database selecionada. exemplo  ```typeorm-mc \u003cDescriptionMigration\u003e```.\r\n#### 5 Referencia utilizada para criar webhook com jenkins, github e dockerhub [aqui](https://medium.com/@naistangz/building-a-ci-cd-pipeline-for-a-node-js-app-with-docker-and-jenkins-ee6db6e70d25).\r\n#### 6 Possiveis erros e suas soluções [aqui](https://github.com/FranciscoWallison/nlw-04-nodejs#table-database_nlw_testsurveys-doesnt-exist).\r\n\r\n_______\r\n## Comandos básicos Docker e DOCKER-COMPOSE\r\n#### Executando docker-compose \r\n- docker-compose -f \"docker-compose.yml\" down\r\n- docker container exec -u 0 -it 14802ce72cc4 bash\r\n## Comandos básicos MIGRATIONS\r\n#### Executando migrations\r\n - yarn typeorm migration:run\r\n#### Revertendo migrations\r\n - yarn typeorm migration:revert\r\n#### Criando migrations\r\n - yarn typeorm migration:create -n CreateUsers\r\n## Comandos básicos SQLITE\r\n#### Install sqlite3 LINUX\r\n- sudo apt install sqlite3\r\n#### Acessando banco \r\n-  sqlite3 database.sql\r\n#### Lista todos as tabelas\r\n- .tables\r\n\r\n## Comandos básicos POSTGRES\r\n-  psql -U postgres\r\n#### Lista todos os bancos\r\n- \\l\r\n#### Selecionar o banco \r\n- \\c database_nlw postgres\r\n#### Lista todos as tabelas\r\n- \\d\r\n\r\n## Comandos básicos MYSQL\r\n- mysql -uroot -proot\r\n#### lista todos os bancos\r\n- show databases;\r\n#### Selecionar o banco \r\n- USE database_nlw;\r\n#### Lista todos as tabelas\r\n- show tables;\r\n\r\n# Testing continuous integration\r\n## Comandos básicos jenkins\r\n#### Primeiro acesso Senha\r\n- cat /var/jenkins_home/secrets/initialAdminPassword\r\n\r\n# Erros\r\n## Table 'database_nlw_test.surveys' doesn't exist\r\n#### Solução \r\n    - yarn typeorm schema:drop -c \"$CONNECTION_DRIVE\"_test\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranciscowallison%2Fnlw-04-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffranciscowallison%2Fnlw-04-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranciscowallison%2Fnlw-04-nodejs/lists"}