0% found this document useful (0 votes)
17 views23 pages

Backend Technologies Setup Guide

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views23 pages

Backend Technologies Setup Guide

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

INDEX

Page Date
Remarks
Name of Practical
Introduction to Backerd
Technalogies.
Partiulars
Date:
end
ducuan to BaCh-
1.] Intrg Obiective-
tehnoloqies Farniliarize
and [Link] with backen
technalogies £nvironment
develoongnt
" Setup IvOrld" backend
" Sumale "Helo
in Node js
appiicatcn
Setup development
with Neb
Framewarks environrnent (e.g. IDE,Git).
2:7 Narhing
(Nodejs / Expressis ) - Setup [Link]
[Link] project.
" Setup
Inolement a Simple
NEb
on uSing SKorsss.
"applíCât
Dowload [Link] -
dataae 1Qpen a web browser.
3.] horhing itn NoSQL 2Go to the cicial
" Setup MongoDB
database ebste -
" Implement CRUD
OperatianS
Lsing NoSSL Commanas https:/[Link].
3 On the homepaqe, uou will
o TS (Long Term Suppart ): see two butons
4] Errgr Handling - " Current
Tecnnigue for error Choose LTS version
hand ling.
Tnstall [Link] -
. CetuD MusQL gata base.
" Perform 00 cperations Once downlcaded, cpen the instaler file
(.msi for Windows ,-pkg for Mac).
A Setup wizard will appear -
" Click Next.
" Accept the Licenge Aqreernent. Cick Next.
Celect te installation" folder. Cilck Next.
oep all 0Dticrs [Link] Nert
festesSgaue.
EHARAT
Name of Practical
Date:.
"Cllck tnstall.
3 Walt for
Installatíon
Click Finish. to complete then
Verify Istalation -
Open Comrnand
Prompt or
Type comrmandeTerminal.
2
QUTPUT the
node folloning
- -
2 npm -y
1 v20.12.2 3 If versions
installed. appear, Node.s is sutcessfulls
2 |10.8.Q
Setup Vi_ual Studio Code -
Download VS Code
4open a web browser and
https:|| code [Link] to
2 Click Dounload for your Cperating Systerm:
"WindowS (.exe)
"macog (.dmg)
Linux (.deb/.rpm)
Teshers Sigte
BHARAT BHARAT
Name of Practical

Date:

Install VS Code -
(pen
2 Getup theni zard
donnlcaded installer.
Click Next. wilIl appear:
ACcept Aqreerrent,
Gelect installation Clíck Next.
Click the folloingq folder, CiRck Next
- Add "Open useful opttons
- Add to with Code"Opticn
PATH
Click Irnstall.
Wait_for installation to complete
clíck Einísh. then
Setup GIt -
Dowload Git -
Ooen a branser and qo to
htps :/git -[Link].
2 On the homepage , click Dohnlcad for Windows
Install Git -
Open the installer,
2Setup wizard Steps 2
Teacher's Signature...... oseesoe

BHARAT BHARAY"
Name of Practical

Date:

ClcK Next
Choose installatíon
Select folder Cdefauit is
Choose cOmponents,
default (keep
default )
fine).
Choose Git editor (select vs code)
also from 3rdfrom- the conMmand line
HoUTPUT
Confiqure line party sOftware. and
Chocse " ending conversions C
i t version 2.45.1
Checkout
Unix-Style'
Leave
): _Wi ndows-st yle , commit
other
CLiCK Instal[.options as default ->
2 Your Name 3After nstallation , click Finish.
[Link]
Verify Git
Insiallat iorn -
3 User. narne = Your Name
1Open Command Prompt Terminal.
2 Typei
[Link] = [Link]@[Link], Lgit Yerslon
Inl Shon Git verson Ce-g., qit version
242-0)
Confiqure Git CFirst TÉme Setup)
Set your name and emai for commits:
2 qit confi -- global user. name " Your Name

confi g1obal uSer. emall


