Skip to content
This repository was archived by the owner on Feb 9, 2026. It is now read-only.

Mobile mentor functionality#572

Merged
SouthAscend merged 9 commits into
mainfrom
mobile-mentor-3
Nov 24, 2025
Merged

Mobile mentor functionality#572
SouthAscend merged 9 commits into
mainfrom
mobile-mentor-3

Conversation

@Ayhan-coder

Copy link
Copy Markdown
Contributor

Corresponding issue

Mobile Mentor-Mentee Functionality Implementation

Description

Implemented complete mentor-mentee relationship management in the mobile app's Profile page, mirroring the web frontend implementation. Users can now send/receive mentor requests, accept/reject relationships, and view their mentors and mentees directly from the mobile profile interface.

Changes Made

  • Added mentor-mentee relationship queries using React Query
  • Implemented relationship state calculations (sender, receiver, mentor/mentee status)
  • Added mentor/mentee request mutations with proper error handling
  • Added relationship status update mutations (ACCEPT, REJECT, TERMINATE)
  • Integrated mentorship UI sections for own profile and other user profiles
  • Added user search functionality with navigation to profiles
  • Implemented proper authentication headers and CSRF token handling
  • Added comprehensive error logging for debugging API issues

Features

  • Send mentor request to another user
  • Request another user as your mentor
  • Accept/reject incoming mentorship requests
  • Cancel outgoing requests
  • Terminate accepted mentor-mentee relationships
  • View list of current mentors with avatars
  • View list of current mentees with avatars
  • View pending mentor-mentee requests
  • Navigate to mentor/mentee profiles
  • User search with real-time filtering
  • Relationship status display on other user profiles
  • View goals for mentees when you're their mentor

API Endpoints

  • POST /api/mentor-relationships/: Create new mentor-mentee relationship
  • GET /api/mentor-relationships/user/: Fetch all relationships for current user
  • POST /api/mentor-relationships/{id}/status/: Update relationship status (ACCEPTED, REJECTED, TERMINATED)
  • GET /api/users/: Fetch list of all users
  • GET /api/user/: Fetch current authenticated user
  • GET /api/goals/?username={username}: Fetch goals for a specific user
  • GET /api/profile/: Fetch own profile details
  • GET /api/profile/other/{username}/: Fetch another user's profile details

Technical Details

  • Used React Query for state management and caching with proper staleTime values
  • Implemented useMemo hooks for efficient relationship state calculations
  • Added getSanitizedAuthHeader() helper to handle optional Authorization headers
  • Implemented proper CSRF token handling from cookies for POST/PUT/DELETE requests
  • Added Referer header matching web implementation for CORS compliance
  • Used Portal and Dialog components for better UI overlays
  • Implemented proper loading states and error alerts
  • Added detailed console logging for debugging API errors
  • Used Material Design 3 components from React Native Paper for consistency
  • Implemented navigation stack for profile browsing

Testing

  • Verified mentor request creation flow with console logs
  • Tested relationship state calculations with different user combinations
  • Tested Accept/Reject/Terminate relationship actions
  • Verified navigation between profiles in mentorship grids
  • Tested error handling with 500 server errors
  • Verified goals visibility for mentees
  • Tested pending request display and actions
  • Verified proper CSRF token handling

Dependencies

  • @tanstack/react-query: For data fetching and state management (already present)
  • @react-navigation/native: For navigation (already present)
  • react-native-paper: For Material Design UI components (already present)
  • @react-native-cookies/cookies: For CSRF token handling (already present)

Documentation

  • Added comprehensive inline comments for state calculations
  • Added JSDoc-style comments for API query functions
  • Documented relationship status constants and their meanings
  • Added comments for mutation error handling patterns
  • Documented the getSanitizedAuthHeader helper function

Checklist

  • My code follows style guidelines
  • I have performed self-review
  • I have commented complex code
  • I have updated documentation
  • My changes generate no new warnings
  • Dependent changes have been merged (ChatContext axios→fetch conversion)
  • Code follows the same patterns as web implementation
  • Proper error handling and user feedback
  • State management mirrors web frontend logic
  • Authentication headers properly configured

Implemented mentor-mentee relationship management, including viewing, requesting, accepting, rejecting, and terminating mentorships. Added a user search bar with dropdown results and profile navigation. Goals are now visible for own profile and for mentees when viewed by their mentor. Updated queries, mutations, and UI to support these features.
Eliminated the user search bar, related state, query logic, and search results modal from the Profile page. This streamlines the component by removing unused or deprecated user search features.
@Ayhan-coder Ayhan-coder self-assigned this Nov 23, 2025
@Ayhan-coder Ayhan-coder added in progress This issue is being worked on workload: high 3+ hours per week priority: high Needs to be completed within the next 2-3 days need review Work related to this issue is completed, needs a review to close it. type: implementation This issue is about implementation. labels Nov 23, 2025
@Ayhan-coder Ayhan-coder added this to the MVP milestone Nov 23, 2025
@Ayhan-coder
Ayhan-coder requested review from abdullahumuth and yusufakdogan0 and removed request for yusufakdogan0 November 23, 2025 20:30
@Ayhan-coder

Copy link
Copy Markdown
Contributor Author

Hi @SouthAscend, @abdullahumuth,
Could you please review my PR when you have a moment? If everything looks good, feel free to merge it. Thank you! 🙌

@SouthAscend SouthAscend left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The mentor functionality still needs a lot of work but this branch successfully shows the current mentors and mentees on the profile page. Merging this but an additional branch is needed to comlpete the mentor feature.

@SouthAscend
SouthAscend merged commit 9b4488c into main Nov 24, 2025
2 checks passed
@SouthAscend
SouthAscend deleted the mobile-mentor-3 branch November 24, 2025 20:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

in progress This issue is being worked on need review Work related to this issue is completed, needs a review to close it. priority: high Needs to be completed within the next 2-3 days type: implementation This issue is about implementation. workload: high 3+ hours per week

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants