0% found this document useful (0 votes)
6 views40 pages

Full Stack Lab Assignment Complete

This document is a laboratory assignment submission for a Bachelor of Computer Applications program at Brainware University. It includes details about the student, course, and a list of assignments with submission dates. The content also contains programming examples and code snippets related to Full Stack Development.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
6 views40 pages

Full Stack Lab Assignment Complete

This document is a laboratory assignment submission for a Bachelor of Computer Applications program at Brainware University. It includes details about the student, course, and a list of assignments with submission dates. The content also contains programming examples and code snippets related to Full Stack Development.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
mn ee BRAINWARE UNIV! 398, Ramkrishnapur Road, Rarasat, North Laboratory Assignment Submission Session - 2025 - 26 Kolkata - 700 125 Name of the Department: - Computational Sciences Programme Name: - Bachelor of Computer Applications ‘Semester / Year: - 4th / 2nd Course Code:- BCA47111(P) Course Name: - Full Stack Development -1 Name of the Student: - Asmita Biswas Roll No:- 24103460272 Registration No:~ 24103003055 of 2024 - 2025 Student Code: - BWU/BCA/24/286 INDEX Scho [anigamente Page Ho, [exp. Date [Submision date [Signature |Remarts | 1. | Assiquiunt 4 1-3 |5/01/ |15/1 [2026 iqu a 11 [20 9 2. |Assiquement 2 4-5 |!2/0\5) 1/2026 26 . 12Jor/ mek 2026 3. | Assign a 6 se te/i] ji n2/os/ 26 4. |Assiquneent 4. 7 A 15/1/20 5. [Assignment 6 @ Bu 14] [2026 | e- Assiqu ment 6 Q-10 Ba! 22/1/2027 { SM 7. | Assiqnment 7 W412. ie 22/1/2026 Vapi . | Assiquinent ¢ 13 pal 22J1Jro2e Taghool” 9. |Assigument 14 ren ja/2]2026 Lape 1o.| Assignment 10 16-17 Bia 4/2]2026 opps 1. | Assiqnment 11 1g-20|9/2! 1/2 12026 54 oh 12 [Assignment 12 fas-25/9/21 |ajasoo26 ¢ | af 13. [Assignment 1 26-31 Bey 2/4) 2026 \ PG 14. |Assiqnmmum 14 32-28 ial 20/4/2026 54h 2026 [1 ceate a7 Ue anc womputh some punic nods. js syutan - OW OLL C GULIPh tha ALWoUA Hoes | amurtal poke iad SYUtan ,SULh oO; vor lelt Aeclor ation | Funclions | conc Honals Loops objects AsucoU4s Basic atynchronous code eg, cerTineoutd | COUnoLL . Log, CHetlo »Nooke “4s! ’); ik name = ‘Spauice’; woursk AGE = 285 (vou cite = New Youk’s | eomsclt lod ('name :?, name); | | eurole - 0g Ciage «', age); comrole. log Cuty: 1 citys i -fuurckion. add Ca, b=1)$ | yer. Ato; 12 Ut sum = aka (10,5)3 | ee sum |= ada (5) | covrole 0G (i sum af 10 anc 5’, sumny, courolt- bog (sum en YY Cage >= 1S) ¢ ovrole - 04 Ci you One on Adult.’); | cousole log C you au a minon.’); 3 Or Lue quoup = age >= a YOU CL OL aolULLt "You CUte CL WALnOst - cousole. Log Ceuiou ps for Curicr,iee a,ith)§ comrole - Log Ci); 3 UE pexaon = § nome Ai" Ae +28 city. "New Your", Bud » funtion Og Wwourole . log C" Hello pm nome ia "+ thin. | 3 name); 33 UE nomes = ae “a, "ory, | name [a] = | Whol. bog o Uring fox Loop : "y; birt | for Cut izo iene wurole «log Cnomen Li])3 3 comrole log ("zz =5555")5 Lousole - log (“Using foxEar Loop: ")5 nomen . fox ork (Cite) => § wurole . log Cit); 2 wourole L0G C" Before SetTimeour."); SeeTimeout CC) => § Lourole log ("THe memage ")5% , 2OCOD; Lonrole . log C'Aptux Ser Timeour ")5 [s | | Ia. { a. ja. 16. owpute 1. Hello .Noolt - 44! Name : Aud Age: 28 city : Now You sum of 10 ama 6 116 sum of B.G You axe am Acer. \ 2 3 Hetlo ,wuy nome w Aue . Before Set Timeout After serTimeouk The MLOQe - 2. woeltes ¢ o Noclee 4s povoge am. to Meak and chia plow tre emirtoumient vorticates of the system - comrote: log C“Systent Eww om Vari cater : 5 Lowrole. Log, (pHomas. env); wuroln. log C“\nSpeuiftic Enwinonment yori able +") vowrcle - log ("HOME : " comrole . log (“USER " Counole. 0G ("PaTH:" wonrnle - ) PLO Ces. UAV. HOME); » PHOLLAS - eMV. USER); ) PHOS . em. PATH); gq Cos: ", proud. env. os); 4 : bog (" Plarfoun:") psrocess “Plot Posum); | Af (Process. plourfowme ===“ Wwineae") § Wrote log Gr Curole \nwinelows Speific Environment | Vastiatater "J, | Wurole -lo4 (“UsERPROFILE: ", pscocoas. env. USERPROFILE)3 | comole: log ("TEMP :", process .env. TEMP); wurole. log ("Program Dara: " g Ourpur sytem Enwironment Voi cua Ltn : i... momy heey VoL PO .. specific Enwiromment vouricdolts * HOME: C:\ USea\ USOT | User: user OS. Wuiclows- NT Platform tw 32 | ] | \ Syste 32 | | ro:Nwi ws\s dee PATH : C:\Wwinolo > | | USERPROFILE + C:\ Uares\ Ue TEMP 1c 3\ User) Usee\ AppDara\ Locat\Tenys ProgramData roi\PxrogHomDarn. windows Speufic Environment V cui cuales to 3. wsith a Node 4s pxoguam thar ton inpur : from the UALt adds two KuMmins and print Me RAL « COUR Sadik = ROWE ("Hah ine) 5 our MIS seadine, Cate Inteegaee CE Unrpur : Prroiirs . Sthin, OUFPUE | PscOLins - Sthouk 25 Ot cprtation ("Enter the four wunterns + "Crd ) >= M1 OMuEMOn (“Entix tre setond nunore: ", (num) => & Coudlr sum = pore Float (rin) + parse Flo - OFC 2)5 wurole. og CMe su of", nen | "ama", num2,"in",sumy; m1. dese 0)5 i 2s Output Enter tre fdr pumlave +5 Enter te second wumiaer : 3 Te sume of 6 anc 2.8 4. waultt A Nock 4s progam fp er psig utltle wwumamd = Unt anqumetts. 1 | | vowrple Log C"Commanead = Lunt argument : | a > | | PIO CeAs - otgvd> vowak name = pxrocrs. argv C2]; wousk AGE = PMOUAA- anqv [ads | | if Crome ck age) ft | i cournle. 10g C'Hello ,$ {nomez! you ace $fagez ots old." )5 3 orae & ‘a a : Wwrrcle log ("Pane prowuide bot your name and cge as anquumnenrs "35 Hello, AU! You axe 20 yeorr old - whee organi ws mor psowicled : j Command - int axrquiments ¢ | Pearse prouict both yout uv. OMA AGE 1 Os ore gnends « 5. write a Node-js script that works with the REPL (Read - Eval - Point — Loop) utrtonment- cout xepl = seequitee C"sepl "D5 COME supl some = sepl. Stott ( ¥ ponepr :"¢ Bappa> "> UAPUE : PHOCLdd. Stclin , OUrpur : PxOLeAd. Sto Feuminal «tut 35 HEPLSOHUHe ore C" ine", Cine) =>§ comrole- Log (“qyowe Entor Line iv: “; Une); | 2s wepisexvert .on (Nenit", 0 D>§ vomrsole - 04 ("REPL session har enctecdt-")5 | [23 | Output $ BappadH eo your Enter Une Wd : Hello $Bappa> Node -Js Your Enter Une is i [Link] $Bappa>s+10 our Enter ine WS +10 $ Bappa> REPL session hay enced. af ge (& Noote « “4s pro um fo calulate te He FOKUA oy wll ple ONS tm eneuite. Fuackion to meat the Hme taken by another ion. function unas PUULcow Cfuee, Latoet) § covanle «Hime Clooek); | covanle -Log ("Function exeurte “Pune 035 Wwurol » HmeEnd (laoel); fumution Punction Our © § We sum = 03 | fer Cur V20 51 <1eS3 1+ HE sum +213 3 ee Sum 3 | | ipester Pati OnTUD ) § | Wk SUM =03 | fore CUk i=O5i<1e1o5sit4d4 sum +215 | 3 | | seb. sum; | i iow Kon axe () § | Wk sum =03 | for (Ur i=Osi< ler si+t)g sum +ais | 3 | | stew SUM 3 | mLOAUE FULHon (famrtionOne »" Funktion one"; WEOAULL Fumaction (- jonTwo, “Funtion Tuo"); Meath, Fumi on(. on Tt, "Function Twree’); Al Function eneutte 4q44445 00000 Fumuion one 11. 517ms Fumtion eneutt 4aqaqqqqqqo0e1¢60000 Fuuction TWO 110.3645 Furction enreute 4450 FunchHon Wee: o.1g4mes. | | | | | | | | | { 7. wsite & Node 98 pogrom hans HOT. ug £5 modutt (Asynchronous kk synchronous) Comar Bs = ceqmaiee ("65 ")5 WAsyme Read SMe FUL (“clot Ext", "urge", Ces , haku) => % ig cov § ; cousole - Log CTs uv cur Erv00")5 Ferre § comole. log (NFL async =", dara); 3 Ds sane Read toug § COUAE lata Bs. x2eadtrucsynt Cidara-rxr "sy wurolke- | Crue sync: ", dara); urEe "D5 3 carer (esd § Courole log ("FUL oes nok enirt", esur)3 3 UAsYne wostite wuak c= equee ("85"); $s wHtte Fur (hate . ext)" HeLlo UWA wn foe woot. coukent ", " Ueke" Cert) =>¥ ig Cov f Cournle - 0g C"Esurose wth wotiting, gud fete § conanle (0G ("File yosridtere suce Casynd)s 3 D5 I squc vosite toug g $s. write FUL syne C'[Link] “This concent is us wolttenr using ¢ wethrod"s “ukge")5 (tes | cousole - Log ChFUL woitter Successfully (sync) 5) Feceee COVE § conrole Log CE rut09¢ wu wuiting fue") evr)s 3 Output Fue asyne : Hep Noce Js Fur syne: Hello Node Js Fue written succes Buty Casync) FUL wetter success fui Csqnc) 4 ol 12 a Gd, WC. WLU. INGdIL On. SLinyL, nots ie. Waddle mato Aish AG. fermion ach (0.115) 4 UDI O45 i functor ato (0.,0)4 PUAN Oh 5 3 Wwrrr todos =[ bak ore 15 Hime: “10,00” 5, bask: Hee-2"5 Hme:" 12:00" 3 4 Module .cuparts = 5 Odd, sub, todo Ust ; too s Appe-4s | wnat Hodite = require Cf yy, yao. ", { courole log (mig Module - cachet (4, 5))5 onsow. log (myttoalte Suto (a, 39); wurole. Log ("vani cute”, muy ocuste .tocolist); Output | Bebe: Soper? § tok HELI’) mes *10:00'F, $ bok Ee 2", Heme: 12 :00'3 " ia Dieses icusantate Uke Lotenv. reowite (‘hokenv’), confiqods Lorne .l0g ("Your hnbtp sexvext PORT: ", process every] » HTTP. PORT)> Comsole . Log (" qowe DB HOST: ", Process. env. DB- Host); COUAdlLL.. Log C" Heo"); env fiw HTTP_porT = 2000 DB-HOST = Locathost Output Gort utp sexrvuer Port: 3000 qowt 0B Host : Locatlhost Hetlo U uAcLe . log (“reqrest : ", seq. metho) vonrole. Log (" sreqeat 2", sreay. wel) Y/ vovrrote. oq Crea) Sudtee (neq WX) § Caan Ny n: sted» woseite (< nen : CH He> fort node +7 Sermere SHH . buenk 5 COAL "/ouoouk" > ows . wseite C ted First nooe 4 sexuor wetome Asmita F [as rite” Pott node 4p Sexver : welcome Asmita gni> ) bxLOK ; Conk “Touma”; 2S. wrHite ¢ Fut noo. ps Sexvet ) WHLOUK 5 wes. weitt (“404 wor Pounce") lxH2AK 5 3 HLS enh) 2—d 1] DvADLE : Log (server) wnat PORT = 4322 secue -Urten (PORT 0) >§ console 0g C'netp:// LocaLhost : $ § PORT‘) 3) a nttp:// Loca host 14322 welcome Asmita THA We mug fork noodle 4s S —> nttp :// locoLnost 4 322/about weltome Asnmuta Th wv mug fore node 4s s —> nttp:// Weal Wost $4322 /zour welcome Asmitoa Vee ever mu uv mug four node .47s SOCVet —> REP '// toca nost 4322 /awi welome Asmita hh uw ny for NOL. Secvere —_ http: // nocaLhuost: 4222 /test 404 not founct . Ko 17} Mi. wsdte a node jr pro gown. n 1D Cuate a sexnor Uaing the Vp core Module With sad Went pie | | | comar netp = Hequibce Cnet"); COMAE rel pex = require Cl uetper"); COVaAk sexe = Uttp. vwateseruor (C 12m, x25) >% Console Log (" Raqueak =5 seq: wud; suite (xg. wel) § coke "7" hetpue home Page Cos) 5 | bHLAK ; | Cone “ /asouk ”: helper. clooukPage Cxur)s lomecu< 5 le fault 5 hitper not Found Page Cxees> los2ous 5 3 25 Wurst PORT = 2000; SOLO . Ate CPORT, C> >¢ console .logC'sexver iW ir 4 on t netp :// localhost ‘$ebort#), Ds we. LoMdk pate = nequixtt ("Par"); aa wurk homepatbh = Path . join (__ olin name “Police”, “pome -nemt "); Court aooutpat = Par your(--dixnome ; “Puotic ", “ qoouk. Wen "5 comak evi pa = path. join C__olinnomes" puoric”, “ Lot. Wen; Lousk htmtsencfile = require C'./nemisens")5 Lupors homepage = Cos) >> § a ul genet file «1 Wem Send ca. Chon patie Pd) 5 oe erncponts . Aboud PAQe = (50d) => F bot semch file sim send Caroutpatle, ss) , % euports notround Page = (seb) > § Likn Senefilt uimisencl (evcor path , 20s); 3 We wise. 9s Count fs =suquire ("fs"); emports . utmisenc = (fie path ; 20s) => § FS. wack Fus (fur path Cove tabard § iB Cover { oe Hot found") 5 Zeta § - Hes - wseite (Lata); HUD - eUL 5 3 Ds 3s nome -wemt | | Shem long = “en"> | | | Document This ty heme Page <7oool4> Gioouk Want pocument K/ HtUL> Chip TH Ww avout Page wero. WEL aloouk . WAM _ | | | { switch ([Link]){ [Link](taskfilepath, (err, data) => { [Link](200, { "content-type": “text/htm!” }) if (ern) { [Link]("File not found") }else{ [Link](data) y [Link]() ” break; case "/task": if{[Link]==="DELETE"){ [Link]("Deleoperation") let body="" [Link]("data",chunk=>{ body+=[Link](); 21 » [Link](*end",()=>{ [Link](202, {"content-typo": “application/son" }) const id=[Link](body).Id [Link](id}; [Link](t=>[Link]=eld) [Link](findindex,1) console. logifindindex); [Link]([Link]( { msg: “Task delete and ID is $(id}"} » [Link]{) » } If (reqmethod "GET"){ [Link](202, { "content-type": "application/json" }) [Link]([Link](todos)) [Link]() } if ([Link] === "POST") { let data =" [Link]("data", chunk => { data += [Link]() v reqon("end", () =>{ [Link](202, { "content-type”: "application/json" }) [Link](}SON. parse(data)); constnewTask=[Link](data) [Link]=[Link]>02([Link]+1):1 [Link](newTask) [Link](JSON. stringify( 22 { msg: "New task Insert and Id Is ${[Link]}" } » [Link]|) ” break default: [Link](200, { "content-type”: "text/htm!" }) [Link]("404 Page not found") [Link]() break; : v const PORT = 3000 serverlisten(PORT, at console log{Server is runnging on [Link]'}; y [Link] Documents/title> This Basic Todo Application 23
-Lond Datas/button> 13. Create a basic To-Do application with the express framework also perform a curd operation, [Link] { "name": "todo_apps_with_express”, "version": "1.0.0", “main”: "indexjs", "scripts": { “test”: "echo \"Error: no test specified\" && exit 1" 1 "author": “licens “description”: ™, “dependencies”: { "express": "5.2.1" ) ) [Link] const express=require("express") const path=require("path") consthomeurl=[Link](_dirname,"[Link]") const app=express() [Link]([Link]()) let todos=[ {id:1,task_tit "Task-1" status:"Not Done"}, {id:2,task_title:"Task-2",status:"Done J, {1d:3,task_title: {id:4,task_tit! 1 [Link]("/",(req,res)=>{ fask-3",status:"Not Done"}, rask-4" status:"Done") [Link](homeur!) 26 » [Link]("/task",(req,res)=>{ res,json{todos) » ‘[Link]("/task",(reqyres)=>{ /[Link]\"Form” [Link]); constnewTask={ Id:[Link]+1, task_title:[Link].task_tit [Link] } [Link](newTask) res json({msg:"Task Add") » [Link]("/task/:id",(req,res)=>{ [Link]([Link]); [Link]([Link]); todos=[Link]{task=>{ return {..tasktask_title:[Link].task_title) Jelsef return task » [Link]({msg:"Task Update"}) » [Link]("/task/:id",(req,res)=>{ todos=todos filter(task=>[Link]!=[Link]) res,json({msg:"Task Delete"}) 27 » [Link]("/task/:id/",{requres)=>{ constfilteritems=[Link](task=>[Link]==[Link]) res jsonifilteritems) » [Link]("/about” (req,res)=>{ [Link]("This is our About page") » [Link](4040,()=>{ [Link]"[Link]"); » [Link]! This our Apliiction home page -New Task ‘
es IX 14. Guate baric To-ce application with tht heLp of mongodb - [Link] const { MongoClient } = require(’mongodb’); const url = ‘mongodb://localhost:27017'; const client = new MongoClient(ur); const dbtiam asyne function ébconnectionTodost){ await [Link](); [Link]("Connection Done"); ‘const db = [Link](dbNeme); const [Link]("todos") return todosCollection; // const insertData=await [Link]({task_title:"Task-2"}) ‘// const reasultData=await [Link]().toArray() // [Link](reasultData); d [Link]=dbconnectionTodos [Link] Documenté/title> This our Apliiction home page
«button onclick="IoadData()">Load Data
{ const API_URL="[Link]"+id Heonst API_URL='hitp://localhost:4040/task/S{id)” const response=await fetch(AP|_URL,(method:"DELETE") loadData() a3 ‘const API_URL="[Link]" const resultDiv=[Link]("result") resultDivinnerHTML="" const response=await fetch(API_URL) const data=await [Link]() data fortach(element => { const ulelement=[Link]("ul") const li_task_title=[Link]("Ii") const i_status=[Link]("li") const deleteButton=[Link]("button") const updateButton=[Link]("button") const edit_task=[Link]("input") edit_task.type="text"™ edit_task.value=element.task_title [Link]="Delete "+element._id [Link]="Update” [Link]=()=>deleteData(element._id) [Link]: =>updateDatalelement._id, edit_taskvalue) Ii_task_title.innerText=element.task_title Ii_status.innerText=[Link] [Link](li_task_title) [Link](ti_status) [Link](edit_task) [Link](updateButton) [Link](deleteButton) resultDivappendChild(ulelement) » } const updateData-asyne¢ (id,update_task_title)=>{ const API_URL="httpi//localhost:4040/task/"+id 34 const response=awalt fetch(API_URL,( method:"PUT", headers: ( “Content-Type b body:![Link]({task_title:update_task_title}) y ‘application/json” loadData() ) . [Link] const express=require("express") const path=require("path") const homeurl=path,join(_dirname,"[Link]") const dbconnectionTodos=require(*./dbconnection") [Link](dbconnectionTodos); const { Objectld } = require('mongodb’); ‘const app=express() [Link](expressjson()) [Link]("view engine","ejs") /[Link]\"view engine”,"ejs") let todos=[ {id:1,task_title:" fask-1" status:"Not Done", {id:2,task_title:"Task-2" status:"Done"), {id:3,task_title:"Task-3" status:"Not Done" {id:4 task_title:"Task-4",status:"Done"} 35 app por("/ejs" {req ,ros}~>4 resrender("indent ages7 nama:*Maggn" patie tdorhy, ” app get("/home” ([Link]}e>{ [Link]("home”), ” app net("/*Areq,resie>| [Link](homeurl) [Link]("inder {todos:todas}) » app .ger"/task’ async (requres}=o{ Uhes juon\todos) const collectionsawait dbconnectiorstodosl) const resultdataxawait collectionsind\)tohrray{) [Link]}, y [Link]("/task"async (req,resj=>{ Heonsole sog\"Form' [Link]); const newTask={ [Link]+1, task_title:req.bodytask_title, status:req bodystatus } const collectionsavait dbconnectionTodos() const insertData~await [Link](new/Task) Mhtodos,push(nenTask) tes jron({msg:"Task Add") » [Link]("/task/:id" asyne (requres}=>( I [Link]. params); 11 [Link]); Htosos=[Link](task=>{ 11 [Link]){ 11 ceturn (.task,task_title:req bodytask_title) HW Yelset 1 return task uy m™ const collection=awalt dbconnectionTodost) const upadateData=awalt [Link]({_Id:new Objectid([Link])},(Ssets{task_ttle:[Link].task_title}}) M1 [Link]); res Json({msgi"Task Update") » [Link]("/tash/:id" async (req,res)=>{ Ihodos=todos filter(task=>task id j=[Link]) const collection-awalt dbconnectionTodos() const deleteDataawait [Link]({_id:new Objectid{[Link])}) res json{{msg:"Task Delete") » [Link]("/task/:id/",(req,res)=>{ const filteritems=todos filter(task=>[Link]==[Link]) res Json(fiteritems) » [Link]("/about(req,res)=>{ [Link]("This is our About page") 37 v applisten(4040,()=>{ [Link](*[Link]"}; v 38

You might also like