Skip to content

Conversation

@ykaydogdu
Copy link
Contributor

PR: Refactor Frontend Into New Module Structure & Simplify Header Navigation

Summary

This PR refactors the entire frontend into a clean module-based architecture and simplifies the Header navigation by removing clutter and relocating sub-features into their respective module pages.

The goal is to improve maintainability, reduce cognitive load, enable per-module dynamic routing, and prepare the codebase for upcoming feature flows such as the redesigned mentorship experience and workplace/job UI updates.

This is an architectural PR with no functional feature changes but many structural improvements.


Key Changes

1. Introduced New Module-Oriented Folder Structure

Reorganized src/ into a clear domain-driven layout:

src/
├─ modules/
│ ├─ auth/
│ ├─ jobs/
│ │ ├─ pages/
│ │ ├─ components/
│ │ ├─ services/
│ │ └─ hooks/
│ ├─ workplaces/
│ │ ├─ pages/
│ │ ├─ services/
│ │ └─ components/
│ ├─ mentorship/
│ │ ├─ pages/
│ │ ├─ components/
│ │ ├─ services/
│ │ └─ hooks/
│ ├─ forum/
│ ├─ profiles/
│ └─ shared/
│ ├─ router.tsx
│ ├─ providers/
│ └─ layout/
└─ assets/

2. Updated Routing Into Per-Module Dynamic Routes

Each module now owns its route tree:

  • modules/jobs/routes.tsx
  • modules/mentorship/routes.tsx
  • modules/workplaces/routes.tsx
  • modules/forum/routes.tsx

Imported and composed in app/router.tsx.

This reduces bundle size and improves clarity.


3. Header Navigation Simplified

The Header was cluttered with many unrelated navigation points.
Now:

  • Mentorship contains:

    • Browse Mentors
    • My Mentorships
    • Chat Threads
  • Jobs contains:

    • Browse Jobs
    • My Applications
    • My Job Posts (for employers)
  • Workplaces contains:

    • Browse Workplaces
    • My Workplaces

The top navigation now shows only top-level modules:

Home | Jobs | Workplaces | Mentorship | Forum | Profile

All secondary flows live inside their respective module pages.


4. All Imports Updated to Module Paths

Refactored all local imports:

  • ../../components/...@/modules/...
  • Shared utilities moved into modules/shared/.

5. Removed Legacy Duplicated Components

Deprecated folders removed:

  • src/pages/*
  • src/components/* (moved into modules/shared or module-specific)

How to Test

  1. Run the app
pnpm run dev
  1. Ensure navigation behaves correctly:
  • Jobs → browse jobs, job detail, applications
  • Workplaces → browse workplaces, workplace detail
  • Mentorship → mentor directory, my mentorships, chat threads
  • Forum → thread list + detail
  1. Open devtools → verify no broken imports.
  2. Test deep links:
  • /jobs/:id
  • /workplaces/:id
  • /mentorship/chat/:threadId
  1. Ensure that header links now only show module roots, not subpages.

Related Issues


Checklist

  • Code builds with no errors
  • All imports updated
  • Old folders removed
  • Module routing integrated
  • Header updated
  • Tested navigation manually
  • Add unit tests for new components (follow-up)

Notes

This PR introduces BREAKING changes to file paths and imports.
Other feature branches should rebase on top of this refactor.
Right now, submodules are implemented as tabs, which is not providing the best UI, it will be reworked and then added in a follow up issue with better UI.

@ykaydogdu ykaydogdu added this to the Milestone 3: Final Milestone milestone Dec 6, 2025
@ykaydogdu ykaydogdu self-assigned this Dec 6, 2025
@ykaydogdu ykaydogdu added domain: frontend Front-end related items type: improvement / refactor an improvement or structural change to existing code labels Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: frontend Front-end related items type: improvement / refactor an improvement or structural change to existing code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants