Setup
Bring a laptop and charger. Try these steps before the meeting so we can spend the hour writing code. If you get stuck, come anyway and we can help you set things up.
Before Week 1
We need an editor to write code and a browser to see what it does. We'll use VS Code as the editor.
- Download Visual Studio Code for your computer and install it. Open it once to make sure it works.
- Create a folder called
practice-page, somewhere you can find it again. Documents is fine. - In VS Code, open File > Open Folder and select
practice-page. - Save avatar.svg in that folder. If the link opens the picture, use your browser's Save As option. Keep the filename
avatar.svg.
This picture is the only file you need before Week 1. We will create the HTML and CSS files during the meeting. You can use your usual browser to open the page.
Before Week 3
This week, we will use Git from VS Code and its terminal. We will sign in with GitHub CLI, turn the practice-page folder into a repository, save its first version, and publish it from VS Code. Do not create a repository or upload the files on GitHub beforehand. We will do that together.
Install Git and GitHub CLI
VS Code has a Source Control view, but it uses Git installed on your computer. GitHub CLI, whose command is gh, will connect Git on your computer to your GitHub account.
- Follow the Git installation instructions for your operating system. On Windows, keep the installer's default choices. On macOS, run
git --versionand accept the developer tools installation if macOS asks. - Follow the GitHub CLI installation instructions for your operating system.
- Close and reopen VS Code after both installations.
- Open the
practice-pagefolder in VS Code. Choose Terminal > New Terminal. - Enter both commands, pressing Enter after each one:
git --version
gh --version
Each command should show a version number. If the terminal says it cannot find git or gh, restart your computer and try once more. Bring the error to the meeting if it still does not work.
Tell Git who you are
Git stores a name and email with each commit. In the VS Code terminal, replace the example values below with your own name and an email connected to your GitHub account:
git config --global user.name "Your Name"
git config --global user.email "yourname@stevens.edu"
git config --global init.defaultBranch main
Git will use this name and email for your commits on this computer. The last command makes new repositories start with a branch named main. To check what you saved, run:
git config --global --get user.name
git config --global --get user.email
Your commit email can be visible in a public repository. If you do not want to use a personal address, copy the no-reply address from your GitHub email settings and use it in the second command.
Sign in through GitHub CLI
- Create a free GitHub account if you do not have one. Verify the email and sign in.
- In the VS Code terminal, run these commands:
gh auth login --hostname github.com --git-protocol https --web
gh auth setup-git
gh auth status
The first command opens a browser so you can approve the sign-in. Return to the VS Code terminal when it finishes. The second command tells Git to use that sign-in when you clone, push, or pull. The last command should show your GitHub username and say that you are logged in to github.com.
- In VS Code, open Extensions and install GitHub Pull Requests, published by GitHub. This extension may ask for its own account connection when we create a pull request. Git itself will still use the account shown by
gh auth status. - Open your Week 2 page and try the button. The folder should contain
index.html,styles.css,script.js, andavatar.svg. Use the Week 2 example if you need a copy. - Find a partner and exchange GitHub usernames. You will invite each other after the repositories are published during the meeting.
Desktop VS Code is required for this meeting because vscode.dev does not have a terminal or access to Git on your computer. If you cannot install VS Code, Git, or GitHub CLI, come anyway and work beside a partner. We will arrange time to help you finish your own setup.
The VS Code Git quickstart, GitHub CLI login guide, and Git credential setup guide cover these steps.
Before Week 4
This week, we will keep using the practice-page repository and add a React project inside it. The React project needs Node.js and npm. npm downloads the code the project depends on, and Node.js runs the tools that start and check the page.
React runs the page's interface in the browser. This starter uses Vite to process JSX and serve the files during development. Node.js runs those tools on your computer; npm installs their packages and runs commands. We are not setting up a custom store backend. The Week 4 lesson explains the files after you open the starter.
Install Node.js
- Download and install the current LTS version from the Node.js download page. LTS is the version recommended for most people.
- Close and reopen VS Code after the installation.
- Open the
practice-pagefolder in VS Code. Choose Terminal > New Terminal. - Run both commands:
node --version
npm --version
Each command should show a version number. The supplied starter accepts Node v20.19.0 through the rest of the v20 line, or v22.12.0 and newer. Installing the current LTS release is the easiest way to meet that requirement. Update Node if your version is older, and bring any error message to the meeting if one of the commands does not work.
Add the React starter
- Download the Week 4 starter and extract the ZIP.
- Move the extracted
react-pagefolder intopractice-page. You should havepractice-page/react-pagewhen you finish. - Keep
practice-pageopen in VS Code. A terminal runs commands inside a current folder. A new VS Code terminal normally starts in the folder you opened.cd react-pagemeans “change directory”: enter thereact-pagefolder inside the current one.cd ..moves up one folder. If you are unsure where you are,pwdshows the path in macOS, Linux, or PowerShell;cdby itself shows it in Windows Command Prompt. Start atpractice-pageand run:
cd react-page
npm install
npm run dev
- Open the Local address shown in the terminal. You should see the React starter page.
- Return to the terminal and press Ctrl+C to stop the development server.
- Run
cd ..so the terminal returns to the top ofpractice-page.
Do not initialize another Git repository inside react-page. The existing practice-page repository will track the React files. Do not commit the starter before the meeting; we will create a branch and save the changes together.
Desktop VS Code is required because this meeting uses the terminal, Node.js, and Git. If your setup does not work, come anyway and work beside a partner.
No comments to display
No comments to display