My Account

Dashboard

Description

  • The My Account Dashboard displays user profile data, quick navigation links, and personalized content such as product recommendations and pro membership info.
  • Built using Nuxt 3, Composition API, TypeScript, TailwindCSS, and Pinia.
  • Fully responsive: optimized layouts for mobile and desktop.
  • Internationalized using a custom useTranslation composable.

Purpose

  • Present the user's key information (name, email, mobile, account ID) in a concise layout.
  • Provide quick access to account-related features like order history, saved lists, preferences, addresses, and more.
  • Display pro card status and allow users to show their personalized card.
  • Surface personalized product recommendations.
  • Support easy navigation through the sidebar and footer links on mobile.

Use Cases

  • View Profile Info: Displays avatar (initials), name, email, mobile, and user ID.
  • Show Pro Card Status: Tag and QR code button for users with a "Pro Card".
  • Edit Profile: Quick link available on mobile.
  • Access Account Features:
    • Order History
    • Reorder Items
    • Saved Lists
    • Stock Notifications
    • Pro Card Management
    • Addresses
    • Favorite Branch
    • Preferences
  • View Personalized Product Recommendations: Carousel for desktop users.
  • Explore Help Links: Links to FAQ, About Us, and "Need Help" support section.
  • Sign Out: Clear button at bottom for mobile users.

Expectations

  • All data-bound elements render conditionally based on authStore, monetateStore, runtimeConfig, and productStore.
  • Mobile variant includes stacked button layouts and a simplified sidebar menu.
  • Uses Tailwind classes for utility-first layout styling.
  • Translation-ready across all labels and headings.

Developer Strategies

  • Use defineAsyncComponent for dynamic loading of heavy UI components (TsCard, TsCarouselCardProduct).
  • Leverage useDevice() for layout adaptation.
  • Bind data via authStore, productStore, monetateStore, and runtimeConfig to ensure reactive rendering.
  • Account links defined in account_links array with conditional rendering based on feature flags and store states.
  • Utilize twMerge() for conditional Tailwind class merging.

TODOs for Developer

  • Improve accessibility (ARIA roles, keyboard navigation in carousel and sidebar).
  • Add error states and loading indicators for profile or recommendation data.
  • Implement lazy-loading or suspense boundaries for heavy sections.
  • Write unit tests for:
    • Mobile/desktop conditional render logic.
    • Store-driven elements (Pro card visibility, stock notifications, etc.).
    • Navigation and routing logic from button/link clicks.
  • Add event tracking (e.g., "click_show_my_card", "view_recommendation_carousel").

API Endpoints

ActionEndpointDescription
getUserDetailsGET /users/:userIdRetrieves user profile information.
getProCardStatusGET /users/:userId/pro-cardChecks if the user has a Pro Card.
getAccountLinksGET /account/navigation-linksFetches configurable sidebar link data.
getRecommendationsGET /users/:userId/recommendationsReturns personalized product suggestions.
signOutPOST /auth/logoutLogs the user out of the session.

Components Used

Component | Description

ActionEndpoint
TsNuxtCardMain container card with border and padding styling
TsRow / TsColumnGrid layout for user info and buttons
TsTypographyText rendering with responsive variants
TsButtonAction buttons (e.g., Show Card, Edit Profile)
TsTagStatus labels like "Pro Card-lid"
TsDividerSection divider
TsContentDynamic content loader (for banners)
TsCarouselCardProductProduct recommendation carousel
NuxtLinkWithLocaleInternationalized router links
TsIconIcon rendering in buttons and labels

Flow Summary

Render or Mount

  • Fetch User Profile Data
  • Uses authStore.user to retrieve: First and last name, Email, Mobile, Customer Id with GET /users/:userId → getUserDetails

My Account Dashboard

  • Displays "Pro Card-lid" tag and "Show My Card" button if the user has a Pro Card.
  • GET /users/:userId/pro-cardgetProCardStatus

My Account ProCard Tag

Product Recommendations

  • Conditionally render account features (Orders, Saved Lists, Preferences, etc.) based on:
    • runtimeConfig.public.featureFlags
    • authStore.user.account_type
    • productStore.is_stock_notify_tag_visible
  • Renders a personalized product carousel for desktop users.
    • GET /users/:userId/recommendationsgetRecommendations
    • Returns an array of product IDs for display. My Account Product Carousel

Mobile Layout

  • Adjusts layout and buttons for mobile vs desktop. My Account Mobile Ver.

Logout Functionality

  • When the user clicks the "Sign Out" button on mobile, they are logged out via authStore.signOut().
  • API Used : POST /auth/logout → signOut

Logout Feature


Copyright © 2026