Implement backend connection for the profile page#178
Conversation
…e APIs instead of local temporary data
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #178 +/- ##
=======================================
Coverage 81.16% 81.16%
=======================================
Files 17 17
Lines 775 775
Branches 51 51
=======================================
Hits 629 629
Misses 123 123
Partials 23 23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🔍 Peer Review: Great Job on This PR!
Hey Sameer, I just finished reviewing your PR titled "Implement backend connection for the profile page". Here’s my feedback:
✅ What Looks Great
- The backend integration is solid — API-related logic is well separated into
profileData.jsandauth.js, keeping things modular and maintainable. - I appreciate the focus on error handling and fallback states — even when the backend fails, the UI remains stable and user-friendly.
- The loading and success feedback really improves the user experience, making user actions feel responsive and smooth.
- Your separation of concerns between UI components and API/data logic is very clean — future updates will be much easier to handle.
- The PR write-up is clear and professional — it walks the reviewer through exactly what changed and how to test everything thoroughly.
💡 Suggestions for Improvement (if any)
These are ideas for future improvements or things to address in the next iteration.
- Minor Issue: In the "Edit Profile" tab, there’s an occasional problem saving information. (Possibly backend-related, and understandable given the short timeline.)
- Minor Issue: In "Share Profile", the current behavior shows only a temporary confirmation message. (Possibly backend-related — worth revisiting for a smoother UX.)
- Consider adding retry logic for API calls (for example, allow a user to retry fetching the profile if the initial load fails).
- Small optimization idea: you could clean up the
useEffecthook slightly in case of component unmount while an async fetch is still pending. - Maybe for the next phase, explore optimistic UI updates — reflect edits immediately on the page while awaiting backend confirmation.
- Over the long term, adding PropTypes or migrating toward TypeScript could help catch unexpected API response changes early.
🧪 Tested This Feature
- ✅ Logged in and navigated to
/profile— verified real-time profile data loads correctly. - ✅ Edited several fields (bio, status) — confirmed the data updated and reflected instantly after save.
- ✅ Simulated backend failures and slow responses — fallback behavior worked smoothly with appropriate user feedback.
- ✅ Checked layout responsiveness across desktop, tablet, and mobile — no layout breakage detected.
Everything worked exactly as intended! 🎯
🔄 Next Steps
- Maybe refine edit validation by highlighting specific form fields that fail instead of using only a general error message.
- Would be great to see profile picture upload and a user settings/preferences section added in a future PR.
🚀 Final Thoughts
Fantastic job integrating backend functionality cleanly into the user-facing pages!
The strong separation into profileData.js and auth.js really shows good planning for scale and maintainability.
You're helping set a strong foundation for future personalization features — can't wait to see where you take this next!
Author: Jose Alarcon
omgdory
left a comment
There was a problem hiding this comment.
🔍 Peer Review: Great Job on This PR!
Hey Sameer 👋 — just finished reviewing your PR titled "Connect Profile and Edit Profile Pages to Backend API". Here’s my feedback:
✅ What Looks Great
- The backend integration aligns perfectly with the related issue.
- The
GETrequest is functioning as expected, displaying everything on the profile page appropriately. - Good call
profileData.jsandauth.jsfor clean code responsibility separation.
💡 Suggestions for Improvement (if any)
- In future iterations, a UML or sequence diagram showing the frontend-backend communication flow could help newer reviewers or developers understand the API lifecycle at a glance.
- Implementing the
PATCHrequest would help with allowing users to save changes to their profile.
🧪 Tested This Feature
I ran the following test steps:
- Does the Profile Page load dynamic user data successfully?
- Is the error handling user-friendly and non-intrusive?
- Is API communication secure (e.g., using tokens properly)?
- Is the code clean, modular, and well-documented?
🔄 Next Steps
- Implement the
PATCHrequest for dynamic changing of data
🚀 Final Thoughts
Incredible work connecting the backend!
You're helping push LessonConnect closer to full production quality with features like this.
If you want help brainstorming backend validation strategies or improving form handling even further, let’s collaborate!
Excited to see this rolled out live soon! 🚀
Overview
What does this PR do?
This PR connects the Profile Page and Edit Profile Page to the backend API, enabling real-time retrieval and updates of user data on LessonConnect. It replaces placeholder profile data with live data integration for a production-ready profile management experience.
Key Features & Changes
What has been added or changed?
Backend Integration:
PATCH/PUTrequests to the backend upon saving changes.Error Handling:
State Management Enhancements:
useEffectanduseContexthooks for fetching and updating live profile data.API Utility Functions:
profileData.jsandauth.jsfor clean, reusable API call functions (e.g.,getProfile,updateProfile).UI/UX Improvements:
New/Updated Components and Files:
ProfilePage.jsx: Now fetches live profile data instead of static imports.EditProfile.jsx: Sends updated profile data to the backend and handles API responses.profileData.jsandauth.js: New utility files for handling API requests.ProfilePage.cssandEditProfile.css: Minor updates for loading/error display states.Why This Is Needed
What problem does this solve?
With backend integration, user profiles are now dynamically managed rather than relying on static placeholder data, supporting a scalable, production-level platform. This is critical for user personalization, security, and long-term app functionality.
Related Issue
This PR addresses ##177
Implementation Details
How was this feature developed?
How to Test This PR
Step-by-step testing guide
/profileand verify that real user data loads.Files Added/Modified
profileData.jsauth.jsProfilePage.jsxEditProfile.jsxProfilePage.css/EditProfile.cssAI Code Usage
Was AI-generated code used in this PR?
Checklist for Reviewers
Next Steps & Future Enhancements
UML diagram:

Final Notes
Thanks again for reviewing! Your feedback is crucial to perfecting the user profile management flow as we move toward full production readiness.
– Sameer