Going through all this material really made me realise that what I really would like is to be able to build complex web applications with databases and APIs that can serve all sorts of clients. For this reason, I have chosen to focus on option three: Full Stack and Back End option.
At the same time, I also realise that user experience is important and that to know how to make a website that is pleasant to look at should also appear on the todo list of a full stack developper.
This this in mind, I decided explain here what I learned about APIs and also use CSS and JavaScript to implement a nightmode for this page.
APIs enable computers to communicate with each other and exchange data. This is particularly useful if you want to use the services of other platforms to enhance your application or simplify its build. Usually, APIs use XML or JSON to communicate
XML was invented in the 1990's to facilitate computer to computer communication. It is related to html as they have a common ancestor, SGML, invented in the 1980's. Html can actually be expressed as XML, using the type xhtml oin the DOCTYPE.
Some characteristics of xml are:
Python has a built in parser in a library called minidom. It can imported like this: from xml.dom import minidom. This is a lightweight and fast version of the more comprehensive dom (document object model) that can be used to parse gigabits of data.
To parse xml (create an object from code) and store the result in a variable, you can use the following:Overall, make sure to rate-limit yourself to avoid hitting servers too hard and that you write good user-agents so that people building the APIs that use can contact you if something goes wrong.
YouTube Video: This video makes a good job of explaining that one of the main advantages of APIs is that they enable your application to use the services of larger websites and/or applications. While a normal user would have to log into Facebook or Google using their website, an API enables your application to bypass this and talk directly to their backend.
The basics of APIs: This is another course from General Assembly that is available from Udemy. It goes through two APIs. The first one is Stripe which is a solution enabling websites to take credit card payments without having to handle the security aspects of it. It handles both individul payments and subscription. Whilst the demonstration was in PHP, the main ideas remained the same: set up a Stripe account, get some API keys, code in the payment form and handle errors. Then test and go live!
The second API was Twilio, which brings telephony to the cloud and its computing power: "the ability to plug your phone to your website". AirBnB and Uber use it to enable providers and customers to communicate without exchanging contact details. The demo was about recreating a telephone queue. This was done using python in the terminal using Flask and Heroku
Various API libraries: there many of them on the web: publicapis.com, programmableweb.com, mashape.com
As far as implementation is concerned, the small form below uses the Wikipedia API to serve the top summary of its article about whichever keyword is entered by the user. It also generates a link to the article if further reading is required.
Combining CSS and JavaScript can be very useful to design web pages that will render well on any browser and on screens of any size.
I had a lot of pleasure experimenting with the Dash tool created by General Assembly and it really made me realise how flexible web-design can be. Here is the list of links to my practice exercises:
It inspired me to use JQuery to create a "Night mode" button accessible on the left hand side.