Each program lists the file name, the exact command to compile/run it, and the code. Tap Copy to copy any code block. Prerequisites: Node.js 18+, Git, MySQL 8, a browser (Chrome) and VS Code.
Run: save both files in one folder, then open index.html in Chrome (or VS Code Live Server). Press F12, Console tab, to see output.
Run: open index.html in the browser. To run only the functions in Node: node functions.js
Create project (once, reused for Experiments 3 to 6):
npm create vite@latest myapp -- --template react
cd myapp then npm install then npm run dev (open the shown localhost URL).
Alternative (as in the manual): npx create-react-app myapp then npm start. Replace src/App.jsx (or App.js) with each program below.
Run: in myapp: npm run dev. Replace src/App.jsx with each program.
Run: npm run dev inside myapp (needs internet for 5.2).
Run: npm run dev inside myapp.
Run: in Terminal / Git Bash. Install Git from git-scm.com. Create an empty repo on github.com first. For the password, use a Personal Access Token (GitHub, Settings, Developer settings, Tokens).
Run: inside the repository from Experiment 7.
Run: Terminal. Create an empty GitHub repo named myapp first.
Setup once: mkdir expressapp && cd expressapp, npm init -y, npm install express
Run: node server.js then open http://localhost:3000 in the browser. Stop with Ctrl+C.
Setup: npm install express mysql2
Run: node server.js. Test with Postman or curl, e.g. curl -X POST localhost:3000/items -H "Content-Type: application/json" -d "{\"name\":\"Pen\"}"
First run the SQL from Experiment 12 (create database college and table students). Change the password below.
Run: mysql -u root -p then paste the commands. Or from a file: mysql -u root -p < exp12.sql
Run (13.1): mysql -u root -p college then paste the queries.
Run (13.2): open MySQL Workbench, connect to Local instance, File, New Query Tab, paste the script, save with Ctrl+S as script.sql, run with the lightning icon (Ctrl+Enter).
Project layout: project/db/init.sql, project/db/connection.js, project/server.js
Run: mysql -u root -p < db/init.sql then npm install express mysql2 then node server.js
Steps: Form a group of 2 to 3. One member creates the repo and adds the others under Settings, Collaborators. Everyone clones and works on their own branch.