This week started off with me making a terrible mistake. Dr. Shawn asked me to restructure the code as we need to start pushing any work related to front-end to the remote repository. I was instructed to download the zip file from admin-on-rest, unzip the file and push the whole thing into the remote repository. However, I went on git cloning the admin-on-rest repository and pushing it to the project repository, as I had always thought git cloning and zipping process are doing exactly the same thing and had been highly unaware of the potential problem git clone would bring to the project repository. And yes I made a horrible mistake, I accidentally included the whole admin-on-rest repository(which includes its own past changes) into the project repository. The project repository now becomes much larger in terms of the memory size because of the mistake. I feel very sorry and guilty for this. I will remember this forever and will not repeat the same mistake again in the future.
Sad things aside, I have been focusing on integrating back-end with front-end this week. Admin-on-rest implements Fetch API which will send a preflight request(with the http method “OPTION”) before sending an actual request. A knowledge of CORS is required of this and basically there are three headers that need to be taken care of:
To allow certain domains to access the REST API.
Restrict the Methods to be used
To allow certain headers to be exposed to the REST API
Mismatches in headers would result in domains not being able to fetch any resources from the REST API.
I have finished off the basic functionalities of the application with the help from my colleague. We plan to add more features like showing images instead of a plain list of items. Furthermore, there are more things that I definitely have to start thinking about. For instance, the redirect endpoint for Dropbox Login. I have to start figuring out exactly how to implement these on front-end and back-end side. I believe there is a need for me to study React framework if I were to add more exciting complex functionalities to the front-end.