Squad 404 Gladiators - Kai Onboarding Expedition #170
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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