Skip to content

Commit

Permalink
Convert all image tags used in markdown
Browse files Browse the repository at this point in the history
Fixes #32
  • Loading branch information
wisammechano committed Jul 3, 2022
1 parent f99917d commit 871f2a8
Show file tree
Hide file tree
Showing 15 changed files with 264 additions and 102 deletions.
Original file line number Diff line number Diff line change
@@ -1,55 +1,66 @@
# Introduction to Backend

Welcome to your first lesson of the Backend Web Development Bootcamp! The objectives of this lesson are:

1. To understand the roles of frontend developer vs backend developer vs fullstack developer
2. To get familiar with the basics of backend web architecture

Here we go!

## Frontend Developer vs Backend Developer vs Fullstack Developer

As of June 2021, it is estimated that the Internet contains more than 1.8 million websites. No doubt that this a great time to start a career as a web developer, the people who are responsible for coding, building, analyzing, and maintaining all those websites.

If you have some experience with web development or have been reading about it, then you already know that web development tends to break down into three main concentrations: frontend, backend, and fullstack.

### What is a Frontend Developer?

The frontend of a website is the visible part that users interact with. It is also called the User Interface (UI). Everything that you see when you're navigating around the Internet, from text, fonts and colors to buttons, dropdown menus and sliders, are a combination of HTML, CSS, and JavaScript being rendered and controlled by your computer's browser.

A frontend developer is responsible for writing and maintaining the code for the user interface of the website and the architecture and functionality for the user experience of the website. Frontend developers must be competent in HTML, CSS and Javascript as their foundation along with one or more modern frameworks like ReactJS, AngularJS, VueJS, EmberJS, BackboneJS, Foundation or Svelte. They also work with UI libraries like Sass, Bootstrap, Tailwind, React Bootstrap, Material UI, Ant Design and Semantic UI and tools like Babel, Webpack and Gatsby.

Frontend developers are sometimes seen as a combination of a user interface designer, user experience designer and software developer – someone who appreciates the aesthetic, usability as well as functionality of an application. They care about delivering the features and functionalities, but they also go the extra mile to ensure the user interface is aesthetically pleasing and the experience is seamless. A great frontend developer is not only proficient in programming but also good at empathising with the end users.

