You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: module1-introduction-to-backend/README.md
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,9 @@
1
1
# Module 1: Introduction to Backend
2
2
3
+
Last Revised: 05/10/2021
4
+
3
5
## Summary
4
-
Writing backend code requires an intimate understanding of REST and the requestresponse lifecycle. Students learn how to build and run a local server with API endpoints
6
+
Writing backend code requires an intimate understanding of REST and the request-response lifecycle. Students learn how to build and run a local server with API endpoints
5
7
using Node.js and Express.js, handle GET, POST, and other HTTP requests, perform
6
8
validations and return a response.
7
9
@@ -21,19 +23,15 @@ validations and return a response.
21
23
22
24
3 [Introduction to Express.js [R]](../module1-introduction-to-backend/r3-introduction-to-expressjs/README.md)
23
25
24
-
3.1 [Express.js hello world application [L]](../module1-introduction-to-backend/r3.1-expressjs-hello-world/README.md)
25
-
26
-
3.2 [Express.js real world application [L]](../module1-introduction-to-backend/r3.2-express.js-real-world/README.md)
3.3 [Additional practice with routes/functions on Express application [L]](../module1-introduction-to-backend/r3.3-expressjs-additional-practice/README.md)
28
+
3.2 [Express.js Meme API [L]](../module1-introduction-to-backend/r3.2-express.js-meme-api/README.md)
29
29
30
-
3.4 [API best practices [R]](../module1-introduction-to-backend/r3.4-api-best-practices/README.md)
30
+
4 [API best practices [R]](../module1-introduction-to-backend/r4-api-best-practices/README.md)
Copy file name to clipboardExpand all lines: module1-introduction-to-backend/r1-introduction-to-backend/README.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,9 +11,9 @@ As of June 2021, it is estimated that the Internet contains more than 1.8 millio
11
11
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.
12
12
13
13
### What is a Frontend Developer?
14
-
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, is a combination of HTML, CSS, and JavaScript being rendered and controlled by your computer’s browser.
14
+
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 menusand sliders, are a combination of HTML, CSS, and JavaScript being rendered and controlled by your computer's browser.
15
15
16
-
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, Gatsby.
16
+
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.
17
17
18
18
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.
19
19
@@ -31,35 +31,35 @@ Backend developers need to be able to navigate across larger codebases and not g
31
31
### What is a Fullstack Developer?
32
32
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.
33
33
34
-
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.
34
+
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.
35
35
36
36
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
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.
41
+
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.
42
42
43
43
### What are clients?
44
44
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.
45
45
46
46
### What is a backend?
47
47
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:
48
-
-The server. This is the computer that receives requests and sends responses.
49
-
-The app. This is the application running on the server that processes the requests, retrieves information from the database, and sends a response.
50
-
-The database. Databases are used to organize and persist data.
48
+
-**Server**: This is the computer that receives requests and sends responses.
49
+
-**Application**: This is the application running on the server that processes the requests, retrieves information from the database, and sends a response.
50
+
-**Database**: This is used to organize and persist data.
51
51
52
52
### What is a server?
53
-
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 server when developing apps.
53
+
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.
54
54
55
-
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 sever 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.
55
+
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.
56
56
57
57
Frontends also have servers. Technically when you build a website or a web application, you will be hosting it on a service like Netlify or Heroku, which means it will live on a server. However, each time a new user visits this site from their browser, the server will send the HTML to the user's browser where it will then start running as a client.
58
58
59
59
Once we start building our backend applications we will observe the use of this term more in action.
60
60
61
61
### What kinds of responses can a server send?
62
-
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.
62
+
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.
Copy file name to clipboardExpand all lines: module1-introduction-to-backend/r1.1-beginners-guide-nodejs-npm/README.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ We will be working in the Node.js and NPM environment throughout this bootcamp.
4
4
2. Advantages of Node.js and why this course is focussed on Node.js
5
5
6
6
## Introduction to Node.js
7
-
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.
7
+
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.
Using the http module, one of many useful Node.js libraries, an HTTP server is created. The server is set to listen on the specified host name 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.
32
+
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.
33
+
34
+
You will learn more about the keywords mentioned in this code block throughout this module.
33
35
34
36
### Some brief history first
35
37
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.
@@ -39,7 +41,7 @@ One key factor that led to the rise of Node.js was the timing. Just a few years
39
41
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.
40
42
41
43
### Features of Node.js
42
-
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.
44
+
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".
43
45
44
46
1.**Speed**: Having been built on Google Chrome's V8 JavaScript engine, Node.js is extremely fast for code execution.
45
47
2.**Rich libraries**: Node Package Manager (NPM) has more than 50,000 bundles or libraries, so whatever functionality is required for an application can be easily imported from NPM.
@@ -56,11 +58,11 @@ One of the major factors of Node's success is npm - its popular package manager,
56
58
- a CLI (command-line interface) tool for publishing and downloading packages, and
57
59
- an online repository that hosts JavaScript packages</br>
58
60
59
-
A package is nothing but a directory that contains a bunch of modules. Some popular npm packages are [lodash](https://lodash.com/) and [moment](https://momentjs.com/). Node.js has a wide community that develop good packages for everybody to use.
61
+
A package is nothing but a directory that contains a bunch of code modules. Some popular npm packages are [lodash](https://lodash.com/) and [moment](https://momentjs.com/). Node.js has a wide community that develop good packages for everybody to use.
60
62
61
63
When we have a remote package in our project, it is called as a dependency since our project depends on it. We need to keep track of our dependencies or at least list them down somewhere. We list all our dependencies inside a `package.json` file which is a JSON file that contains some information about our project and dependencies it needs. This file is essential for NPM.
62
64
63
-
Node.js also ships with a collection of [built-in packages](https://nodejs.org/api/index.html) called as a 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.
65
+
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.
64
66
65
67
### How much JavaScript should I know to use Node.js?
66
68
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:
@@ -70,7 +72,7 @@ As a beginner, it can be difficult to understand where does JavaScript end, and
0 commit comments