Getting Started • API Endpoints • Collaborators • Contribute
Recicle mais is a recycling flow control app that allows, with practicality, agile communication between a recycler and a collector so that the materials to be recycled reach the collection point.
How to clone your project
git clone git@github.com:yraffic02/recicle-mais-back.git
npm install
npx prisma generate
npx prisma migrate dev --name init
npx prisma migrate dev
- [NodeJS]
- [Nest]
- [JWT]
- [bcrypt]
- [Prisma]
- [Cors]
- [Swagger]
How to start the back-end project
npm run start:dev
Here has the list of the main routes until now, and what are their expected request bodies.
ROUTES | DESCRIPTION |
---|---|
POST /user | register user |
POST /login | user login |
POST /user/profile | show logged user |
PUT /update-user | update user |
PUT/reset-pass | reset user password |
DELETE /delete-user | delete selected user |
To register user, example :
BODY REQUEST
{
"fullname": "Carlos Caldeira",
"password": "123456",
"email": "carloscaldeira@gmail.com",
"phone": "71933333333",
"user_type": "coletor",
"address": "Rua Canario, nº 12",
"city": "São Paulo",
"state": "SP",
"zip_code": "04444-444",
"user_type": "cliente",
"avatar": "url/imagem"
}
RESPONSE
{
"id": 2,
"fullname": "Carlos Caldeira",
"password": "$2b$10$0vYiRJL73/tBV2CStfGXz.sPvd2zHXBM8LIqnLNgZGexZm4u48vUq",
"email": "carloscaldeira@gmail.com",
"phone": "71933333333",
"user_type": "coletor",
"address": "Rua Canario, nº 12",
"city": "São Paulo",
"state": "SP",
"zip_code": "04444-444",
"user_type": "cliente",
"avatar": "url/imagem"
}
To log in and receive an authentication token, example:
BODY REQUEST
{
"email": "carloscaldeira@gmail.com",
"password": "123456"
}
RESPONSE
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEsImlhdCI6MTcxMDE2MzE5NCwiZXhwIjoxNzEwMjQ5NTk0fQ.mq9vh35k_P_4GTO--Pi2hVkH1ipraFN6rIhVvbblEKE"
}
To show the logged in user profile.
RESPONSE
"id": 2,
"fullname": "Carlos Caldeira",
"password": "$2b$10$0vYiRJL73/tBV2CStfGXz.sPvd2zHXBM8LIqnLNgZGexZm4u48vUq",
"email": "carloscaldeira@gmail.com",
"phone": "71933333333",
"user_type": "coletor",
"address": "Rua Canario, nº 12",
"city": "São Paulo",
"state": "SP",
"zip_code": "04444-444",
"user_type": "cliente",
"avatar": "url/imagem"
To edit user information. Protected route the user must be logged in. Example:
BODY REQUEST
{
"fullname": "Carlos Caldeira",
"password": "123456",
"email": "carloscaldeira@gmail.com",
"phone": "71933333333",
"user_type": "coletor",
"address": "Rua Canario, nº 12",
"city": "São Paulo",
"state": "SP",
"zip_code": "04444-444",
"user_type": "coletor",
"avatar": "url/imagem"
}
RESPONSE
{
"message": "Dados atualizados com sucesso"
}
To request password reset. Protected route the user must be logged in. Example:
BODY REQUEST
{
"email": "carloscaldeira@gmail.com",
}
RESPONSE
{
"message": "Um e-mail com a nova senha foi enviado."
}
To delete user logged. Protected route the user must be logged in. .
RESPONSE
Usuário removido com sucesso.
Back-end developers
Glaucia Castro |
Isabel Diana |
Eduardo L. Nunes |