Recently, I attended a hackathon with some coursemates and the challenge was to build a full stack polling application within 16 hours from the time the challenge was introduced. As most of us were more familiar with the frontend framework, and I was the only one who has some experience in the backend. I was tasked to build the backend API.
Of course I could build a microservice with Golang but that would take me a much longer time to get it up and running with documentation and web UI features. Thus, after much research our team decided to try out using Django to handle all our backend services.
What are APIs?
APIs (Application Programming Interface)[https://en.wikipedia.org/wiki/API] are a set of functions that allows other applications to interact or access the data. I presume it would be like a cable which connects your computer to your monitor. So your monitor uses the cable (API) to display the information that is generated by your computer.
What is REST then?
REST (Representational State Transfer)[https://en.wikipedia.org/wiki/Representational_state_transfer] is an software architectural style that defines a set of constraints to be used for web services. This is perhaps our request/response from HTTP.
How about RESTful API?
When you combine them both perhaps this would be what we all know as the (GET, PUT, POST, UPDATE, DELETE) commands in an API ? It seems so a little googling skills and this popped out as the answer. (Restful API)[https://searchapparchitecture.techtarget.com/definition/RESTful-API] credit: (Techtarget)[https://www.techtarget.com] for the definition.
Why did we try Django?
However, after reflecting on the hackathon. I think that we should have settled building a backend with Node.js or Express.js. Which would then allow us to easily implement the connection to the frontend.
When we built both the Frontend and Backend, we realised that we did not know how to connect them together. The APIs work with authentication and using POSTMAN we were able to create users, login and receive the authentication token. But we had no experience or knowlege how to make use of the authentication to persistently allow the frontend to make use of the RESTful APIs commands.