This application was built using JavaScript, Node.js, Express and MongoDB with MVC architectural pattern. In this API was created routes for user registration using encrypted password which authenticates users by returning a JWT token to validate the login, with a feature that provides password recovery by email through Nodemailer.
User Authentication:
route | HTTP Method | params | description |
---|---|---|---|
/auth/register |
POST | Request body with name , email and password |
Register a user |
/auth/authenticate |
POST | Request body with email and password |
Authenticate a user |
/auth/forgot_password |
POST | Request body with email |
Sends a new access token to the email entered in the request body |
/auth/reset_password |
POST | Request body with email , token and password |
Reset the access password through the registered email and the access token provided by email on the /forgot_password route |
Requests
- POST:
/auth/register
{
"name": "Exemple",
"email": "[email protected]",
"password": "123456"
}
- POST:
/auth/authenticate
{
"email": "[email protected]",
"password": "12345678"
}
- POST:
/auth/forgot_password
{
"email": "[email protected]"
}
- POST:
/auth/reset_password
{
"email": "[email protected]",
"token": "ebf60c2e5be235f96c0c0571c04fad1f843da9c7",
"password": "1234567890"
}
CRUD Projects:
route | HTTP Method | params | description |
---|---|---|---|
/projects |
GET | - | Lists the projects registered in the database |
/projects/:projectId |
GET | Query parameter with projectId |
Lists a specific project through it's id |
/projects |
POST | Request body with title , description and tasks |
Creates a new project |
/projects/:projectId |
PUT | Query parameter with projectId |
Updates a specific project through it's id |
/projects/:projectId |
DELETE | Query parameter with projectId |
Deletes a specific project through it's id |
Requests
-
GET:
/projects/5fd537a24c1f4316c1d21f2d
-
POST:
/projects
{
"title": "New Project Test 2",
"description": "Project description Test",
"tasks": [
{
"title": "New task Test 2",
"assignedTo": "5fd537a24c1f4316c1d21f2d"
},
{
"title": "Another task Test 2",
"assignedTo": "5fd537a24c1f4316c1d21f2d"
}
]
}
-
PUT:
/projects/5fd537a24c1f4316c1d21f2d
-
DELETE:
/projects/5fd537a24c1f4316c1d21f2d
The project was developed using this technologies:
# Clone this repository
$ git clone https://github.com/cassiocappellari/node-express-mongodb-app.git
# Enter the project folder
$ cd node-express-mongodb-app
# Install the dependencies
$ npm install
# Start the project
$ node src/index.js
CΓ‘ssio Cappellari
- GitHub: @cassiocappellari
- LinkedIn: @cassiocappellari
This project is under the MIT license.
Developed with π by CΓ‘ssio Cappellari!