A Cup of Web Development - Essential Tools and Concepts In Action
Estimated read time: 4 min
This article is second in a series of blog I'm writing to help beginners learn web development. Let's get started.
An Introduction to Developing on Your Localhost
Step 1: Install Homebrew & Git
Homebrew is the missing package manager for Mac. It simplifies the installation and maintenance of most of your development toolkit. Homebrew is cross platform and works on Linux as well.
-
Use Spotlight Search to open your terminal
-
Install Homebrew using cURL by running the following command:
- Add Homebrew to
PATH
once the installation is complete:
~/.zshrc
with~/.bashrc
if you're running Bash.
- Install Git:
Step 2: Install Visual Studio Code, add to PATH, and install Live Server extension
- Download and install Visual Studio Code, aka, VS Code
- Open VS Code
- Inside VS Code, press
Cmd + Shift + P
- Type
shell command
in the dropdown input - Select
Install 'code' command in PATH
- Click the Extensions icon in the Activity Bar on the far left
- Search for Live Server by Ritwick Dey
- Click Install
Step 3: Create your first project using HTML & CSS
- Open your terminal and make a directory at
~
calledDevelop
:
- Change into
Develop
and make a directory calledmyFirstHtml
:
- Change into
myFirstHtml
and create two files,index.html
&styles.css
:
- Open
index.html
in VS Code and add the following HTML boilerplate:
- Open
styles.css
in VS Code and add the following CSS:
- Import
styles.css
by adding a<link>
tag in the<head>
ofindex.html
:
- Serve the project in the browser using Live Server
- Click the Go Live button in the bottom right corner of your IDE (VS Code)
- Wait for the for the message Starting... to disappear and Port: 5500 appears
- Live Server should open a new browser at
http://127.0.0.1:5500/
- You can also manually navigate to
http://localhost:5500/
in your browser - Upon celebrating your success you may click the Port: 5500 button to dispose of the Live Server and move on to your next task
Step 4: Create a GitHub account and configure SSH keys
-
If you don't already have one, create a GitHub account.
-
I would write the rest of this tutorial, but GitHub has done a great job with documentation. Follow each of these tutorials carefully and in order:
Step 5: Create a repository and push your first commit to GitHub
-
Follow GitHub's documentation on creating a new repository
-
Follow GitHub's documentation on adding locally hosted code to GitHub
GitHub's tutorial on adding locally hosted code can be somewhat confusing. Feel free to run the following commands from the root directory of your project for the same effect:
Congratulations! You've set up your first HTML/CSS project, served it with Live Server, and pushed it to GitHub. Don't fret if you weren't able to understand all of this or get the project running. In the next article we're going to learn how to learn web development. Come back later and give this another shot.
As additional material, please read this primer on Git and GitHub. You might also want to save this Git Cheat Sheet from GitHub.
What's next?: A Pound of Web Development
Check out my other posts from this blog series: