Sprint 3 Progress - Kaleemunnisa/CS691-Spring2025-Team6 GitHub Wiki

🏁 Sprint 3 - User Profile Management & Data Integration

🎯 Sprint Goal

• Develop and integrate user profile management features, including viewing and editing user information.
• Improve navigation and user data handling for a seamless user experience.
• Ensure the system is fully tested and debugged for smooth functionality.


Sprint 3: Completed Tasks

TASK-012: Design User Profile Template (Frontend)

Summary:
Create UI for the user profile page, ensuring a clean and responsive layout.

Acceptance Criteria:
Users can see their profile details with a well-structured UI.

Code Snippet:

// Profile UI Layout
<View style={styles.profileSection}>
  <TouchableOpacity onPress={handleEditClick}>
    <View style={styles.profileCard}>
      <View style={styles.profileRow}>
        <Image
          source={{ uri: userData?.profilePicture }}
          style={styles.profileImage}
        />
        <TouchableOpacity
          onPress={handleLogout}
          style={styles.editIcon}
        ></TouchableOpacity>

        <TouchableOpacity
          onPress={handleEditClick}
          style={styles.editIcon}
        ></TouchableOpacity>
      </View>
    </View>
  </TouchableOpacity>
</View>

TASK-013: Navigation & Integration (Frontend)

Summary:
Implement navigation to the profile page and integrate it into the existing structure.

Acceptance Criteria:
Users can navigate to and from the profile page without issues.

Code Snippet:

// Adding profile navigation to the drawer
<Animated.View style={[styles.container, { right: rightPosition }]}>
  <SafeAreaView style={styles.viewContainer}>
    <View style={styles.backButtonContainer}>
      <TouchableOpacity onPress={closeEditProfile} style={styles.backButton}>
        <Feather name="arrow-left" size={24} color="white" style={[]} />
      </TouchableOpacity>
    </View>

    <View style={[{ width: "100%", height: "100%" }]}>
      <ProfileDetailsUpdateSection userData={userData} />
    </View>
  </SafeAreaView>
</Animated.View>

TASK-014: User Data Fetch and Display (Frontend & Backend)

Summary:
Develop API endpoints to fetch user profile data and display it correctly in the frontend.

Acceptance Criteria:
User details load correctly on the profile page.

Code Snippet:

// Fetch user data from backend API
const getCurrentUserData = async () => {
  const auth = getAuth();
  const user = auth.currentUser;

  if (user) {
    // Get Firestore instance
    const db = getFirestore();

    // Reference to the user's document in Firestore
    const userDocRef = doc(db, "users", user.uid);

    try {
      // Fetch the document data
      const userDoc = await getDoc(userDocRef);

      if (userDoc.exists()) {
        const userData = userDoc.data();
        console.log(userData);
        return {
          ...userData,
        };
      } else {
        console.log("No user document found");
        return null;
      }
    } catch (error) {
      console.error("Error fetching user data from Firestore:", error);
      return null;
    }
  } else {
    return null; // Return null if no user is logged in
  }
};

TASK-015: Edit & Update Profile (Frontend & Backend)

Summary:
Allow users to edit and update their profile details via the app.

Acceptance Criteria:
Changes are saved and reflected in real-time.

Code Snippet:

<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
  <ScrollView
    showsVerticalScrollIndicator={false}
    contentContainerStyle={{ flexGrow: 1 }}
    keyboardShouldPersistTaps="handled"
  >
    // editable components
    <Button title="Save" />
  </ScrollView>
</TouchableWithoutFeedback>

TASK-016: Testing & Debugging

Summary:
Conduct thorough testing to ensure profile-related features work as expected.

Acceptance Criteria:
No major bugs; smooth user experience.


Results for Sprint 3

PROFILE PAGE UI PROFILE EDIT PAGE PROFILE EDIT PAGE PROFILE EDIT PAGE PROFILE EDIT PAGE

⚠️ **GitHub.com Fallback** ⚠️