[Link] "com "
Check Conflouaiion :
3|9it config -- List Teacher's Signature....
BHARAT
BHARAT"
Name of Practical
Date:
0UT PUT
b) Create a simple "Hello
This utility will walk you through Creating a application in Nodejs. World" backend
package.1son fle .
It onlu covers the most Common tens, and Setup Project
tries to quesS sensible defaults.
See npm help init'for definitive documentation
Create Project Folder
on these fieids and exactiy What they do
Open VS Code.
Press ^C at ansy time to quit. Gio to Ele in menu bar.
Package name: (hello - world- bac kend)
version : (1.0.0) Click Open Folder
description; Create / Select a folder
entry pointi (indexjS) [Link]
test Command:
git repository: Initialize [Link] Project -
Keywords :
author:
License
Open Ter rminal in VS Code by clicking
AbOut to write to /path/nello- worl cl- backend/ View ’ Terminal.
packagejson : 2 Run
"name': "hello- wgrld- backend". hpm init
"version':40.0
"description': "
3 Answerthe Prompts
1" main": "serverjs; "packge name - Default is folder name.
" Scripts " Press Enter if Okas.
"test":"ecna i Error ino t e t Spocifed |" eR exit 4" version - Default is 1.0.0. Press Enter if Okay
descriptíon - Short info about your app.
keywords" : L], entry point- Write your main file name
arthor :
License":"ISC" test command - Leave empts Press Enter.
} git repository - Leave ermpty.
1s this OK?( yes) Key wards - Add tags, or leave empty.
author: Vour name (optfonal).
LËcense - Press Enter. Teacher's Signature.
BHARAT"
BHARAT
Name of Practical
Date:
Confirm- At the end, npm will ehoW you
a preview.
Tupe Yes and press
Enter.
0UTPUT
5This Creates a [Link]
file.
up to date, audited 1 packAqe in 200 ms Create [Link]
found 0 vulnerabil ities.
Create a nen file
"Click on new fle icon in
2 npm WARN deprecated htp0.0.1- securits: " Name as explorer panel.
The http module is a core Nodejs module you do
need to instal|it
[Link]
added package, and aud ited 1 packaqe in 500ms Install Dependencieg -
Found 0 vulnerabilities.
Open VS Code Terminal
Run These Coramands<
hpm install
2npmn install http
This create Hode_mcdules folder
and
[Link].
Write Code
pen server. js
2 Write the [Link] program
Teacher's Signature...
BHARAT"
BHARAT
Name of Practical
Date:
[Link]
Const http = requíre ("htto);,
Const Server = [Link] Server ((reg,res) =>
[Link] (Hello World \n);
);
Const PORT 3000;
Server,Iisten CPORT, )=>{
0UTPUT [Link] ( Server running at
Terminal
http:localhost:$ {PORT}7);
Server running at [Link] 300Ó
-Browser
Jocalhos t :300o
Save the file CCtrl+S)
Hello World Run the servep
Open vs Code terminal
Run command
node Serverjs
Test -
Open bowser qo to http:/| localhcst3000
Teacher's Signature.
BHARAT BHARAT
Name of Practical
Date:
Push your Code On GitHub
-
Create a GitHub ACCOunt -
1Open Brcwser and qo to
https-|[Link]
22 Click on Sign up button at the top rigit
Corner.
3 Enter your Details
" Emall address
Password
" Username
4 Verify your ACeOunt
GaitHub mau shoW a puzzle
Confirm you're not a bot. Captcha to
5 Verify Email by opening the verificahicn
Link sent onYour email.
Choose a Plan - Select Free Plan.
7 Setup your Profile (optional)
(opt
8 Now you Can Sign in your GitHub
account
Teacher's Signature.....
BHARAT
BHARAT"
Name of Practical Date:
Create a new Repository
1login to GitHub.
22 On the top-right
corner, click "+" icon.
3 Select "New Repository" from the dropdown.
L
FIL in Repositors Detals
Kepostoryname
Description
"Vistbilits - Select Public
5 Clfck the green "Create repositOry" butto
6 Copy the repo URL
Push y0ur Code.
Open_your project in VS Code.
2 Open Source Control Panel from the
Lft sidebar (branch ícen)
CIck " Initialize Reposttory:
4 Enter a ommit message in the text box
at the top.
5 Clíck the Vcommt button.
In, VS Code Trminal ruh
qit remote add origin https:|| github.
Com/your-username /repo .qit CopiedUPL
qit push -u arigin master.
Teacher's Signature..
BHARAT BHARAT
Name of Practical Working wth Web Date:
frame works CNodejs| Expressjs).
Objective Gain practical xperience ith
oUTPUT backend frameorks.
rote to path) backend/ [Link] : a) Setup [Link] project -
name": backend" ) Create a Express project Folder:
'version: "1.0.0", Open Vs Code
description": 2 Click Fle ’ Open Folder
"main": "[Link]", Select / Create a folder.
'Scripts": 6
"test: "echo ' Error :no test specified &Rexit 1" Initlalize as [Link] Project -
"Keyword":[2, In NS Code Terminal run -
"author " n
"Hcense":"IS C" 1 1 npm init -y
This wilL create
2lnpm install package json
3
2
up to date, audited 1package in 200 ms. This will Create [Link].
found 0 vuinerabilitieg
Ihstall Dependerncies -
added S4 packages, and augted 5 packages in In
3nqe Tecminal run
3s install_ eXpress
7 packages are loo kingfor funding
ate
'hpm fund' for cetails
found 0 vulnerabilities Create dEntryPoint cf
of yeur project -
a [Link])
New File with
extension.
Teacher's Signature...
BHARAT
BHARAT
Name of Practical
Date:
b) Implement a simple
(Using Ex press js) web application
Write Code for your application in
OUTPUT Serverjs (File you reated)
import express from "express;
termina l| Const app = express0;
Server running at htlp:|! localhost:3000 Const PORT = 3000;
- browger
[Link] ("/, (reg, res)>
localhost3000 |-lo x [Link] (" Höme Page ");
D;
Home page
app. qet (/about",(req,res) > E
[Link] ('nis s a simple express
applicaion ");
browser
:3000/4b0ut
app. tsfen (PORT, (0>2
1o calhost
[Link] (Server hunning at
This is a simple cxpre[s applicatíon, ps7 local hogst:3000;
3)
Run the Application
In v$ Cade Terminal un
ncde serVerjs
Teacher's Signature.
BHARAT BHARAT"
Working with NosQL
Name of Practical
Date:
databases.
Objective - Tntroduce Student S
NoSQL databases to
a) Setup MongoDB
database
Download MongDB -
1Opern your weto bronser
official MongDB websiteand visit the
https:||
[Link] /try /do wnl cad|
2
Select your operating system.
Choose the
editlon and MongoDB Communits Server
Select the latest Current
Version avail able.
4. Click on Download.
Install MongoDB
Once downl oade d ,open the installer
file.
In the Setup Wizard -
Click Next to Continue.
Accept the License Aqreement and clíck
Next.
3 Choose Setup Type
"Select Conplete (recommended ).
Teacher's Slgnature.
BHARAT BHARAT"
Name of Practical
Date:
On the Server
*Keep Run Confiquration screen
LISer selectedService as NetwarkK Service
" Keep the
" Click Next default Service Name (MongoDB)
5 Note the
Continue default folder for data
7
Once the clicking Next, then Install.
installation
Finish. is Complete , click
Add MongoDB to Systemn
PATH -
4Opern Control
System SettingsPanel>Environment
’ System> Advanced
2
Variables.
In Sustem Variables,
Click Edit. Find Path, then
Click New and
C:|Pgoqram Fles\ add
g4 Click Ok
tthe path -
MOnqoDB\Server\<v>\bin
On all
windcS
Run Mongo Shell
Open MongoDB Compass .
2 Add a NeW Connection.
3 Click Admin
Click Mopen MangaDB Shell.
Teacher's Signature..
BHARAT BHARAT"
Name of Practical
Date:
OUTPUT
1Switched to products ImplementCRUD operationg
NoGQL Commands. using
2 { ackhowledged: true,
insertedIDs: & Create Documets -
"0: 0bjectId ("652e la9a1b2d49e&b 6a 9C$f3"). 1 > Use_products.
1 :0bíectId ("G5 2eta Qa fb2 du9e8b6a 9c3f 4").
9(3f 5 "
2 : 0bect+d ("652e ta 92tb2d 4e bía
2 > db. products.
insertMany CC
product: "Laptop",
revenue : 2500003, units Sold :25,
product : "Mouse"
units. Sld :60, revenue
3|L{ id: 0bject+d('65e1a9a fb2d4 9e8 b6a9c3(3 "), :30000
{product: "Keyboard", [Link]:
product:"Laptop'.)
[Link] : 25 revenue: 5o000?]) 40,
revenue: 250060 ,
b6a4cf4), Read DOcuments -
{ id: 0b1jectId ('65 e1a 921b2d Li9e8
Prop uct: MOUse
3
ù[Link]: 60,
revenue : 30000, [Link](
b2du9c ba@cf5),
$ id: 0bjectTd("65e ta 9a 1 Update Documents -
product :Keuboard ,
units Sold: 40, L
revenue S0000
>[Link] One(i product:"laptop?
$set:revenae: 26000033
acknowldeged: true , Delete Document
matched Count : 1,
modifed (ount: 1
5 db. products,deleteOne (product :'Mouse'
5
acknowledged : true,
deletedCount : 4
Teacher's Signature...
BHARAT BHARAT"
Name of Practical
Error Handling Date:
|Obiective- Learrn technigues for
handling. err
Const express =require
Const app: press 0;
(express');
QUTPUT [Link]( express.45on (0);
[Link] C, (reg, res) =>
-terminal [Link] CHello_ World'):
http:/llocalhost:2000
Server is running on
[Link] ferror', (req,res,next) =>
Const error= new Ercor('Something
-browser -
localhoSt :2000/errar
went wrang!;
error, Status =500;
S'success:false,'mes sage: Something next (error);
went Wrong'?
app. use ((err, req, res) =>{
[Link] ([Link] || 500).json(i
Success : false,
messaqe. [Link] I| Tnternal
Server Error!
3):
apptisten (2000,)=>¬
Console.l0g('Server is running on
http:| lo calhast :$ iport l200c3);
?);
Run ths Command Tecminal
node indexs1s
Teacher's Signature...
BHARAT BHARAT"
Name of Practical
Working witth Databases Date:
(SQL).
Objective
and
- learn basic
SQL
datab ase interactions operations
a) Setup MysQL database
Download MysQL
4Go to the opicial MysQL Website:
htps:|/[Link] downlcads/ installer/
2 Click. "MysQL Installer for Windows'.
3 Choose the
Installer)-itWindows (x36, 32-bit, MSI
64-bit [Link] on both 32-bit and
4 Click Dawhload ’
my download.,
No thanks, just start
Install MysQL -
4 Open the msi fle.
2 Choose
3 Clfck NextDeveloper Default etup type.
4Confiqure
" Choose Standalone My6QL Server/
Classic MySQL Replication > click Next.
Teacher's Signature...
BHARAT
BHARAT
Name of Practical
Date:
Confiqure the
Choose use port (defauLt 3306) >Next.
Strong
’ Next. Password Encryption
Createa root password > Next
Start the MusQL Service
’ Next ’
Exeute. automatícalls
5Wait for all installatíons to
Cick Finish ater setup finish.
completes
Add MySQL to Gystern Path -
1Open Control Panel >Systemn ’
System Settings ’ Environment Advanced
Variables.
2In System Variables,
Clíck Edit Find path,then
ZClick New and add the path -
CProgram
bin Files\ MysQLIMyQL Server 8.0\
Citck OK gn all windows.
Now the MySQL database is
ready to Use'
Teacher's Signature..
BHARA BHARAT"
Name of Practical
Date:
b) Perform
queries CRUD operations using
(Create ,Read, Upd atc, sQL
OUTPUT Open MysQL : elete).
mysql -u root -p
1 Query Ok,1 row affected (0.01sec) Enter your password to log in.
2 Data base Changed Create(Database &Table) -
CREATE DATABASE Company;.
3 Query OK,O row affected (a.02 sec)
2 uSE Company;
Query OK, 1 row affected (0.01sec)l 3 CREATE TABIE employees ( id
Records1
PRIMARY KEY, name INT
Duplicates:0
postion vARCHAR (o0)
Warnings:0 (lo, 2)) VARCHAR (100), Galars DECIMAL
lid |name lposition Isalary Insert )> ereate -
|1 |Tohn Doe }Manager 5000 | INGER? TNTO employees values (1,
Tohn oe, 'Manager'5000):
* Read Rows
5 Select * from omployees:
Teacher's Signature.
BHARAT" BHARAT
Name of Practical
Date:
Update Rows
UPDATE employees
SET Salary =
-DUTDUT WHERE hame80000
=John Doe':
2 Select * FROM
Quers Ok, 1 roW affected (o.00sec) employeesS,
Rows mafched i1 Changed:1
Warnings :0 Delete Rows
3
DELETEFROM
2.
id | name
y

Pasitrion Salary! name :Johnemployees


Doe: WHERE
41 Tohn Doc| Manaqer 00001
MySQL Connectiyity with VS
Query OK, rOW ffected CaÓ0sec)
CREATE
Const myse= require c'ysq12');
Const connection: mysql create Connection
host:ocalhost
USer root
passhord:'Hcode',
DOrt 3300,
database: mydb'
Teacher's Signature... seeseees#
BHARAT BHARATm
Name of Practical
Date:
COnnection"
ff Cerr) connect C(err) =>
Console . error C" Connectíon
err) error",
QurPuT return ;
else
-terminal Console |0g C" Connected"):
Connected Const credteTable =
Table created I CREATE TABLE C
rollno INT PRIMARY KEY,
name VARCHAR(50),
email VARCHARCI00)
Connection query CcreateTable , Cerr,
results ) :>£
else
Console log C"ERROR , err);?
Console -log C"Table Created) ");
Connection *end c);
3)3
Teacher's Signature..
BHARAT BHARAT
Name of Practical
Date:
Insert ReCords
Const mysqL
const connechonrequire C"mysql2");
( host : localhast' mysql"cYeate Connection
User: noot'.
QUTPUT passhord: "Hcode4'
port 33009
-termimal
database :mydb 3);
Connected
3 Records ingerted I Connection connect C(err) =>
ie Cerr) throN err
Console log_c " Connected"):
- MYSQL Const însertQuery =
mysqL Select * from user: INSERI INTO_ USers C rollno, name
- -f
Rol'n namei email_ VALUES
101. i Hína hin a@gmail -som C1O1, Hína', hina@gmal-comn')a
102 Neha 1 [Link] ! I02,-Neha, 'neha gmail-coms
T
Riya riyaGmåil. tom, 1 103, Riya','riya gmail com)3
403
Connectlon«query
results)=>{
inseYt Query, (err,
ie (err)
(onsole log c"ERROR"
else
ConSole .Log C"3 ReCords
inserted; ?
Teacher's Signature..
BHARAT BHARAT"
Name of Practical
Date:
Update:
Const mysQL * require
Const connection: C"mysq12")
mysql"create :
host:'Iocalhost' Connection(2
OUTPUT User: root'
password : Hcode ?,
- terninal port : 3300
Connected
database :'myds3);
Table Updated l Connection-connect (( err) =>
ieC err) throw err3
Console log (" Connected"):
- MYSoL -
mysql > Select + from UIser Const updateTable
rollno name ' email
UPDATE users SET email: 'riya1
101 I hing ! hina@goaí[Link]
qmailcom' WHERE rolino 103 ':
1 102 neha | nehaQgmail. com
ityat@g [Link]
ConnectloA-QUery (Updatelable,(err
results )=>
103 riya
0RCerr)
3
(onsole -log ("ERROR ", err):
else
(onsole -(og (" Table updated1"
3);
Teacher's Signature.
BHARAT
BHARAT
Name of Practical
Date:
Delete :
Const mysql= require
const connection: mysqLC"mysqi2")3
" Create(onnecton
OUTPUT host: LOcalhost',
password:' Hcode @Iu.
- terminal
user: root',
port? 3300
Connected
record deleted
database:'mydb' 3);
Connect" connect ((err) =>
fE Cerr) throw_ err;
- MYSOL COnsole (09 ("Connected"):
mysol siect * from user
rollho hame email COnst_ deleteQuery =
DELETE FROM Users WHERE roll no
hina hina @[Link] L02
103 ! riya ConneetYon:query
pe[ults) =>
deleteq uery , (err,
ff (err)
Console*log C"ERROR", err);
else
Console" l09 C"irecord deleted
?
Teacher's Signature...
BHARAT" BHARAT

You might also like