Simples user API with register manipulation and email system using MailTrap made with typescript using SOLID and Package by Feature practices
I made this repo for typescript and clean architecture study.
-
Clone the project
-
Install Packages
yarn install
- Goto to file
src/providers/implementations/MailTrapMailProvider.ts
and change the following variables to your MailTrap access to see the incoming emails:
constructor () {
this.transporter = nodemailer.createTransport({
host: 'YOURMAILTRAPHOST',
port: YOURMAILTRAPPORT,
auth: {
user: 'YOURMAILTRAPUSERNAME',
pass: 'YOURMAILTRAPPASSWORD'
}
})
}
- Execute the dev start command
yarn dev
- The server will be running on port 3333
- Send a POST request to
http://localhost:3333/users
with the following JSON format data:
{
"name": "YOURNAME",
"email": "YOUREMAIL",
"password": "YOURPASSWORD"
}
- Send a DELETE request to
http://localhost:3333/users
with the following JSON format data to delete the created user:
{
"email": "YOUREMAIL"
}
- Execute the build script:
yarn build
-
The builded files gonna be in dist folder.
-
Execute the
server.js
in dist folder with:
yarn build:execute
- Enjoy
Create a issue in the repo or simply create a pull request with the solution and a description about it (I'll thank a lot)
This project was based in a Rocketseat video (PT-BR)