It is crucial that you read the following instructions before working on anything in this project. Throughout this lab, make sure to commit regularly and push your changes to GitHub.
Have fun learning Javascript!
Make sure Node is installed by going to your terminal and typing the following command:
node -vIf not, download it from https://nodejs.org. Also install VSCode if you haven’t already.
-
Create a folder on your computer for 67-336. Open Terminal at this folder by CD-ing into it. Please refer to this documentation for help on how to do this: Common Terminal Commands.
-
Clone the repo using this command:
git clone https://github.com/CMU-67336-Data-Visualization/Lab01_JavaScriptFoundations.git
cd Lab01_JavaScriptFoundations- Go to your personal GitHub and create a new private repository named:
67336_Lab1
- Go to Settings > Collaborators and add:
shihonghwenchaohu1lexik04
You must do this so we can grade your lab.
git remote -vYou should see:
origin https://github.com/CMU-67336-Data-Visualization/Lab01_JavaScriptFoundations.git (fetch)
origin https://github.com/CMU-67336-Data-Visualization/Lab01_JavaScriptFoundations.git (push)
git remote remove originVerify it was removed:
git remote -vNo output means success.
git remote add origin https://github.com/YOUR-USERNAME/67336_Lab1.gitReplace YOUR-USERNAME with your GitHub username.
Verify:
git remote -vYou should now see your personal repo.
Initiate with the following command to initialize a package.json for the lab:
npm init -yThis will create a package.json file. Open package.json and replace the "scripts" section with:
"scripts": {
"start": "node index.js",
"test": "echo \"Error: no test specified\" && exit 1"
}git add .
git commit -m "Initial commit from starter repo and created package.json"
git push --set-upstream origin mainGo to Github, please make sure the files are populated into your repository. If not, please stop, and ask for help.
For best coding practices, you should not be working on the main branch. To keep your main branch clean:
- Create a new branch.
git checkout -b lab-dev- Make any changes you want to any file, then:
git add .
git commit -m "Made updates"
git push -u origin lab-dev- After you make sure the code is correct, you can merge onto main branch:
git checkout main
git merge lab-dev
git pushInside the project directory, install Node dependencies (if any) and run the code.
npm install
npm startYou should see a lot of output in your terminal.
You can use W3 Schools for support on how to write in Javascript. PLEASE DO NOT USE AI
We’ll use Vercel to deploy your JavaScript project.
Go to https://vercel.com and sign up with your GitHub account.
- On the Vercel dashboard, click “Add New Project”.
- Select your
67336_Lab1repo. - For Framework Preset, choose Other (since this is a basic HTML + JS project).
- Make sure the following settings are correct:
- Root Directory:
./(or leave blank) - Build Command: Leave blank
- Output Directory:
./or Leave blank
- Root Directory:
Then click Deploy.
After deployment finishes, you’ll get a live preview URL like:
https://67336_Lab1_yourname.vercel.app/
Submit the following:
- Your GitHub repo link
- Your Vercel live site link
shihongh, wenchaoh, lexik04 as collaborators on GitHub so we can grade your lab!
--
That’s it! You’ve cloned a project, set up Git, deployed on Vercel, and written some JavaScript!