Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions docs/GitHub/intro-github.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,66 @@ The fork is a personal copy of the repo which is already present or uploaded in

:::

## Troubleshooting & Common Issues

Beginner GitHub users often run into similar problems when setting up or contributing. Here are some common issues and their solutions:

:::info

### 1. Git Command Not Working
- **Problem:** Running Git commands like `git status` or `git commit` throws an error.
- **Fix:** Make sure Git is installed on your machine by running `git --version` in the terminal. If it’s not installed, [download Git](https://git-scm.com/).
- If installed but commands still fail, try restarting your terminal or reinstalling Git.

### 2. Cannot Push to Repository
- **Problem:** Errors such as “Permission denied” or “Authentication failed” when using `git push`.
- **Fix:** Set up your Git global configuration:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
- Use a Personal Access Token instead of a password for GitHub authentication. Learn how to [set up a token here](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).
- Confirm you’re pushing to the right repo:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Confirm you’re pushing to the right repo:
- Confirm you’re pushing to the right repo: Check your remote URL with `git remote -v` and ensure it matches the correct repository.

Incomplete bullet point: "Confirm you're pushing to the right repo:" has no guidance following it, leaving the troubleshooting solution unfinished.

View Details

Analysis

Incomplete troubleshooting bullet point in GitHub documentation

What fails: Line 114 in docs/GitHub/intro-github.md contains incomplete guidance: "Confirm you're pushing to the right repo:" with no actionable instructions

How to reproduce:

  1. Open docs/GitHub/intro-github.md
  2. Navigate to line 114 in the "Cannot Push to Repository" troubleshooting section
  3. Observe the bullet point ends with a colon but provides no command or guidance

Result: Users are left without actionable steps to verify their repository configuration

Expected: Bullet points in troubleshooting sections should provide complete, actionable guidance per the established pattern in the same document

Fix: Added the standard GitHub-recommended command: "Check your remote URL with git remote -v and ensure it matches the correct repository" as documented in GitHub's official remote management guide


### 3. Merge Conflicts
- **Problem:** Cannot merge branches; get conflict notifications.
- **Fix:** Open the files listed by Git, edit them to keep only the correct code, and then mark them as resolved:
git add <file>
git commit
- Detailed steps: [Resolving merge conflicts](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts).

### 4. Cannot Install Dependencies
- **Problem:** Running `npm install` fails due to missing modules or permission errors.
- **Fix:** Try deleting the existing dependencies and reinstalling:
rm -rf node_modules
npm install

:::

_For more troubleshooting tips, see the [Beginner Git Guide](https://rogerdudler.github.io/git-guide/) or [GitHub Troubleshooting Docs](https://docs.github.com/en/contributing/setting-up-your-environment-to-work-on-github-docs/troubleshooting-your-environment)._

---

## Real-World Use Cases & Examples

Seeing how GitHub is used in genuine projects makes concepts easier to grasp:

:::info
### Example 1: Team Collaboration Workflow
Suppose a team is building an e-commerce platform:
- Developer 1 codes the men’s section on a separate branch.
- Developer 2 creates the women’s section in another branch.
- Developer 3 works on the login feature in a third branch.
- All changes are pushed to their respective branches, reviewed as pull requests, and merged into the main branch once approved.

### Example 2: Issue Tracking
- A user spots a bug, opens a GitHub Issue describing the problem.
- Maintainer labels the issue (“bug”, “good first issue”), assigns it, and links any related pull requests.
- Once a fix is merged, the issue auto-closes, keeping project history clear.

### Example 3: Open Source Contributions
- A contributor finds a typo in the documentation.
- They fork the repo, fix the typo, and open a pull request.
- Maintainers review and merge, improving the docs for everyone.
:::


### Watch the video Tutorial
Expand Down
98 changes: 98 additions & 0 deletions docs/NodeJS-Setup/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
id: setup-nodejs
title: Setting Up Node.js for Local Development
sidebar_label: Node.js Setup
description: A beginner's guide to installing and configuring Node.js on your local machine.
slug: /NodeJS-Setup
---

# Setting Up Node.js for Local Development

## Introduction
Node.js is a powerful JavaScript runtime that allows you to run JavaScript code outside of a web browser. It's essential for building modern web applications, APIs, and tools. In this tutorial, we'll walk through the steps to set up Node.js on your local machine. By the end, you'll have a working environment ready for development.

This guide is aimed at beginners, so we'll cover everything from installation to verification. If you're new to programming, don't worry—we'll keep it simple!

## Prerequisites
Before we begin, make sure you have:
- A computer with internet access (Windows, macOS, or Linux).
- Administrative privileges on your machine (to install software).
- A code editor like VS Code (optional but recommended for writing code).

Estimated time: 10-15 minutes.

## Step-by-Step Guide

### Step 1: Download Node.js
1. Go to the official Node.js website at [nodejs.org](https://nodejs.org).
2. On the homepage, you'll see two versions: LTS (Long Term Support, recommended for stability) and Current (for the latest features).
- For beginners, choose the LTS version.
3. Click on the "LTS" download button. This will automatically detect your operating system and provide the correct installer.

### Step 2: Install Node.js
The installation process varies slightly by operating system. Follow the instructions for your OS:

- **Windows**:
1. Run the downloaded installer (e.g., `node-vXX.XX.X-x64.msi`).
2. Follow the wizard: Accept the license, choose the default installation options, and click "Install."
3. Once complete, click "Finish."

- **macOS**:
1. Open the downloaded `.pkg` file.
2. Follow the installer prompts: Agree to the license and click "Continue" through the steps.
3. Enter your administrator password if prompted.
4. After installation, open a terminal to verify.

- **Linux (e.g., Ubuntu)**:
1. Download the installer or use the package manager. For Ubuntu, open a terminal and run:
```
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
```
2. If you downloaded the installer, extract it and follow the on-screen instructions.
### Step 3: Verify the Installation
After installation, let's check if Node.js is working correctly:
1. Open your terminal or command prompt.
2. Type the following command and press Enter:
node -v
- This should display the version of Node.js, e.g., `v18.12.1`.
3. Next, check if npm (Node Package Manager) is installed:
npm -v
- This should show a version like `8.19.2`. npm is used to install packages and dependencies.
If you see the versions printed, congratulations—Node.js is set up successfully!
### Step 4: Set Up a Simple Project (Optional Hands-On)
To make this more practical, let's create a simple "Hello World" project:
1. In your terminal, create a new directory:
mkdir my-first-node-project cd my-first-node-project
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mkdir my-first-node-project cd my-first-node-project
mkdir my-first-node-project && cd my-first-node-project

Two shell commands are incorrectly combined on a single line without proper separation. A beginner following this tutorial will get an error when trying to execute this command.

View Details

Analysis

Shell commands incorrectly combined without separator in Node.js setup tutorial

What fails: Line 74 in docs/NodeJS-Setup/index.md contains mkdir my-first-node-project cd my-first-node-project which combines two shell commands without proper separation

How to reproduce:

mkdir my-first-node-project cd my-first-node-project

Result: Creates directories named "my-first-node-project" and "cd" instead of creating directory and changing into it. Shell interprets cd as an argument to mkdir

Expected: Should create directory and then change into it. Fixed by adding && operator: mkdir my-first-node-project && cd my-first-node-project

2. Create a new file called `app.js` using your code editor:
echo 'console.log("Hello, Node.js!");' > app.js
3. Run the file with Node.js:
node app.js
4. You should see: `Hello, Node.js!` printed in the terminal.
## Troubleshooting Common Issues
- **Error: 'node' is not recognized**: Ensure Node.js was added to your system's PATH during installation. Restart your terminal or computer and try again.
- **Permission errors on macOS/Linux**: If you encounter issues, try running commands with `sudo`, but be cautious.
- **Version mismatches**: If the versions don't match, double-check the installation or reinstall from the official site.
For more help, refer to the [official Node.js documentation](https://nodejs.org/en/docs/).
## Conclusion
You've now set up a local development environment with Node.js! This is your first step toward building web applications, experimenting with frameworks like React, or contributing to projects like Recode Hive. Once you're comfortable, try creating a simple web server or exploring npm packages.
If you found this tutorial helpful, consider sharing your experience in the Recode Hive community. Happy coding! 🚀
---
62 changes: 62 additions & 0 deletions src/components/tutorialCompletion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// src/components/tutorialCompletion.tsx
import React, { useState } from 'react';
import { triggerConfetti } from './ConfettiUtils'; // Import from the separate confetti utility
Copy link
Contributor

@vercel vercel bot Oct 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { triggerConfetti } from './ConfettiUtils'; // Import from the separate confetti utility
import { triggerConfetti } from '../utils/ConfettiUtils'; // Import from the separate confetti utility

The import path for ConfettiUtils is incorrect - it's in the utils directory, not the components directory, which will cause a module resolution error at runtime.

View Details

Analysis

Incorrect import path causes module resolution error in TutorialCompletion component

What fails: TutorialCompletion component imports triggerConfetti from './ConfettiUtils' but ConfettiUtils.tsx is located in src/utils/, not src/components/

How to reproduce:

npm run build

Result: Build fails with error: Module not found: Error: Can't resolve './ConfettiUtils' in '/vercel/sandbox/sandpits/kind-crow/src/components'

Expected: Import should resolve correctly to src/utils/ConfettiUtils.tsx using relative path '../utils/ConfettiUtils'


interface TutorialCompletionProps {
tutorialTitle?: string; // Optional prop for the tutorial name
onComplete?: () => void; // Optional callback for additional logic (e.g., update dashboard)
}

const TutorialCompletion: React.FC<TutorialCompletionProps> = ({
tutorialTitle = 'this tutorial',
onComplete,
}) => {
const [isCompleted, setIsCompleted] = useState(false);

const handleComplete = () => {
if (isCompleted) return; // Prevent multiple triggers

setIsCompleted(true);

// Trigger confetti for celebration
try {
triggerConfetti();
} catch (error) {
console.warn('Confetti failed to trigger:', error);
}

// Optional: Call parent callback (e.g., to save progress or update UI)
if (onComplete) {
onComplete();
}
};

return (
<div style={{ textAlign: 'center', margin: '20px 0' }}>
<h3>Complete {tutorialTitle}</h3>
{!isCompleted ? (
<button
onClick={handleComplete}
style={{
padding: '10px 20px',
backgroundColor: '#2563eb', // Match theme colors
color: 'white',
border: 'none',
borderRadius: '5px',
cursor: 'pointer',
fontSize: '16px',
}}
aria-label={`Mark ${tutorialTitle} as complete`}
>
Mark as Complete
</button>
) : (
<p style={{ color: '#10b981', fontWeight: 'bold' }}>
🎉 {tutorialTitle} Completed! Great job!
</p>
)}
</div>
);
};

export default TutorialCompletion;
10 changes: 10 additions & 0 deletions src/pages/TutorialPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import TutorialCompletion from '../components/tutorialCompletion';

const TutorialPage = () => (
<div>
<h1>My Tutorial</h1>
{/* Tutorial content here */}
<TutorialCompletion tutorialTitle="Git Basics" onComplete={() => console.log('Tutorial done!')} />
</div>
);

17 changes: 17 additions & 0 deletions src/utils/ConfettiUtils.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// src/components/ConfettiUtils.tsx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file path comment is incorrect - the file is in src/utils/ not src/components/, which suggests confusion about the actual file location.

View Details
📝 Patch Details
diff --git a/src/components/tutorialCompletion.tsx b/src/components/tutorialCompletion.tsx
index 8d5f57c..3c146ae 100644
--- a/src/components/tutorialCompletion.tsx
+++ b/src/components/tutorialCompletion.tsx
@@ -1,6 +1,6 @@
 // src/components/tutorialCompletion.tsx
 import React, { useState } from 'react';
-import { triggerConfetti } from './ConfettiUtils';  // Import from the separate confetti utility
+import { triggerConfetti } from '../utils/ConfettiUtils';  // Import from the separate confetti utility
 
 interface TutorialCompletionProps {
   tutorialTitle?: string;  // Optional prop for the tutorial name
diff --git a/src/utils/ConfettiUtils.tsx b/src/utils/ConfettiUtils.tsx
index 5088a36..a32a92e 100644
--- a/src/utils/ConfettiUtils.tsx
+++ b/src/utils/ConfettiUtils.tsx
@@ -1,4 +1,4 @@
-// src/components/ConfettiUtils.tsx
+// src/utils/ConfettiUtils.tsx
 import confetti from 'canvas-confetti';
 
 /**

Analysis

Incorrect file path comment in ConfettiUtils.tsx

What fails: File comment in src/utils/ConfettiUtils.tsx incorrectly states // src/components/ConfettiUtils.tsx, causing confusion about file location and contributing to incorrect import path in tutorialCompletion.tsx

How to reproduce: Check line 1 of src/utils/ConfettiUtils.tsx - comment shows wrong directory

Result: Comment shows // src/components/ConfettiUtils.tsx but file is actually in src/utils/ directory

Expected: Comment should accurately reflect actual file path as // src/utils/ConfettiUtils.tsx (consistent with other files in codebase that have correct path comments)

Additional context: This incorrect comment contributed to the wrong import path './ConfettiUtils' in tutorialCompletion.tsx which was importing from non-existent relative path

import confetti from 'canvas-confetti';

/**
* Triggers a celebratory confetti effect.
* Can be used for achievements, completions, or interactions.
*/
export const triggerConfetti = () => {
confetti({
particleCount: 100, // Number of particles (adjust for intensity)
spread: 70, // Spread angle in degrees
origin: { y: 0.6 }, // Start position (center-ish screen)
colors: ['#2563eb', '#7c3aed', '#10b981'], // Custom colors (blue, purple, green – match leaderboard/theme)
duration: 2000, // Optional: How long it lasts (in ms)
});
};