ngiachou / WalletHero

A hero we all deserve. Tracking your monthly costs was never been so much fun.
GNU General Public License v3.0
0 stars 0 forks source link

Building a user-registration functionality #32

Closed pagidas closed 5 years ago

pagidas commented 5 years ago

I guess the very first step for someone to use our app is to supply the ability to register him or herself in our system. I think it's not the time to over-complicate things such as password encryption and security issues.

I suggest we build the bare-minimum of this functionality: a user puts his name, surname, username and password in a form, pushes the submit button and all these fields (given that he put them all) are sent to the API which creates that user. If all the fields required are not put then a BAD-REQUEST is sent back to the client explaining what is missing.

Since the mock-up for registration is ready, @elpaxoudis I propose the following client-server contract so the logic behind submit button can be implemented:

POST /register
Content-Type: application/json
Request body
{
     "user":{
          "name":"Nikos",
          "surname":"Giachoudis",
          "username":"nikosgiachou",
          "password":"123"
     }
}

The values to the keys are examples, but the structure has to be the same.

Having this contract I will write the logic when requesting the API to create the user. Lastly, @elpaxoudis if you have any idea what could be the response back to the client, put your thoughts here! It could be just the user created... same as the above, supplied with status: "OK", code: "201" (created)

ngiachou commented 5 years ago

I guess we'll go with the response of the object that was created in JSON format, right?

ngiachou commented 5 years ago

BTW @pagidas is this issue related to both ends (front & back) of the app?

pagidas commented 5 years ago

This issue is the entry point of this functionality, so yes, on both ends. If a problem arises on a specific end, then we can address it in a different issue

ngiachou commented 5 years ago

Alrighty then, maybe we should mention this issue to any other related issue, which is specific to an end.