Skip to content

refactor: reduce code duplication and improve project structure#102

Open
palchhinparihar wants to merge 6 commits intotarinagarwal:mainfrom
palchhinparihar:refactor/reduce-repeated-code
Open

refactor: reduce code duplication and improve project structure#102
palchhinparihar wants to merge 6 commits intotarinagarwal:mainfrom
palchhinparihar:refactor/reduce-repeated-code

Conversation

@palchhinparihar
Copy link

Hi, Palchhin here,

📝 Description

This PR focuses on refactoring the existing codebase to reduce repeated and duplicated logic across multiple files. The goal is to improve maintainability, readability, and scalability without altering any existing functionality or UI behavior.

Key refactoring efforts include:

  • Centralizing shared logic into reusable utilities, hooks, and components
  • Standardizing patterns for API calls, error handling, and state management
  • Improving folder structure to better separate concerns (UI, logic, services)
  • Reducing file complexity and eliminating redundant code blocks

This refactor lays a stronger foundation for future development and makes the project easier to debug, extend, and collaborate on.

🔗 Related Issue

Closes #89

🏷️ Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📝 Documentation update
  • 🎨 Style/UI update
  • ♻️ Code refactoring
  • ⚡ Performance improvement
  • 🧪 Test update

📸 Screenshots (if applicable)

N/A – No UI or visual changes were made as part of this refactor.

✅ Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have tested my changes locally
  • Any dependent changes have been merged and published

🧪 Testing

The application was tested locally to ensure no functional or behavioral changes were introduced.

  • Tested on Chrome
  • Tested on Firefox
  • Tested on mobile
  • Tested API endpoints (if applicable)

📋 Additional Notes

  • This PR is strictly a refactor; no new features or bug fixes are introduced.
  • Existing behavior, APIs, and UI remain unchanged.
  • Refactoring improves long-term maintainability and contributor experience.

SWOC 2026 Participant? Add swoc2026 label to your PR! 🎉

Let me know for any changes.

Thank you.

Copy link
Owner

@tarinagarwal tarinagarwal left a comment

Choose a reason for hiding this comment

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

Hey @palchhinparihar, thanks for the PR!

A few issues here:

  1. Theme changes should be in a separate PR - This PR includes the same olive theme changes from PR #84 (index.css, Navbar, Footer, LandingPage, AOS animations). Mixing theme changes with refactoring makes it hard to review and we can't merge an incomplete theme that only covers some pages.

  2. RoadmapDetailPage is missing functionality - 569 lines deleted but only 44 added. The Tools tab, Certifications tab, Career Path tab, Best Practices, Common Pitfalls, and Project details sections are all gone. This removes actual features, not just refactors code.

  3. AdminPanel also has significant deletions - 529 lines removed. Need to verify nothing important was lost.

  4. ScrollToTop uses undefined colors - bg-moss-accent and hover:bg-olive-primary won't work without the full theme being applied.

Please:

  • Remove all theme/styling changes (keep those in PR #84)
  • Restore the removed functionality in RoadmapDetailPage
  • Keep this PR focused only on actual refactoring (extracting reusable components, reducing duplication)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: reduce repeated code and improve overall maintainability

2 participants