Web Development with
Node.js, Wrangler,
GitHub & Pages.dev
A Complete Step-by-Step Guide
02
What We'll Cover
Foundation
- Introduction to Node.js
- Installing & Setting Up Node
- Understanding Wrangler
- GitHub Basics
- Deploying with Pages.dev
Practice & Resources
- Version Control with Git
- Project Deployment Steps
- Best Practices
- Helpful Resources
- Getting Help & Community
03
What is Node.js?
Node.js is a JavaScript runtime built on Chrome's V8 engine that lets you run JavaScript on the server side.
Server-Side JS
Run JavaScript outside browsers
Fast & Scalable
Build high-performance applications
NPM Ecosystem
Access millions of packages
04
Step 1
Installing Node.js
Visit nodejs.org
- Open your web browser
- Navigate to https://nodejs.org
- Choose the LTS (Long Term Support) version
- Download the installer for your operating system
Pro Tip
Always choose LTS version for stability and long-term support!
05
Step 2
Installing Node.js
Run the Installer
- Double-click the downloaded installer file
- Follow the installation wizard
- Accept the license agreement
- Keep default settings (recommended)
- Click 'Install' and wait for completion
06
Step 3
Verifying Installation
Open Terminal/Command Prompt
- Windows: Press Win + R, type 'cmd', press Enter
- Mac: Press Cmd + Space, type 'terminal'
- Linux: Press Ctrl + Alt + T
Run These Commands
node --version
npm --version
You should see version numbers for both!
07
What is Wrangler?
Wrangler is Cloudflare's command-line tool for managing and deploying Workers and Pages applications.
Build & Test
Develop locally before deploying
Deploy
Push code to Cloudflare's edge
Manage
Monitor and update applications
08
Installing Wrangler
Installation Command
Open your terminal and run:
npm install -g wrangler
What's happening?
- The
-g flag installs Wrangler globally
- You can now use 'wrangler' commands anywhere
- Verify with:
wrangler --version
Pro Tip
If you get permission errors, try running with administrator privileges!
09
Connecting Wrangler to Cloudflare
Step 1: Login
wrangler login
This opens your browser for authentication
Step 2: Authorize
- Browser opens automatically
- Sign in to your Cloudflare account
- Click 'Authorize Wrangler'
- Return to terminal - you're connected!
10
What is GitHub?
Version Control & Collaboration Platform
A platform for hosting and collaborating on code using Git version control
Version Control
Track changes over time
Collaboration
Work with teams globally
Code Hosting
Store code in the cloud
11
Creating a GitHub Account
Sign Up Steps
- Visit https://github.com
- Click 'Sign Up' in the top right corner
- Enter your email address
- Create a strong password
- Choose a unique username
- Verify your account via email
Security First!
Enable two-factor authentication (2FA) for extra security
12
Installing Git
Download Git
- Visit https://git-scm.com
- Click 'Download for [Your OS]'
- Run the installer
- Use default settings
Verify Installation
git --version
You should see the Git version number
13
Configuring Git
Set Your Identity
Configure your name:
git config --global user.name "Your Name"
Configure your email:
git config --global user.email "your.email@example.com"
Important!
Use the same email address as your GitHub account
14
Creating a GitHub Repository
- Click the + icon in top right of GitHub
- Select 'New repository'
- Enter a repository name (e.g., 'my-website')
- Add a description (optional)
- Choose Public or Private /
- Check 'Add a README file'
- Click 'Create repository'
15
Cloning Your Repository
Get the Repository URL
- Go to your repository on GitHub
- Click the green 'Code' button
- Copy the HTTPS URL
Clone to Your Computer
Open terminal and run:
git clone [URL]
Replace [URL] with the copied URL
16
What is Cloudflare Pages?
Lightning-Fast Deployment Platform
Deploy static websites and full-stack applications at the edge
⚡ Fast
Global CDN distribution
🔄 Auto Deploy
Deploys from GitHub automatically
💰 Free
Generous free tier
17
Connecting Pages to GitHub
- Go to https://pages.cloudflare.com
- Sign in with your Cloudflare account
- Click 'Create a project'
- Choose 'Connect to Git'
- Authorize Cloudflare to access GitHub
- Select your repository
- Click 'Begin setup'
18
Configuring Build Settings
Common Frameworks
- React: npm run build → build/
- Vue: npm run build → dist/
- Next.js: Auto-detected
Static HTML Site
Build command: (leave empty)
Build output: /
19
Deploying Your Site
Save and Deploy! 🚀
- Review your settings
- Click 'Save and Deploy'
- Wait for the build to complete (usually 1-3 minutes)
- Your site is live! 🎉
Congratulations!
Your website is now live on the internet!
20
Git Workflow Basics
1. Add Changes
git add .
Stages all changes
2. Commit
git commit -m "message"
Saves changes locally
3. Push
git push
Uploads to GitHub
21
Making Updates to Your Site
The Update Cycle
- Make changes to your files locally
- Stage changes:
git add .
- Commit:
git commit -m "description"
- Push to GitHub:
git push
- Pages.dev automatically rebuilds and deploys! ⚡
It's Magic!
Every push triggers an automatic deployment. No manual work needed!
22
Direct Deploy with Wrangler
Quick Deploy Command
For static sites:
wrangler pages deploy [directory]
Example:
wrangler pages deploy ./dist
When to use?
Perfect for quick deployments without committing to Git
Best Practice
Use Git workflow for production, Wrangler for testing
23
Best Practices
Git Commits
- Write clear commit messages
- Commit often, push regularly
- Use present tense
- Be descriptive but concise
Project Organization
- Keep a clean folder structure
- Use .gitignore for node_modules
- Add a README.md file
- Document your code
25
More Learning Resources
W3Schools
Tutorials and references for web technologies
w3schools.com
26
Official Documentation
Node.js Documentation
Official Node.js guides and API documentation
nodejs.org/docs
27
Community & Help
Dev.to
Developer community and articles
dev.to
28
Troubleshooting Tips
Common Issues
- Node not recognized?
Restart terminal after install
- Git push rejected?
Pull changes first: git pull
- Build failing?
Check build command and output folder
Quick Fixes
- Clear cache:
npm cache clean --force
- Reinstall: Delete node_modules, run npm install
- Check versions:
node -v, npm -v
29
Quick Command Reference
Git Commands
git add .
git commit -m 'message'
git push
git pull
git status
Node & Wrangler
node --version
npm install [package]
wrangler login
wrangler pages deploy
You're Ready to Build!
Start creating amazing web projects
Happy Coding! 🚀
1 / 30
← Previous | → Next | Home First | End Last | ? Toggle Help