Skip to content

Aivolutions/Github-Relay01

Repository files navigation

πŸ› Bug Bounty - Batch 1

Welcome to the CampusMart Bug Bounty Program! This is a hands-on learning project designed to help students develop real-world debugging and problem-solving skills by fixing bugs in a production-like Next.js e-commerce application.

πŸ“‹ Table of Contents


🎯 About the Project

This Bug Bounty program contains 15 carefully documented bugs across different categories:

  • UI/UX Issues - Responsive design, browser compatibility
  • Authentication & Security - Form validation, session management
  • Code Quality - Refactoring, best practices
  • Features - Missing components, enhancements

Each bug is documented with:

  • βœ… Severity Level (Critical, High, Medium, Low)
  • βœ… Exact Location (File paths and line numbers)
  • βœ… Expected vs Actual Behavior
  • βœ… Step-by-step Reproduction
  • βœ… Hints for Resolution

πŸ›’ What is CampusMart?

CampusMart is a college marketplace platform built with Next.js that allows students to:

  • Buy and sell products within their campus
  • Browse listings by category
  • Manage user authentication (buyers and sellers)
  • View product details and seller information

This is a real-world application with intentional bugs for educational purposes.


πŸŽ“ Learning Objectives

By completing this bug bounty, you will:

  1. Master Debugging Skills

    • Learn to read error messages and stack traces
    • Use browser DevTools effectively
    • Understand common web development pitfalls
  2. Improve Code Quality

    • Apply DRY (Don't Repeat Yourself) principles
    • Refactor code for maintainability
    • Follow React and Next.js best practices
  3. Enhance Problem-Solving

    • Analyze root causes systematically
    • Test solutions thoroughly
    • Document your changes
  4. Gain Real-World Experience

    • Work with production-like codebases
    • Fix responsive design issues
    • Implement security best practices

πŸ› οΈ Technology Stack

Technology Version Purpose
Next.js 16.1.3 React framework with App Router
React 19.1.1 UI library
MongoDB 6.18.0 Database
Mongoose 8.17.1 ODM for MongoDB
Tailwind CSS 3.4.17 Styling framework
NextAuth 5.0.0-beta.25 Authentication
Framer Motion 12.23.12 Animations
Lucide React 0.536.0 Icon library

βœ… Prerequisites

Before you begin, ensure you have:


πŸš€ Getting Started

1. Clone the Repository

git clone <repository-url>
cd Bug-Bounty

2. Install Dependencies

npm install

3. Set Up Environment Variables

Create a .env.local file in the root directory:

# MongoDB Connection
MONGODB_URI=your_mongodb_connection_string

# NextAuth Configuration
NEXTAUTH_SECRET=your_secret_key_here
NEXTAUTH_URL=http://localhost:3000

# Other configurations as needed

4. Run the Development Server

npm run dev

Open http://localhost:3000 in your browser.

5. Verify Installation

  • βœ… Homepage loads without errors
  • βœ… Navigation works
  • βœ… Can access login/registration pages

πŸ”§ Bug Fixing Workflow

Follow this systematic approach for each bug:

Step 1: Read the Bug Report

Open BUGS.md and select a bug to fix. Each bug includes:

  • Category and Severity
  • Description of the issue
  • Location (exact files and line numbers)
  • Expected vs Actual Behavior
  • Steps to Reproduce
  • Hints for resolution

Step 2: Reproduce the Bug

  1. Follow the "Steps to Reproduce" exactly
  2. Observe the actual behavior
  3. Confirm the bug exists
  4. Take screenshots/notes if helpful

Step 3: Implement the Fix

  1. Create a new branch for your fix:

    git checkout -b fix/bug-<number>-<short-description>

    Example: git checkout -b fix/bug-1-hero-mobile-overlap

  2. Make your changes following the guide

  3. Test your fix thoroughly

  4. Commit with a descriptive message:

    git add .
    git commit -m "Fix Bug #1: Resolve hero section overlap on mobile"

Step 4: Verify the Fix

Create your own verification checklist:

  • βœ… Bug no longer occurs
  • βœ… No new bugs introduced
  • βœ… Code follows best practices
  • βœ… Works across different browsers/devices (if applicable)

Step 5: Document Your Work

Add comments explaining:

  • What was broken
  • Why it was broken
  • How you fixed it

🐞 Available Bugs (Batch 1)

Critical Priority (1 bug)

  • Bug #11: User Session Not Persisting After Refresh

High Priority (2 bugs)

  • Bug #2: Missing Field Validation for Registration Form
  • Bug #3: "Forgot Password" Link Redirects to 404

Medium Priority (6 bugs)

  • Bug #1: Overlapping Text in Hero Section on Mobile
  • Bug #6: Missing Unique Key Prop in Seller List
  • Bug #8: Header Logo Distortion on Safari
  • Bug #10: Missing Loading Spinner Component
  • Bug #12: API URLs Hardcoded in Components
  • Bug #14: Footer Links Not Clickable on Small Screens

Low Priority (6 bugs)

  • Bug #4: Navbar Code Duplication
  • Bug #5: Missing "Show/Hide Password" Toggle in Login
  • Bug #7: Inconsistent Button Styles
  • Bug #9: README Installation Instructions Incorrect
  • Bug #13: Missing Custom 404 Error Page
  • Bug #15: Incorrect Primary Color in Tailwind Config

Total Bugs in Batch 1: 15 bugs


πŸ’‘ How to Approach Each Bug

For UI/Responsive Issues (Bugs #1, #8, #14)

  1. Use browser DevTools (F12)
  2. Toggle device toolbar for mobile testing
  3. Inspect CSS styles and layout
  4. Test on multiple screen sizes
  5. Check browser compatibility

For Authentication/Security (Bugs #2, #3, #11)

  1. Review authentication flow
  2. Check form validation logic
  3. Test with valid/invalid inputs
  4. Verify token storage and retrieval
  5. Test session persistence

For Code Quality (Bugs #4, #7, #12)

  1. Identify code duplication
  2. Extract reusable components
  3. Create centralized configurations
  4. Follow DRY principles
  5. Ensure consistency across codebase

For Missing Features (Bugs #10, #13)

  1. Research best practices
  2. Create new components
  3. Implement with proper styling
  4. Integrate into existing pages
  5. Test thoroughly

πŸ§ͺ Testing & Verification

Manual Testing Checklist

For each bug fix, verify:

  • Functionality: Bug is completely resolved
  • No Regressions: No new bugs introduced
  • Cross-Browser: Works in Chrome, Firefox, Safari
  • Responsive: Works on mobile, tablet, desktop
  • Accessibility: Keyboard navigation, screen readers
  • Performance: No significant slowdowns

Browser Testing

Test your fixes in:

  • βœ… Chrome (latest)
  • βœ… Firefox (latest)
  • βœ… Safari (if available)
  • βœ… Mobile browsers (Chrome Mobile, Safari iOS)

Device Testing

Test responsive issues on:

  • βœ… Desktop (1920px+)
  • βœ… Laptop (1366px)
  • βœ… Tablet (768px)
  • βœ… Mobile (375px, 320px)

Console Checks

Always check browser console for:

  • ❌ No errors
  • ❌ No warnings
  • ❌ No React key warnings

πŸ“€ Submission Guidelines

What to Submit

  1. Code Changes

    • All modified files
    • New files created
    • Proper Git commits
  2. Documentation

    • Brief description of your fix
    • Any challenges faced
    • Screenshots (before/after) for UI bugs
  3. Testing Evidence

    • List of tests performed
    • Browser/device compatibility results

Submission Format

Create a pull request with:

Title: Fix Bug #<number>: <Short Description>

Description Template:

## Bug Fixed
Bug #<number>: <Bug Title>

## Changes Made
- Modified: <list of files>
- Created: <list of new files>
- Deleted: <list of removed files>

## Root Cause
<Brief explanation of what caused the bug>

## Solution
<How you fixed it>

## Testing Performed
- [ ] Manual testing
- [ ] Cross-browser testing
- [ ] Responsive testing
- [ ] Console error check

## Screenshots
<Before and after screenshots for UI bugs>

## Notes
<Any additional information>

πŸ“š Resources

Official Documentation

Debugging Tools

Learning Resources

Project Documentation


πŸ†˜ Support

Getting Help

  1. Read the Documentation First

    • Check BUGS.md for bug details and hints
    • Search TECHNICAL_DOCUMENTATION.md for architecture info
    • Review the bug description carefully
  2. Debug Systematically

    • Use console.log() to trace execution
    • Check browser console for errors
    • Use React DevTools to inspect components
  3. Ask for Help

    • Describe what you've tried
    • Share error messages
    • Provide code snippets
    • Include screenshots

Common Issues

Issue: npm install fails

  • Solution: Delete node_modules and package-lock.json, then run npm install again

Issue: MongoDB connection error

  • Solution: Verify MONGODB_URI in .env.local is correct

Issue: Port 3000 already in use

  • Solution: Kill the process or use a different port: npm run dev -- -p 3001

Issue: Changes not reflecting

  • Solution: Hard refresh (Ctrl+Shift+R) or restart dev server

🎯 Tips for Success

  1. Start with Low Priority Bugs: Build confidence before tackling critical issues
  2. Read Code Carefully: Understand the context before making changes
  3. Test Thoroughly: Don't just fix the bug, ensure nothing else breaks
  4. Document Your Work: Future you (and others) will thank you
  5. Learn from Each Bug: Each fix teaches you something new
  6. Don't Rush: Quality over speed
  7. Ask Questions: No question is too small

πŸ† Completion Criteria

You've successfully completed the Bug Bounty when:

  • βœ… All 15 valid bugs are fixed
  • βœ… All verification checklists pass
  • βœ… No console errors or warnings
  • βœ… Code follows best practices
  • βœ… Documentation is complete
  • βœ… All tests pass

πŸ“ License

This project is for educational purposes only.


πŸ™ Acknowledgments

Thank you for participating in the CampusMart Bug Bounty Program! Your contributions help improve the platform and enhance your development skills.

Happy Bug Hunting! πŸ›πŸ”


Last Updated: January 2026
Version: 1.0.0
Batch: 1 (Core Foundation & Auth)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors