Unit-1 FSD
Unit-1 FSD
Unit - I
Regulation – R20
Subject Code & Name: Full Stack Development Unit - I
2
Subject Code & Name: Full Stack Development Unit - I
3
Subject Code & Name: Full Stack Development Unit - I
Java
Python
Node.js
Database
MongoDB
Sql
Case Study:
Industry definition:
Full Stack Developer is an engineer who can work on different
levels of an application stack. The term stack refers to the
combination of components and tools that make up the
application. The components could be in the front-end or the
back-end of the system.
4
Subject Code & Name: Full Stack Development Unit - I
The back end also consists of logic that can connect the
application to other services and databases. For example, all
the user and transaction data is stored in a database through
specific drivers handled on the back end.
5
Subject Code & Name: Full Stack Development Unit - I
6
Subject Code & Name: Full Stack Development Unit - I
Unit – I
Web Development Basics
Web Development Basics - HTML & Web servers Shell - UNIX CLI Version
control - Git & Github HTML, CSS
1.1 HTML:-
HTML is markup language commonly used to create web
pages.
Hyper Text: Hyper Text simply means "Text within Text." A
text has a link within it, is a hypertext.
Markup Language: It provides a way to describe the structure
of text and graphics on a web page.
HTML is developed and maintained by W3C.
It is derived from Standard Generalized Markup Language
(SGML).
In HTML, the term signifies the navigation from one to another.
HTML Versions:
7
Subject Code & Name: Full Stack Development Unit - I
HTML 1.0:
Only 22 elements
HTML 2.0:
New features, such as tables, image maps, file upload.
HTML 3:
New elements FIG, LIST, LINK, and NOTE added.
HTML 4:
New elements for style sheets, scripts, frames, embedded
objects, complex tables and forms.
HTML 5
It introduces the new elements such as AUDIO, VIDEO
1. Paired Tags: These tags come in pairs. That is they have both
opening (< >) and closing (</ >) tags.
1) Head part:-
2) Body part:-
9
Subject Code & Name: Full Stack Development Unit - I
<!DOCTYPE>
<html>
<head>
<title>
<body>
1.3.1 <!DOCTYPE>
10
Subject Code & Name: Full Stack Development Unit - I
Syntax
<!DOCTYPE html>
1.3.2 <html>
Syntax
<!DOCTYPE html>
<html>
...
</html>
1.3.3 <head>
11
Subject Code & Name: Full Stack Development Unit - I
<title>
<style>
<meta>
<link>
<script>
<base>
Syntax
<!DOCTYPE html>
<html>
<head>
...
</head>
</html>
1.3.4 <title>
12
Subject Code & Name: Full Stack Development Unit - I
Syntax
<!DOCTYPE html>
<html>
<head>
<title> ... </title>
</head>
</html>
1.3.5 <body>
13
Subject Code & Name: Full Stack Development Unit - I
Syntax
<!DOCTYPE html>
<html>
<head>
<title>Body Tag</title>
</head>
<body>
<h1>...</h1>
<p>...</p>
</body>
</html>
Characteristics of HTML
Easy to understand
Flexibility
Linkable
Limitless features
Support
Not a Programming Language
Language Support
Advantages of HTML
HTML is easy to learn, easy to apply and it’s totally free you
will just need a text editor and a browser.
HTML is supported by all the browsers and it is the most
friendly search engine.
14
Subject Code & Name: Full Stack Development Unit - I
Disadvantages of HTML
HTML can be used to create only static Web-page, it cannot
create dynamic web-page.
There is a lack of security in HTML.
Creating a simple Web-page required so many tags.
HTML language is not centralized i.e. all the web pages that
are connected, you have to design them separately else need
to use CSS.
HTML becomes complex when you try to create a huge
website.
15
Subject Code & Name: Full Stack Development Unit - I
16
Subject Code & Name: Full Stack Development Unit - I
17
Subject Code & Name: Full Stack Development Unit - I
Graphical Shells
Graphical shells provide means for manipulating programs
based on the graphical user interface (GUI), by allowing for
operations such as opening, closing, moving, and resizing
windows, as well as switching focus between windows.
Window OS or Ubuntu OS can be considered as a good example
which provides GUI to the user for interacting with the
program. Users do not need to type in commands for every
action.
What is a terminal?
A program which is responsible for providing an interface to a user
so that we can access the shell. It basically allows users to enter
commands and see the output of those commands in a text-based
interface.
18
Subject Code & Name: Full Stack Development Unit - I
19
Subject Code & Name: Full Stack Development Unit - I
20
Subject Code & Name: Full Stack Development Unit - I
cp : This command will copy the files and directories from the
source path to the destination path. It can copy a file/directory
with the new name to the destination path. It accepts the source
file/directory and destination file/directory.
21
Subject Code & Name: Full Stack Development Unit - I
22
Subject Code & Name: Full Stack Development Unit - I
23
Subject Code & Name: Full Stack Development Unit - I
24
Subject Code & Name: Full Stack Development Unit - I
25
Subject Code & Name: Full Stack Development Unit - I
cd IVCSE
26
Subject Code & Name: Full Stack Development Unit - I
8. echo: This command helps us move some data, usually text into a
file.
echo string
10. tar: Used to work with tarballs (or files compressed in a tarball
archive)
27
Subject Code & Name: Full Stack Development Unit - I
28
Subject Code & Name: Full Stack Development Unit - I
Git:-
Git is one of the way of implementing the idea of version control. It is
Distributed Version Control System(DVCS)
Git allows a team of people to work together, all using the same files.
And it helps the team cope with the confusion that tends to
happen when multiple people are editing the same files.
Version control, also known as source control, is the practice of tracking
and managing changes to software code.
Version control systems are software tools that help software teams
manage changes to source code over time.
As development environments have accelerated, version control
systems help software teams work faster and smarter.
They are especially useful for DevOps teams since they help them to
reduce development time and increase successful deployments.
29
Subject Code & Name: Full Stack Development Unit - I
Advantages of Git
1. Free and Open Source: Git is a free and Open source software system
with which the users and programmers can edit, modify or reuse the
software’s source code. It gives developers the opportunity to improve
2. Instant Backup: Data can be instantly retrieved as there are several
copies available.
3. Efficient and Low requirements
4. Staging Area: This is an intermediate area where commits can be
formatted and reviewed before completing the commit. We can manage
which change is needed for which version of the file and stage them for
different commit commands.
Initializing a Repository
If you want to share your project on a version control system and
control it with Git. Then, browse your project's directory and start the
git command line (Git Bash for Windows) here. To initialize a new
repository, run the below command:
Syntax:
$ git init
These files are imported from the repository into the local server of the
user for further updations and modifications in the content of the file.
A VCS or the Version Control System is used to create these versions and
store them in a specific place termed a repository. The process of
copying the content from an existing Git Repository with the help of
various Git Tools is termed cloning. Once the cloning process is done,
the user gets the complete repository on his local machine.
Git by default assumes the work to be done on the repository is as a
user, once the cloning is done. Users can also create a new repository or
delete an existing repository.
31
Subject Code & Name: Full Stack Development Unit - I
Git has three main states that your files can reside in: modified, staged,
and committed:
1. Staged: In this stage, the file is ready to be committed and is
placed in the staging area waiting for the next commit.
2. Modified/Dirty: When the changes are made to the file i.e. the
file is modified but the change is not yet staged.
32
Subject Code & Name: Full Stack Development Unit - I
The staging area is a file, generally contained in your Git directory, that
stores information about what will go into your next commit. Its
technical name in Git parlance is the “index”, but the phrase “staging
area” works just as well.
The Git directory is where Git stores the metadata and object database
for your project. This is the most important part of Git, and it is what is
copied when you clone a repository from another computer.
Working with a Repository
A GIT repository allows performing various operations on it to create
different versions of a project.
33
Subject Code & Name: Full Stack Development Unit - I
2. Add
3. Commit
Git Clone
In Git, cloning is the act of making a copy of any target repository. The
target repository can be remote or local. You can clone your repository
from the remote repository to create a local copy on your system. Also,
you can sync between the two locations.
Syntax:
$ git clone <repository URL>
Adding to a Repository
The git add command is used to add file contents to the Index (Staging
Area).This command updates the current content of the working tree to
the staging area. It also prepares the staged content for the next commit.
Every time we add or update any file in our project, it is required to
forward updates to the staging area.
The git add command is a core part of Git technology. It typically adds
one file at a time, but there some options are available that can add
more than one file at once.
The "index" contains a snapshot of the working tree data. This snapshot
will be forwarded for the next commit.
34
Subject Code & Name: Full Stack Development Unit - I
The git add command can be run many times before making a commit.
These all add operations can be put under one commit. The add
command adds the files that are specified on command line.
We can add single or multiple files at once in the staging area. It will be
run as:
$ git add <File name>
This committing process is done by the use of git commit command. This
command commits the staged changes to the local repository.
Syntax:
$ git commit -m "Add existing file"
This commit command is used to add any of the tracked files to staging area
and commit them by providing a message to remember.
35
Subject Code & Name: Full Stack Development Unit - I
Git Commit
It is used to record the changes in the repository. It is the next command
after the git add. Every commit contains the index data and the commit
message. Every commit forms a parent-child relationship. When we add
a file in Git, it will take place in the staging area. A commit command is
used to fetch updates from the staging area to the repository.
The staging and committing are co-related to each other. Staging allows
us to continue in making changes to the repository, and when we want
to share these changes to the version control system, committing allows
us to record these changes.
36
Subject Code & Name: Full Stack Development Unit - I
As we run the command, it will prompt a default text editor and ask for
a commit message. The text editor will look like as follows:
2) Configure Git
Now let Git know who you are. This is important for version control
systems, as each Git commit uses this information:
37
Subject Code & Name: Full Stack Development Unit - I
Example
git config --global user.name "jegan"
git config --global user.email "[email protected]"
4) Initialize Git
Once you have navigated to the correct folder, you can initialize Git on
that folder:
Example
git init
Initialized empty Git repository in /Users/user/myproject/.git/
<h1>Hello world!</h1>
<p>This is the first file in my new Git Repo.</p>
</body>
</html>
And save it to our new folder as index.html.
Example
ls
38
Subject Code & Name: Full Stack Development Unit - I
index.html
ls will list the files in the directory. We can see that index.html is there.
Then we check the Git status and see if it is a part of our repo:
Example
git status
On branch master
No commits yet
Untracked files:
(use "git add ..." to include in what will be committed)
index.html
Now Git is aware of the file, but has not added it to our repository!
Files in your Git repository folder can be in one of 2 states:
Tracked - files that Git knows about and are added to the repository
Untracked - files that are in your working directory, but not added to the
repository
When you first add files to an empty repository, they are all untracked. To get
Git to track them, you need to stage them, or add them to the staging
environment.
No commits yet
39
Subject Code & Name: Full Stack Development Unit - I
Changes to be committed:
(use "git rm --cached ..." to unstage)
new file: index.html
7) Git Add More than One File
You can also stage more than one file at a time. Let's add 2 more files to
our working folder. Use the text editor again.
i) A README.md file that describes the repository (recommended for all
repositories):
Example
# hello-world
Hello World repository for Git tutorial
This is an example repository for the Git tutoial on
https://www.w3schools.com
h1 {
color: navy;
margin-left: 20px;
}
iii) update index.html to include the stylesheet:
Example
<!DOCTYPE html>
<html>
<head>
<title>Hello World!</title>
<link rel="stylesheet" href="bluestyle.css">
</head>
<body>
<h1>Hello world!</h1>
<p>This is the first file in my new Git Repo.</p>
40
Subject Code & Name: Full Stack Development Unit - I
</body>
</html>
Now add all files in the current directory to the Staging Environment:
Example
git add --all
Using --all instead of individual filenames will stage all changes (new,
modified, and deleted) files.
Example
git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached ..." to unstage)
new file: README.md
new file: bluestyle.css
new file: index.html
Now all 3 files are added to the Staging Environment, and we are ready
to do our first commit.
Note: The shorthand command for git add --all is git add -A
8) Git Commit
Since we have finished our work, we are ready move
from stage to commit for our repository.
Adding commits keep track of our progress and changes as we work. Git
considers each commit change point or "save point". It is a point in the
project you can go back to if you find a bug, or want to make a change.
When we commit, we should always include a message.
By adding clear messages to each commit, it is easy for yourself (and
others) to see what has changed and when.
Example
git commit -m "First release of Hello World!"
[master (root-commit) 221ec6e] First release of Hello World!
3 files changed, 26 insertions(+)
create mode 100644 README.md
create mode 100644 bluestyle.css
create mode 100644 index.html
The commit command performs a commit, and the -m "message" adds a
message.
41
Subject Code & Name: Full Stack Development Unit - I
The Staging Environment has been committed to our repo, with the
message:
"First release of Hello World!"
GitHub:-
42
Subject Code & Name: Full Stack Development Unit - I
Features of GitHub
Collaboration
Integrated issue and bug tracking
Graphical representation of branches
Git repositories hosting
Project management
Team management
Code hosting
Track and assign tasks
Conversations
Wikisc
Benefits of GitHub
GitHub can be separated as the Git and the Hub. GitHub service includes
access controls as well as collaboration features like task management,
repository hosting, and team management.
43
Subject Code & Name: Full Stack Development Unit - I
Steps:
Using Command line to PUSH to GitHub
You need to create a new repository and click on the plus sign.
Fill up all the required details, i.e., repository name, description and
also make the repository public this time as it is free.
44
Subject Code & Name: Full Stack Development Unit - I
pwd stands for 'print working directory', which is used to print the
current directory.
Move to the specific path in your local computer by cd 'path_name'. The
cd commands stand for 'change directory' and it is used to change to the
working directory in your operating system, and to locate your
file, 'path_name', i.e., C:/Users/Dell/Downloads/FaceDetect-
master needs to be given. This command can identify the required file
that you are looking to work with.
Use git init to initialize the repository. It is used to create a new empty
repository or directory consisting of files' with the hidden directory.
'.git' is created at the top level of your project, which places all of the
revision information in one place.
45
Subject Code & Name: Full Stack Development Unit - I
Use git add . in your bash to add all the files to the given folder.
Use git status in your bash to view all the files which are going to
be staged to the first commit.
You can create a commit message by git commit -m 'your message', which
adds the change to the local repository.
46
Subject Code & Name: Full Stack Development Unit - I
git commit uses '-m' as a flag for a message to set the commits with the
content where the full description is included, and a message is written in an
imperative sentence up to 50 characters long and defining "what was
changed", and "why was the change made".
The HTTPS or URL is copied from the given GitHub account, which is the
place of the remote repository.
47
Subject Code & Name: Full Stack Development Unit - I
8. Add the URL copied, which is your remote repository to where your
local content from your repository is pushed
git push -u origin master is used for pushing local content to GitHub.
In the code, the origin is your default remote repository name and '-u'
flag is upstream, which is equivalent to '-set-upstream.' and the master
is the branch, name.upstream is the repository that we have cloned the
project.
48
Subject Code & Name: Full Stack Development Unit - I
49
Subject Code & Name: Full Stack Development Unit - I
50