diff --git a/.env.example b/.env.example index 87c1958..11ccf5f 100644 --- a/.env.example +++ b/.env.example @@ -2,11 +2,19 @@ PORT= SECRET_KEY= # DATABASE CONNECTION -DATABASE_URL= +DATABASE_URL=postgresql://docker:ignite@mentores-backend.soujunior.tech:5432/mentores_backend +DATABASE_URL_LOCAL=postgresql://docker:ignite@localhost:5432/mentores_backend +URL_CONFIRM_EMAIL=http://localhost:Porta que o frontend esta rodando/confirmacao +URL_RESTORATION_EMAIL=http://localhost:Porta que o frontend esta rodando/setNewPassword +#Para fazer a captura de email, use o https://mailtrap.io/, caso esteja na duvida como usar olhe o readme. #EMAIL INFO MAIL_HOST= MAIL_PORT= MAIL_USER= -MAIL_PASSWORD= \ No newline at end of file +MAIL_PASSWORD= + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_S3_BUCKET_NAME= \ No newline at end of file diff --git a/README.md b/README.md index 00a13b1..477f491 100644 --- a/README.md +++ b/README.md @@ -1,73 +1,72 @@ -
- -[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456 -[circleci-url]: https://circleci.com/gh/nestjs/nest - -A progressive Node.js framework for building efficient and scalable server-side applications.
- - - -## Description - -[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository. - -## Installation +# mentores-backend + +Projeto Opensource que visa melhorar o match entre Mentores e Juniors. + +## Observação: + +>Antes de iniciar a instalação, lembre-se de fazer um fork do repositório oficial e realizar as alterações no repositório "forkado" enviando modificações através de Pull Requests. Nunca modifique diretamente o repositório oficial. + + +Clone o projeto: ```bash -$ npm install + git clone https://github.com/{SEU USUARIO}/mentores-backend.git ``` -## Running the app +Entre no diretório do projeto: ```bash -# development -$ npm run start + cd mentores-backend/ +``` -# watch mode -$ npm run start:dev +Instale as dependências: -# production mode -$ npm run start:prod +```bash + npm install ``` -## Test +## Rodando localmente + +- Verifique se esta com o docker instalado e aberto + +Dentro da pasta mentores-backend, rode o seguinte comando: ```bash -# unit tests -$ npm run test +docker-compose up -d +``` + +com o banco de dados rodando localmente, só precisa pegar as variaveis .env com alguem do projeto. -# e2e tests -$ npm run test:e2e +## Como utilizar o mailtrap. -# test coverage -$ npm run test:cov +Entre no [Mailtrap](https://mailtrap.io) e crie uma conta, com a conta criada vá em email Testing e clique em my inbox: + + + +Veja a parte de Integration e clique em Show Credentials, vai precisar do Host, Port, Username e Password. + + + + +Agora só utilizar o: + +```bash +npm run dev ``` -## Support +### Mailtrap não capturou o email + +Caso você tenha feito isso tudo e não recebeu o email no mailtrap faça o seguinte, Na pasta do mentores-backend vá em: + +src/modules/mails/mail.module.ts -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). +dentro dela tem um: -## Stay in touch +```bash +secure: true, +``` -- Author - [Kamil Myśliwiec](https://kamilmysliwiec.com) -- Website - [https://nestjs.com](https://nestjs.com/) -- Twitter - [@nestframework](https://twitter.com/nestframework) + -## License -Nest is [MIT licensed](LICENSE). +troque para false, com isso o mailtrap vai capturar seus emails normalmente. diff --git a/docker-compose.yml b/docker-compose.yml index 91e4c1c..f577a54 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,8 @@ services: - POSTGRES_PASSWORD=ignite - POSTGRES_DB=mentores_backend volumes: - - pgdata:/data/postgres + - pgdata:/var/lib/postgresql/data + mentores_backend: build: . container_name: mentores_backend @@ -21,15 +22,13 @@ services: - 3000:3000 volumes: - .:/usr/app - links: - - database_soujunior depends_on: - database_soujunior env_file: - .env environment: - - DATABASE_URL=postgresql://docker:ignite@mentores_backend:3306/mentores_backend?reconnect=true + - DATABASE_URL=postgresql://docker:ignite@database_soujunior:5432/mentores_backend volumes: pgdata: - driver: local + driver: local \ No newline at end of file diff --git a/src/modules/mails/mail.service.ts b/src/modules/mails/mail.service.ts index dd49748..84cb7c9 100644 --- a/src/modules/mails/mail.service.ts +++ b/src/modules/mails/mail.service.ts @@ -11,7 +11,7 @@ export class MailService { async mentorSendEmailConfirmation(mentor: MentorEntity): Promise