Research & Innovation Team

Contribution Instructions

Follow this workflow step by step to contribute safely without conflicts.

Back to Showcase Open Templates Page Watch Reference Video

Contribution Workflow

Follow this flow exactly to avoid merge conflicts, keep contributions clean, and make sure your JSON shows correctly on the index page.

Important: Do not make any changes in the main index.html file. Your card is created automatically from your JSON file!
Never push directly to main. Always pull latest changes first, work in your own branch, and push only to your branch.
Do not raise a PR directly. First create an Issue, wait until it is assigned to you, then start code changes and create PR.

0) Mandatory First Step: Issue First, Then PR

1) Branch and File Naming Rules

1.1) Important: Automatic Updates (NO index.html Editing Needed!)

You DO NOT need to edit index.html! The system automatically updates when you add files.

Your JSON File Format:

{\n  "name": "Your Name",\n  "year": "1st Year CSE",\n  "intro": "Your short intro about yourself",\n  "portfolio": "portfolios/your-name.html"\n}\n

2) First Three Example Structures (Use the same pattern)

Example 1

Branch: john-doe

Files: data/john-doe.json, portfolios/john-doe.html

Example 2

Branch: karthik

Files: data/karthik.json, portfolios/karthik.html

Example 3

Branch: rahul

Files: data/rahul.json, portfolios/rahul.html

2.1) Why You Don't Edit index.html (Auto-Discovery System)

The Process:
You push your files → JavaScript runs → Discovers data/your-name.json → Reads it → Creates card → Displays on page 🎉

3) Add Upstream Remote (Do this once after cloning)

What is upstream? Upstream is the original repository. You need to add it so you can sync with the latest changes from the main project.

# Add upstream remote (do this only once)
git remote add upstream <original-repository-url>

# Verify it was added correctly
git remote -v

Expected Output:

origin    https://github.com/your-username/portfolio-showcase.git (fetch)
origin    https://github.com/your-username/portfolio-showcase.git (push)
upstream  https://github.com/original-owner/portfolio-showcase.git (fetch)
upstream  https://github.com/original-owner/portfolio-showcase.git (push)
Error: "error: remote upstream already exists"
Fix: You already added upstream before. Run git remote -v to verify it's correct. If wrong, remove and re-add:
git remote remove upstream
git remote add upstream <correct-url>

4) Command Flow (Run in this order)

# Clone once (skip if already cloned)
git clone <repository-url>
cd portfolio-showcase

# Add upstream remote (if not done yet)
git remote add upstream <original-repository-url>

# Create Issue first on GitHub website and get assigned
# Optional GitHub CLI alternative:
# gh issue create --title "Add your-name portfolio" --body "I will add data/your-name.json and portfolios/your-name.html"
# Start coding only after assignment.

# Always sync first
git checkout main
git pull origin main

# Create and switch to your own branch
git checkout -b your-name

# Pull again to be safe before editing
git pull origin main

# Make your changes in only these files
# portfolios/your-name.html
# data/your-name.json

# Check what changed
git status

# Add only your own files (example)
git add portfolios/john-doe.html data/john-doe.json

# Commit
git commit -m "Add john-doe portfolio"

# Push to your branch
git push -u origin your-name

Start editing only after issue assignment. After you push your branch, raise PR using the GitHub website only (not CLI) and use the PR template from templates page.

5) Common Errors & Fixes

❌ Error: "fatal: not a git repository"

Cause: You're not in correct folder.

Fix:

cd portfolio-showcase
git status

❌ Error: "Your local changes would be overwritten"

Cause: Unsaved changes exist.

Fix:

git add .
git commit -m "Save changes"
git pull origin main

❌ Error: "no upstream branch"

Cause: Push without -u flag.

Fix:

git push -u origin your-name

❌ Merge Conflicts

Cause: Same file modified elsewhere.

Fix: Remove conflict markers, keep code, then:

git add .
git commit -m "Resolved conflict"
git push origin your-name

6) Automatic Updates from Upstream

Keep your fork synced with latest changes from original project:

# Fetch and merge upstream changes
git fetch upstream
git checkout main
git merge upstream/main
git push origin main

# Or use this one-liner
git fetch upstream && git checkout main && git merge upstream/main && git push origin main

Run this regularly before making new changes!

7) Final Step

Open a Pull Request from your-name branch to main on GitHub website, and link your assigned Issue in PR description using Closes #issue-number.

8) Technical Deep Dive: How Auto-Discovery Works

Step 1: File Discovery

The script.js scans the data/ folder and finds all JSON files automatically using GitHub API.

Step 2: JSON Loading

Each JSON file is fetched and parsed. Your contributor data is extracted safely.

Step 3: Card Generation

Dynamic HTML cards are created from your JSON data with proper escaping and error handling.

Step 4: Auto-Rendering

Cards are sorted alphabetically and displayed with smooth animations and responsive layout.

Why This Design? This approach avoids merge conflicts, makes contribution easy, and teaches you real-world practices like API integration and dynamic content generation!