<img src="https://drive.google.com/uc?export=view&id=1EiN2DOjCpmS05ZLyrT73kVhM34Ne0S5-" width="70%">
![](https://drive.google.com/uc?export=view&id=1EiN2DOjCpmS05ZLyrT73kVhM34Ne0S5-" width="70%)

### What is a Backend Developer?

But where does all the data to be displayed on the frontend come from? How is a website personalized for the logged in user? This is where the backend comes in. The backend of a website consists of a server, an application, and a database.

A backend developer builds and maintains the code that powers those components which together enable the user-facing side of the website to even exist in the first place. Backend developers must be competent with one or more server-side languages such as JavaScript (Node.js), Ruby, Python, PHP or Java, frameworks like ExpressJS, Ruby on Rails, Python Django and databases like MySQL, PostgreSQL or MongoDB. They are also familiar with Linux as a deployment environment and DevOps tools like AWS, GCP, Apache, Nginx, Docker and Kubernetes.

Backend developers need to be able to navigate across larger codebases and not get lost in the complexities. They also need to be very meticulous when making changes to not "break" anything as there are usually delicate dependencies. Even frontend codebases are large and complex with delicate dependencies, but unlike frontend development where the written code translates directly to visual output one can see and interact with, backend development of business logic is often hard to visualise. Therefore to be a good backend developer, you need to be comfortable with dealing with abstracts.

<img src="https://drive.google.com/uc?export=view&id=1PkIrF_pNnGbX1NiW-q1JIKokql1v4FI7" width="50%">
![](https://drive.google.com/uc?export=view&id=1PkIrF_pNnGbX1NiW-q1JIKokql1v4FI7" width="50%)

### What is a Fullstack Developer?

A jack of all trades? Pretty much! Often there isn't a black-and-white distinction between frontend and backend development. Frontend developers sometimes need to understand backend concepts like how REST APIs work and backend developers sometimes need to understand how components are rendered with data in their state.

The role of a fullstack developer was popularized by Facebook's engineering department. The idea is that a fullstack developer can work cross-functionally on the full "stack" of technology, both the frontend and backend. They are capable of performing both frontend and backend tasks and have a complete understanding of how a web application works, and how the "front" and the "back" are connected. They can build a complete web application on their own. In the current digital economy, companies are looking for such cross-discipline developers or generalists.

To be a good fullstack developer, you need to be comfortable with dealing with abstracts as well as empathising with end users. Good fullstack developers also need to know when to wear which hat to work effectively and efficiently because there will always be division of responsibilities

<img src="https://drive.google.com/uc?export=view&id=13hdTlUW0tk0J91wV-r7ruPX7uATpt9pe" width="50%">
![](https://drive.google.com/uc?export=view&id=13hdTlUW0tk0J91wV-r7ruPX7uATpt9pe" width="50%)

## Backend Web Architecture

Let's start diving deeper into what do we mean when we say frontend and backend. The frontend is the code that is executed on the client side. This code runs in the user's browser and creates the user interface. The backend is the code that runs on the server, receives requests from the clients, and contains the logic to send the appropriate data back to the client. The backend also includes the database, which will persistently store all of the data for the application.

### What are clients?

The clients are entities that send requests to the backend. They are often browsers that make requests for the HTML and JavaScript code that they will execute to display websites to the end user. However, there are many different kinds of clients: they might be a mobile application, an application running on another server, or even a web enabled smart appliance.

### What is a backend?

The backend is all of the technology required to process the incoming request and generate and send the response to the client. This typically includes three major parts:

- **Server**: This is the computer that receives requests and sends responses.
- **Application**: This is the application running on the server that processes the requests, retrieves information from the database, and sends a response.
- **Database**: This is used to organize and persist data.

### What is a server?

A server is simply a computer that listens for incoming requests. Though there are machines made and optimized for this particular purpose, any computer that is connected to a network can act as a server. In fact, you will often use your very own computer as a server when developing apps.

The term "server" is also very often used to refer directly to the backend application running on the server. For example, if we build a backend application to manage the student data of a university, we can refer to it as the student server. When you hear a developer say "the server has crashed", they could either mean the backend application has crashed due to an error in the code or the server running the application has crashed due to a hardware issue.
Expand All @@ -59,15 +70,18 @@ Frontends also have servers. Technically when you build a website or a web appli
Once we start building our backend applications we will observe the use of this term more in action.

### What kinds of responses can a server send?

The data that the server sends back can come in different forms. For example, a server might serve up an HTML file, send data as JSON, or it might send back only an HTTP status code. You've probably seen the status code "404 - Not Found" whenever you've tried navigating to a URI that doesn't exist, but there are many more status codes that indicate what happened when the server received the request.

> Okay I want to see some code now!
We heard you. In the next lesson, we will learn about Node.js which will be the primary server-side programming framework that we will be using throughout this bootcamp.

---

## References

- https://www.freecodecamp.org/news/front-end-developer-vs-back-end-developer-definition-and-meaning-in-practice
- https://www.udacity.com/blog/2020/12/front-end-vs-back-end-vs-full-stack-web-developers.html
- https://sg.alphacamp.co/2018/07/31/what-kind-of-web-developer-should-you-be/
- https://www.codecademy.com/articles/back-end-architecture
- https://www.codecademy.com/articles/back-end-architecture
Original file line number Diff line number Diff line change
@@ -1,46 +1,51 @@
# Beginners guide to Node.js and NPM

We will be working in the Node.js and NPM environment throughout this bootcamp. The objectives of this lesson are:

1. Understanding the Node.js framework
2. Advantages of Node.js and why this course is focussed on Node.js

## Introduction to Node.js

Is it a programming language? Is it a library? No, it's Node.js. In simple words, Node.js is nothing but JavaScript running on the server-side, and it's awesome.

<img src="https://drive.google.com/uc?export=view&id=1oaHgcGKcrKbW6G-gFsncV95WhVmc40M7">
![](https://drive.google.com/uc?export=view&id=1oaHgcGKcrKbW6G-gFsncV95WhVmc40M7)

But to be specific, Node.js is an open-source, cross-platform, backend JavaScript runtime environment that runs on the V8 engine and executes JavaScript code outside a web browser.

And here is what a common Hello World code in Node.js would look like:

```js
const http = require('http')
const http = require("http");

const hostname = '127.0.0.1'
const port = 3000
const hostname = "127.0.0.1";
const port = 3000;

const server = http.createServer((req, res) => {
res.statusCode = 200
res.setHeader('Content-Type', 'text/plain')
res.end('Hello World\n')
})
res.statusCode = 200;
res.setHeader("Content-Type", "text/plain");
res.end("Hello World\n");
});

server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`)
})
console.log(`Server running at http://${hostname}:${port}/`);
});
```

Using the http module, one of many useful Node.js libraries, an HTTP server is created. The server is set to listen on a specified hostname and port. When the server is ready, the callback function is called, in this case informing us that the server is running. Whenever a new request is received from a client, the request event is called, providing two objects: a request and a response. The first provides details of the request, although not used in this example, and the second is used to return data to the client.

You will learn more about the keywords mentioned in this code block throughout this module.

### Some brief history first

Node.js is only 12 years old, not a long time in tech. In comparison, JavaScript itself is more than 20 years old, and we know that it is what runs in our browsers. JavaScript was created at Netscape, which also tried to create LiveWire, an attempt at server-side JavaScript. Unfortunately, it wasn't very successful and server-side JavaScript did not grow in popularity until the introduction of Node.js in 2009.

One key factor that led to the rise of Node.js was the timing. Just a few years earlier, JavaScript had started to be considered as a more serious language, thanks to "Web 2.0" applications (such as Flickr, Gmail, etc.) that showed the world what a modern experience on the web could be like. JavaScript engines also became considerably better as many browsers competed to offer users the best performance. Development teams behind major browsers worked hard to offer better support for JavaScript and find ways to make JavaScript run faster. The engine that Node.js uses under the hood, V8 (also known as Chrome V8 for being the open-source JavaScript engine of The Chromium Project), improved significantly due to this competition.

When Ryan Dahl wrote Node.js, one of his motivations was the limited possibilities of the most popular web server in 2009, Apache HTTP Server, to handle a lot of concurrent connections and the most common way of creating code which either blocked the entire process or implied multiple execution stacks in the case of simultaneous connections. A Node.js app runs in a single process, without creating a new thread for every request. Node.js provides a set of asynchronous I/O primitives in its standard library that prevent JavaScript code from blocking and generally, libraries in Node.js are written using non-blocking paradigms, making blocking behavior the exception rather than the norm.

### Features of Node.js

Firstly, though `.js` is the standard filename extension for JavaScript code, the name "Node.js" doesn't refer to a particular file in this context and is merely the name of the product. It can also be written as "NodeJS" or simply "Node".

1. **Speed**: Having been built on Google Chrome's V8 JavaScript engine, Node.js is extremely fast for code execution.
Expand All @@ -51,11 +56,12 @@ Firstly, though `.js` is the standard filename extension for JavaScript code, th

Node.js is written with C, C++ and JavaScript and uses libuv underhood to handle asynchronous events. Libuv is an abstraction layer for network and file system functionality on the OS.

<img src="https://drive.google.com/uc?export=view&id=18ys74BkK9tzQ6u8avgVw9seweoXY6GnA" width="60%">

![](https://drive.google.com/uc?export=view&id=18ys74BkK9tzQ6u8avgVw9seweoXY6GnA" width="60%)

### NPM and Packages in Node.js

One of the major factors of Node's success is npm - its popular package manager, which allows JavaScript developers to share useful packages quickly and easily. NPM – or "Node Package Manager" – is the default package manager for JavaScript's runtime Node.js. NPM consists of two main parts:

- a CLI (command-line interface) tool for publishing and downloading packages, and
- an online repository that hosts JavaScript packages</br>

Expand All @@ -66,7 +72,9 @@ When we have a remote package in our project, it is called as a dependency since
Node.js also ships with a collection of [built-in packages](https://nodejs.org/api/index.html) called as Node Standard Library. These packages are essential to perform low-level operations like File System I/O and Networking. We do not have to install them using NPM.

### How much JavaScript should I know to use Node.js?

As a beginner, it can be difficult to understand where does JavaScript end, and where Node.js begins, and vice versa. However, when you're writing code for a Node.js application you are writing JavaScript. So, it is important to grasp the fundamentals of JavaScript syntax such as:

- Lexical Structure
- Expressions
- Types
Expand All @@ -86,6 +94,7 @@ As a beginner, it can be difficult to understand where does JavaScript end, and
- ECMAScript 6 or ES6

Also, as asynchronous programming is the core of Node.js it is important to understand concepts like:

- [Asynchronous programming and callbacks](https://nodejs.dev/learn/javascript-asynchronous-programming-and-callbacks)
- [Timers](https://nodejs.dev/learn/discover-javascript-timers)
- [Promises](https://nodejs.dev/learn/understanding-javascript-promises)
Expand All @@ -96,6 +105,7 @@ Also, as asynchronous programming is the core of Node.js it is important to unde
If you're interested to dive deeper into understanding Node.js, [here](https://nodejs.dev/learn/introduction-to-nodejs) is a learning path that you can follow.

## Why are we teaching Node.js in this bootcamp?

From the previous lesson or previous experience, you might already be familiar with other server-side languages like Python, PHP, Ruby or Java. So why did we choose to teach Node.js?

1. **Popularity**: Node.js has been consistently growing in popularity since it's introduction. As per the [Stackoverflow developer survey of 2021](https://insights.stackoverflow.com/survey/2021), JavaScript is the most popular language for 9 years in a row and Node.js has moved up to be the 6th most popular technology. Many companies that we have got in touch with have expressed interest in hiring more Node.js developers.
Expand All @@ -107,12 +117,14 @@ From the previous lesson or previous experience, you might already be familiar w
Now that you have enough context on Node.js, let's prepare our coding environments on our computers. Coming up next is your first assignment of this course which will walk you through setting up your Node.js environment.

---

## References

- https://medium.com/jspoint/introduction-to-node-js-a-beginners-guide-to-node-js-and-npm-eca9c408f9fe
- https://en.wikipedia.org/wiki/Node.js
- https://www.simplilearn.com/tutorials/nodejs-tutorial/what-is-nodejs
- https://www.simform.com/blog/what-is-node-js/#section2
- https://www.freecodecamp.org/news/what-is-npm-a-node-package-manager-tutorial-for-beginners/
- https://nodejs.dev/learn/introduction-to-nodejs
- https://medium.com/jspoint/how-javascript-works-in-browser-and-node-ab7d0d09ac2f
- https://www.geeksforgeeks.org/top-8-reasons-to-learn-nodejs-in-2020/
- https://www.geeksforgeeks.org/top-8-reasons-to-learn-nodejs-in-2020/
Loading

0 comments on commit 871f2a8

Please sign in to comment.