ULTIMATE BACKEND COURSE VIRTUAL CODE
What is Back-end Development ?
- Back-end development means working on server- side
software , which focuses on everything you can’t see on a
website.
- Focusing on databases , back-end logic , APIs ( Application
Programming interface ) and Servers.
- Programming Languages: JavaScript (Node JS) , Python (
Django/Flask ) , Java (Spring Boot) , PHP ( Laravel ) etc
ULTIMATE BACKEND COURSE VIRTUAL CODE
Client Database
Request
Response Server
VIRTUAL CODE
ULTIMATE
BACKEND
COURSE
Level-1 Introduction to Node JS
VIRTUAL CODE
Level-1 Introduction to Node JS
- Node JS is a JavaScript runtime Environment that allows
developers to run JavaScript code outside of a web Browser.
- Node JS runs on the V8 JavaScript Engine .
- Node JS is Used to create web Server etc.
VIRTUAL CODE
Level-1 Introduction to Node JS
Set-UP Node JS
Install Node JS
Install npm
Create folder
run npm init
VIRTUAL CODE
ULTIMATE
BACKEND
COURSE
Level-2 Our First Server in Node
VIRTUAL CODE
Level-2 Our First Server in Node
- A Server is a computer or system that provides services ,
resources or data to other computers, called Clients , over
a network.
- Example-
- When you open a website, your browser ( the Client ) sends
a request to a server , and the server sends back the
website data so you can see it.
VIRTUAL CODE
Level-2 Our First Server in Node
VIRTUAL CODE
Level-2 Our First Server in Node
VIRTUAL CODE
Level-2 Our First Server in Node
Routing In Node JS -
- Routing is the process of defining how an application
responds to different client requests based on the URL
( or Route )
- Express JS simplifies route Creation
VIRTUAL CODE
Level-2 Our First Server in Node
VIRTUAL CODE
ULTIMATE
BACKEND
COURSE
Level-3 Introduction to Express JS
VIRTUAL CODE
Level-3 Introduction to Express JS
- Express JS is the most Popular Framework of Node JS
- Instead of writing Everything manually with the node.JS
http module , Express JS gives you shortcuts and a cleaner
way to organize your code.
- Install Express JS package by Running this command-
npm install express
VIRTUAL CODE
Level-3 Introduction to Express JS
Creating Server using Express JS-
Importing express package
HTTP Method
VIRTUAL CODE
Level-3 Introduction to Express JS
HTTP methods-
- HTTP methods are used to handle various types of requests
made to a server.
- The most commonly used HTTP methods include-
1. GET Method - Used to retrieve data from the server
2. POST Method - Used to send data to the server( create
new resource )
3. PUT Method - Used to update an existing resource.
4. PATCH Method - Used to partially update a resource.
5. DELETE Method - Used to delete a resource
VIRTUAL CODE
Level-3 Introduction to Express JS
req.params -
- req.params is an object that stores route Parameters in
express JS.
- It is used to capture dynamic values from the URL.
VIRTUAL CODE
Level-3 Introduction to Express JS
req.query -
- req.query is an object that stores query parameters from the
URL.
- Query Parameter are sent as key-value pairs in the URL after
the ? Symbol and are typically used for filtering , searching
etc.
VIRTUAL CODE
Level-3 Introduction to Express JS
req.query -
VIRTUAL CODE
ULTIMATE
BACKEND
COURSE
Level-4 Connect Backend with Frontend
VIRTUAL CODE
Level-4 Connect Backend with Frontend
RESTful API (Representational State Transfer ) –
- A RESTful API is a way for applications to communicate with
each other over the internet using standard HTTP requests
like GET, POST , PUT and DELETE.
- Client ( ex. A mobile app or Website) sends a request.
- Server receives the request and processes it.
- Server sends back a response ( usually in JSON format )
VIRTUAL CODE
Level-4 Connect Backend with Frontend
CORS (Cross Origin Resource Sharing) in express JS –
- CORS is a security feature in web browsers that prevents
requests from different origins unless explicitly allowed by
the server.
- Same-origin Policy restricts requests from different origins (
protocol, domain, or port )
- CORS allows servers to specify who can access their
resources.
npm install cors
VIRTUAL CODE
ULTIMATE
BACKEND
COURSE
Level-5 Middlewares, Status Code and
HTTP Headers
VIRTUAL CODE
Level-5 Middleware, Status Code and HTTP Headers
Middlewares–
- Middleware runs before the route handler.
- Middleware must call next() to continue to the next function .
- If Middleware does not call next() , the request will hang.
- There are some built-in , custom , thirdparty middleware etc.
Third Party Middleware
Built-in Middleware
custom Middleware
VIRTUAL CODE
Level-5 Middleware, Status Code and HTTP Headers
Status Code –
VIRTUAL CODE
Level-5 Middleware, Status Code and HTTP Headers
HTTP Headers–
- HTTP Headers are key-value Pairs used in HTTP requests and
responses to pass additional information between the client and
the server.
- They help in defining metadata , specifying content type , setting
authentication tokens etc.
- Types of HTTP Headers :
1. Request Headers : Sent by the client to the server
( User-Agent)
2. Response Headers : Sent by the server to the client
( Content-Type)
VIRTUAL CODE
Level-5 Middleware, Status Code and HTTP Headers
HTTP Headers–
- Get request Headers:
1. req.get - for getting Specific Headers.
2. req.headers - for getting all headers.
- Set Response Headers: use res.set( ) or res.header( )
- Remove Headers : use res.removeHeader( headerName )
VIRTUAL CODE
ULTIMATE
BACKEND
COURSE
Level-6 Introduction to MongoDB
VIRTUAL CODE
Level-6 Introduction to MongoDB
What is Database ? –
A database is a collection of data that allows storing ,managing
and retrieving information efficiently.
- Common used databases-
1. SQL database – MySQL, PostgreSQL ( stores data in tables )
2. NoSQL database – MongoDB ( Document Based )
VIRTUAL CODE
Level-6 Introduction to MongoDB
MongoDB–
- MongoDB is a NoSQL database that stores data in flexible ,
JSON – like format instead of tables.
NoSQL
ID Name Age
1 Ayush 21
2 Dev 22
SQL
VIRTUAL CODE
Level-6 Introduction to MongoDB
MongoDB–
Document 1
Collection
Document 2
VIRTUAL CODE
Level-6 Introduction to MongoDB
Database
VIRTUAL CODE
Level-6 Introduction to MongoDB
Mongoose –
- Mongoose is an ODM ( Object Data Modeling ) library for
MongoDB and Node JS.
- It helps developers interact with MongoDB using an easy an
Structured approach by defining schemas and models.
- Install Mongoose using -
npm install mongoose
VIRTUAL CODE
Level-6 Introduction to MongoDB
Set-UP MongoDB
Install mongoose
Connect DB
Design Schema
Create model based on Schema for
performing CRUD Operations
VIRTUAL CODE
Level-6 Introduction to MongoDB
Schema –
- A Schema in Mongoose defines the structure of documents
within a MongoDB collection .
- It specifies the fields , their types, validation rules , and
default values.
Model –
- A model is wrapper for schema and provides an interface to
interact with MongoDB Collection.
VIRTUAL CODE
Level-6 Introduction to MongoDB
Schema –
VIRTUAL CODE
Level-6 Introduction to MongoDB
Operation syntax
Create (Insert one) User.create({ })
Create (Insert many) User.insertMany([{ } , { }])
Read (Find All) User.find( )
Read (Find One) User.findOne({ })
Read (Find by ID) User.findById(“id”)
Update (one document) User.updateOne({ } , { })
Update (Find and Update) User.findOneAndUpdate({ },{ },{ })
Delete (One Document) User.deleteOne({ })
Delete ( Many Documents ) User.deleteMany({age : {$lt : 18} })
VIRTUAL CODE
Level-6 Introduction to MongoDB
VIRTUAL CODE
Level-6 Introduction to MongoDB
VIRTUAL CODE
ULTIMATE
BACKEND
COURSE
Level-7 Authentication and Image Upload
VIRTUAL CODE
Level-7 Authentication & Authorization
Authentication –
- Verifies who a user is. ( Login & SignUp using email/password )
Authorization –
- Determines what a user can access .
VIRTUAL CODE
Level-7 Authentication & Authorization
VIRTUAL CODE
Level-7 Authentication & image Upload