DEV Community

Code_Regina
Code_Regina

Posted on

Week 6: Backend Basics and the Command Line

This week was Backend Basics and the Command Line from Colt Steele The Web Developer Bootcamp.

   -Introduction to Backend 
   -HTTP in Depth
   -CD and LS
   -Touch and Mkdir 
   -Removing Files and Folders
Enter fullscreen mode Exit fullscreen mode

Introduction to Backend

Domain Name Service (DNS)

works by translating a URL into an IP address.
www.website.com -> 23.242.60.175
A request is sent to the desired IP address via HTTP. The request finds the fastest path possible path to the server with the specified IP. This is not a direct journey. It requires hoping from server to server until it reaches the correct destination.

Static vs. Dynamic

Static is when the content stays the same and does not change at all.
Dynamic is when the content is updated from the server in real-time, such as refreshing a web page to see the latest information posted.
There are many different technologies stacks. There are front-end stacks, back-end stacks, and full-stack that utilized both front and backend stacks together.
HTML/CSS/JavaScript will always be a front-end stack.
A backend stack can be created from different technologies.

This is full-stack

Backend Server Database
Java/C#/Python/Node.js IIS/Apache/Express MySql/NoSQL/MongoDB

The stack that I will be focusing on for this entire course

Backend Server Database
Node.js Express MongoDB
Backend: To process the server code
Frontend: To process the client code
Database: To store the client and server side data.

HTTP in Depth

https://www.postman.com/ Allows us to make HTTP request and view responses to understand how things are working and to debug potential problems.

The internet functions by the request -> response cycle. A request is made and then the server responds by giving you one back.
HTTP request are independent from browsers. URL are used to make request using HTTP verbs.
HTTP verbs are

             put
             post 
             patch
             get 
             delete
Enter fullscreen mode Exit fullscreen mode

which all work to tell the server what we want to do with that request.
The only request that we can make are GET request to the server. URL function by contain a query string
There are three important parts to every response the body is the payload that is being sent back which is the HTML/CSS/JavaScript. HTTP headers are metadata from the response. The content type tells us what is being sent back which is text/html. It is possible to see the date/time/status of a request.
Body: is the content that is being sent back.
Headers: Contain metadata about the response.

CD and LS

CD is change directory. It is used to change the current directory and to navigate through file structures.

LS is use to list files and folders in the current directory.

Touch and Mkdir

Touch is used to create new files.

Mkdir is used to create new folders.

Removing Files and Folders

rm is used to remove files

rm -rf will force delete all files and folders

Overall, I am excited to learn how so many different technologies work together to produce the infrastructure that powers the internet that makes this all possible.

Top comments (3)

Collapse
 
mikenikles profile image
Mike • Edited

A few small tricks I find useful with the commands you shared:

cd
cd - changes back to the previous directory you were in
cd brings you to the user's home directory
cd $_ takes the last argument of the previous command and changes to that directory. See the mkdir example below.

ls
ls -lh . lists all files and current directory, with human-friendly size values (e.g. KB, MB) instead of bytes

mkdir
mkdir -p non/existing/directories creates a directory and all parent folders if they don't exist.

Bonus
What happens if you run the following commands?

mkdir -p non/existing/directories
cd $_
Collapse
 
yougotwill profile image
Will G

Nice! I'm wrapping my head around backend now so looking forward to future posts :)

Collapse
 
rockarts profile image
Steven Rockarts

Don't forget about HEAD as an http verb, it's like GET but doesn't include the body. It can be useful for caching purposes, you can check if a resource has changed before deciding to download it.