This PR enhances the onboarding process for Marvel AI by implementing a persistent progress bar and a real-time updating checklist. These features guide users through key steps such as:
Welcome Screen
Profile Setup
System Configuration
Final Steps
Result Page
The progress bar and checklist visually represent the user's progress, ensuring smooth navigation. This change also introduces database modifications to store onboarding information and sync it with the UI.
Motivation and Context
The purpose of this change is to improve the user onboarding experience, giving users a clear sense of their progress through the process. This will contribute to higher satisfaction and better user retention.
Type of Change
[x] New feature (non-breaking change which adds functionality)
How Has This Been Tested?
The following tests were performed to ensure that all functionality works as intended:
[x] Test A: Manually tested onboarding flow by creating a new user, verifying that each onboarding step correctly updates the checklist and progress bar.
[x] Test B: Tested profile photo uploads to Firebase Storage, confirming correct saving and retrieval of images.
[x] Test C: Verified that system configurations saved in the System Configuration step were correctly stored in the database and synced to the user's profile.
[x] Test D: Verified that Redux state was updated in real-time as Firebase data changed (e.g., when onboarding steps were completed).
Implementation Details
Database Changes
User Collection: The existing users collection was modified to store onboarding progress. This enables tracking of each user's onboarding completion status. Example structure:
Modified signUpUser function: Default values were added to the user’s onboarding progress when a new user is created.
File: functions/userControllers.js
Firebase Listener: Added a listener to watch for Firebase data changes, updating the Redux store accordingly, to ensure that the user is redirected after onboarding completion.
File: frontend/providers/GlobalProvider.jsx
Created withLayoutRedirect HOC: This Higher-Order Component (HOC) manages the layout and retrieve it accordingly:
File: frontend/hoc/withLayoutRedirect.jsx
Onboarding Layout: A new OnboardingLayout was created to incorporate a unified style for onboarding screens, with a persistent progress menu. Icons were added to show the status of each step (in progress, completed, not started).
File: frontend/layouts/OnboardingLayout.jsx
Icons:
frontend/assets/svg/IconProcessDoing
frontend/assets/svg/IconProcessDone
frontend/assets/svg/IconProcessUndo
CustomCheckCircle Component: Displays progress status icons.
File: frontend/component/CustomCheckCircle.jsx
Onboarding Pages
Onboarding Page: Created a page to render the appropriate onboarding step based on the user's progress.
Folder: frontend/pages/onboarding
Welcome Screen
Welcome Screen: Renders the first step of the onboarding process.
Folder: frontend/template/WelcomeScreen
Profile Setup
Profile Setup Screen: Renders when the onboarding step is 2. This screen includes a form for users to fill out profile information, including uploading a profile picture and adding social links.
System Configuration Screen: Renders when the onboarding step is 3. Allows users to configure preferences such as email notifications, push notifications, and theme settings.
Folder: frontend/template/SystemConfig
Theme Management: The theme configuration was modularized and split into three files.
Description
This PR enhances the onboarding process for Marvel AI by implementing a persistent progress bar and a real-time updating checklist. These features guide users through key steps such as:
The progress bar and checklist visually represent the user's progress, ensuring smooth navigation. This change also introduces database modifications to store onboarding information and sync it with the UI.
Motivation and Context
The purpose of this change is to improve the user onboarding experience, giving users a clear sense of their progress through the process. This will contribute to higher satisfaction and better user retention.
Type of Change
How Has This Been Tested?
The following tests were performed to ensure that all functionality works as intended:
Implementation Details
Database Changes
User Collection: The existing
users
collection was modified to store onboarding progress. This enables tracking of each user's onboarding completion status. Example structure:Modifications
Modified
signUpUser
function: Default values were added to the user’s onboarding progress when a new user is created.functions/userControllers.js
Firebase Listener: Added a listener to watch for Firebase data changes, updating the Redux store accordingly, to ensure that the user is redirected after onboarding completion.
frontend/providers/GlobalProvider.jsx
Created
withLayoutRedirect
HOC: This Higher-Order Component (HOC) manages the layout and retrieve it accordingly:frontend/hoc/withLayoutRedirect.jsx
Onboarding Layout: A new
OnboardingLayout
was created to incorporate a unified style for onboarding screens, with a persistent progress menu. Icons were added to show the status of each step (in progress, completed, not started).frontend/layouts/OnboardingLayout.jsx
frontend/assets/svg/IconProcessDoing
frontend/assets/svg/IconProcessDone
frontend/assets/svg/IconProcessUndo
frontend/component/CustomCheckCircle.jsx
Onboarding Pages
frontend/pages/onboarding
Welcome Screen
frontend/template/WelcomeScreen
Profile Setup
Profile Setup Screen: Renders when the onboarding step is 2. This screen includes a form for users to fill out profile information, including uploading a profile picture and adding social links.
frontend/template/ProfileSetup
frontend/template/ProfileSetup/ProfileSetupForm
frontend/template/ProfileSetup/SocialLinkInput.jsx
frontend/components/ImageUpload.jsx
frontend/hook/useUploadFile.jsx
frontend/utils/getCroppedImg.js
Firebase Rules: Adjusted Firebase Storage rules to accommodate the new profile picture upload functionality.
storage/rules
Firebase Function: Created a backend function to save profile setup data, including image and social links, to Firestore.
functions/controllers/onboardingController.js
(function:setupUserProfile
)frontend/services/onboarding/setupUserProfile.js
System Configuration
System Configuration Screen: Renders when the onboarding step is 3. Allows users to configure preferences such as email notifications, push notifications, and theme settings.
frontend/template/SystemConfig
frontend/theme/palette.js
,componentsTheme.js
,theme.js
frontend/pages/_app.js
userSlice
to include user theme settings from Firestore.frontend/redux/slices/userSlice.js
frontend/hook/useThemeSync.jsx
Firebase Function: Created a backend function to save system configuration preferences.
functions/controllers/onboardingController.js
(function:setupUserSystemConfig
)frontend/services/onboarding/setupUserSystemConfig.js
Final Steps
frontend/template/FinalSteps
Result Page
Result Page: The final screen that announces the user has completed the onboarding process.
frontend/template/ResultPage
Firebase Function: Created a function to update the user’s onboarding status when they reach the final step.
functions/controllers/onboardingController.js
(function:advanceOnboardingStatus
)frontend/services/onboarding/advanceOnboardingStatus.js