bounswe / bounswe2025group4

CMPE352/451 Group 4 repository
4 stars 1 forks source link

[Task] Profile Page #90

Closed koramazzz closed 1 month ago

koramazzz commented 1 month ago

Title: [Task] Profile Page

Task Description
Create the Profile page for the mobile app, allowing users to view and edit their profile details in accordance with the provided mockups and diagrams.


Acceptance Criteria


Deadline
2.05.2025 Friday 23:59

Estimated Workload
6 hours

Dependencies

Reviewer
@enverern

Review Deadline
3.05.2025 Saturday 23:59

koramazzz commented 1 month ago

I have created the initial profile page. Right now, it uses mock data because API calls are not implemented yet. These are the API calls that we need for this page:

GET /api/me GET /api/profile/{userId} PATCH /api/profile/{userId} POST /api/profile/{userId}/experience PUT /api/profile/{userId}/experience/{expId} DELETE /api/profile/{userId}/experience/{expId} POST /api/profile/{userId}/education PUT /api/profile/{userId}/education/{eduId} DELETE /api/profile/{userId}/education/{eduId} PATCH /api/profile/{userId}/skills PATCH /api/profile/{userId}/interests GET /api/profile/{userId}/badges POST /api/profile/{userId}/badges DELETE /api/profile/{userId}/badges/{badgeId} GET /api/my/applications GET /api/my/activity

Remember that endpoints can change; these are just examples. Also, you can mention me if you need any more details.

It will be perfect if you can implement these as soon as possible. After that, I will update my code and create a pull request.

@buraktigin @Asaf31214 @CotSezer

enverern commented 1 month ago

Overall it looks great and covers most of the acceptance criteria, but there are two unsatisfied requirements:

  1. Profile picture upload/editing (User Profile Requirement 1.1.2.2): Right now I can’t actually change or remove my avatar. We need a working “choose from gallery / take photo” flow and a way to clear it.
  2. Badge management (User Profile Requirement 1.1.2.6): Badges should be earned by the system (e.g. posting X messages, completing Y actions etc.), not manually created by the user.

Once those two are in place, this will fully satisfy User Profile Requirements. Great job on the rest.

koramazzz commented 1 month ago

I’ve completed the missing parts mentioned in the review. Here’s what has been implemented:

✅ Profile Picture Upload/Editing

Users can now upload a new profile picture via gallery or camera and also remove their existing one.

Endpoints:


✅ Badge System Update

Badge management logic has been revised. Badges are now earned automatically by the system based on user activity (e.g. posting messages, completing actions), and cannot be manually created by users.

Endpoints (logic updated):


📌 Updated List of Needed Endpoints


GET /api/me
GET /api/profile/{userId}
PATCH /api/profile/{userId}
POST /api/profile/{userId}/profile-picture
DELETE /api/profile/{userId}/profile-picture
POST /api/profile/{userId}/experience
PUT /api/profile/{userId}/experience/{expId}
DELETE /api/profile/{userId}/experience/{expId}
POST /api/profile/{userId}/education
PUT /api/profile/{userId}/education/{eduId}
DELETE /api/profile/{userId}/education/{eduId}
PATCH /api/profile/{userId}/skills
PATCH /api/profile/{userId}/interests
GET /api/profile/{userId}/badges
POST /api/profile/{userId}/badges
DELETE /api/profile/{userId}/badges/{badgeId}
GET /api/my/applications
GET /api/my/activity
PATCH /api/profile/{userId}/mentor-status
buraktigin commented 1 month ago

I provided the endpoints except the last three. You can reach doc of api's here.

ykaydogdu commented 1 month ago
✅ Profile Picture Upload/Editing
Users can now upload a new profile picture via gallery or camera and also remove their existing one.

Endpoints:

POST /api/profile/{userId}/profile-picture
DELETE /api/profile/{userId}/profile-picture

Part was only provided by sending and receiving strings. In my issue #137 and corresponding PR #138, I have developed these endpoints to actually receive and send images. We can now POST images by providing form-data body containing a field with key: "file".

Also, in other Profile API functionality, profile image is returned as an URL which can be integrated in frontend or mobile applications. There is also a placeholder image, which is provided to all created profiles by default.