Fundamentals of node JS
Frontend vs Backend development
Frontend development is simply about everything that happens on the client side. Its about designing and building a website that will be visible to the user. The frontend requires three technologies: HTML, CSS and JavaScript. Frontend is basically about designing the user interface(UI). It also involves the use of frameworks like react, angular and view.
Backend development is all about everything that happens on the server, it includes everything that is invisible to the user.
What is a server
A server is simply a computer that is connected to the internet which can be accessed by other computers or devices. The server stores the website static files like the HTML document, CSS, JavaScript files, images and so on. It also runs an HTTP server that is capable of understanding URLS, receiving requests and also delivering responses. The server is the bridge between the frontend and the backend of a web application.
When we build a dynamic website, we use a database and this database can be accessed right from our backend application. The backend application also contains the code to fetch data from the database, add, update or delete data from the database. In the database we store information like user or product details, application data or some texts to fill up the website templates.
What is web api
API stands for Application Programming Interface.
API is a piece of software that can be used by another piece of software to allow applications communicate with each other
Web API allows only json data to be sent as response to the webpage
All browsers have a set of built-in Web APIs to support complex operations, and to help accessing data.
When building a web API powered website, there are two steps involved: Building an API and consuming that API on the client side. In the first step, we create an API which is hosted on the server and on the client side the website is assembled by plugging the data that we receive into some sort of template. These templates are usually built using some frontend framework or library.
Static websites
The static website is the simplest type of website. In this case the developer uploads the final ready to be served file of the website onto the server. This files usually contains HTML, CSS, JavaScript and images of the websites and its these exact files the server will send to the client or to the browser when the website is requested and the browser will render these files as a web page. In the case of the static website, there is no work done on the server and there is no backend code or any backend application running on the server.
Dynamic websites
Dynamic websites are usually built on the server. They usually contains a database and there is always a backend application running on the server. These backend applications can be built using node JS, Python, PHP, C# and so on. In this case, the content of the website is built based on the data coming from the database and this data can change anytime according to the content in the database or user action on the webpage.
That's all for this lesson.
Next: Understanding REST architecture.
See you soon๐๐ซกโ๐ผ...