The API completion of my project brought me to the new issue. It is about how to integrate these two: backend and frontend. It is like the story of Panchatantra in which four new graduate student trying to give life to a dead lion. Here I am at the stage of the third student working who chants mantras and gives life to the lion. Well, I have more to do rather than chanting some mantras as mantras are not building blocks.
My project contained three screens except; login and signup. But, the home page is just for show and some information. So, it won’t need any integration. In that place, I will be integrating login and signup pages. As previous blogs in Hasura Internship category says that it has to be JSON when a request to hasura is made. So, we have to convert HTML form data to JSON structure.
When a user is signed up and logged in, we also need to keep them remembered. You can do it in many ways. By making a hidden form which contains token or you can make a cookie. It is told that if you make a cookie, then you and your user will be safe and work better as every new request will already contain the authentication token without any dilly dally.
This part of UI integration can be called as authentication management part. The next two pages integration will be for data management. Till then 🙂