Get started to My API REST:
Conexion a la Base de Datos de Postgres
Creat your account --------> /api/v1/customer
You must creat your account first
Send:
name, lastName, phone, user: {email and password}
with "POST" in Insomnia or in your Frontend
Log in -----> /api/v1/auth/login
Then you must log in to obtain your authentication token
Send:
email and password with "POST"
in Insomnia or in your Frontend
Users ->
Users have a one-to-one relationship with customers.
Customer ->
Customers have a one-to-one relationship with Users and also a one-to-many relationship with Orders.
Categories ->
Categories have a one-to-many relationship with Products.
Products ->
Products have a many-to-one relationship with Categories and also a many-to-many relationship with Orders.
Orders ->
Orders have a many-to-one relationship with users and also a many-to-many relationship with products.
Order-Products ->
Order-Products is the ternary table that enables the many-to-many connection between Orders and products.
Profile ->
Show how many orders you have, send your token too.
Recover your password -------> /api/v1/auth/recovery
Send a recovery token to your email
Send:
email with "POST"
in Insomnia or in your Frontend
Get the token in the "params" of the link
Change of password ----> /api/v1/auth/change-password
Send a recovery token
Send:
token:"recoveryToken" and newPassword
with "POST" in Insomnia or in your Frontend
Ready!! You changed your password