Skip to main content

SPEC 013 — User Profile and Dashboard

FieldValue
StatusDRAFT
PriorityP1 — Core Platform
Backendequa-server/modules/persistence/ (entity definitions), equa-server/modules/api/src/endpoints/ (profile endpoints)
Frontendequa-web/src/modules/profile/, equa-web/src/modules/user-dashboard/

1. Feature Purpose

The user profile and dashboard module provides the personal home experience for each Equa user. It aggregates holdings, organization memberships, personal information, wallet data, and account security settings into a single view. Users can edit their profile, manage blockchain wallet addresses, configure a 4-digit signing PIN, and view portfolio performance across all organizations they belong to.

2. Current State (Verified)

2.1 User Dashboard Entry Point

DetailValue
Fileequa-web/src/modules/user-dashboard/dashboard.tsx
ComponentUserDashboard
BehaviorOn load, checks user’s organizations; redirects to welcome if none, to single org if one, to org list if multiple
Data loaderloadOrganizations
StateRedux state.user

2.2 Dashboard Component

DetailValue
Fileequa-web/src/modules/profile/components/dashboard-component.tsx
ComponentDashboardComponent
SectionsHoldings summary panels, Organizations grid, Personal Information panel, Address panel
MetricsTotal Investment, Total Current Value, Lifetime Growth (USD), Lifetime Growth (%)
VisualizationUserDashRainbowBar — color-coded bar chart of holdings by security
Organization displaySorted alphabetically, capped at 3 in dashboard view
Color systemPer-holding colors loaded from GetColorsResponse, fallback palette: ['#F29D4A', '#EB5757', '#9B51E0', '#56CCF2', '#27AE60', '#F2C94C', '#2F80ED', '#FFFFFF']

2.3 Profile Form

DetailValue
Fileequa-web/src/modules/profile/components/profile-form.tsx
ComponentProfileForm
SectionsName & Profile Image, Personal Information, Address, Email, Profile Links, Website
FieldsfirstName (required), lastName (required), photo (PNG/JPG/JPEG), phone, dateOfBirth (MM/DD/YYYY)
Profile linksLinkedIn, Facebook, Twitter, Instagram — all validated with isUrl
AddressRendered via shared <Address> component

2.4 Account Settings

DetailValue
Fileequa-web/src/modules/profile/components/account-settings-form.tsx
ComponentAccountSettingsForm
Purpose4-digit PIN creation for document signing
ValidationisPin() validator, numeric input with confirmation field
Input typeProtected input (protectedInputFieldComponent)

2.5 Wallet Integration

DetailValue
Fileequa-web/src/modules/profile/components/wallet-info.tsx
ComponentWalletInfo
CategoriesWallet, Savings, Claimable, Debt, Networks, Protocols
Networks supportedEthereum, Polygon, BSC
Net worth calculationwalletTotal + savingsTotal + claimTotal + vaultTotal - debtTotal
Token iconsLoaded from storage.googleapis.com/zapper-fi-assets/tokens/{network}/{address}.png
Other wallet componentsWalletPort, WalletAddress, connect-wallet-modal, edit-wallet-address modal

2.6 Pages Exported

PageFile
PortfolioPagepages/portfolio-page.tsx
NewHoldingPagepages/new-holding-page.tsx
EditHoldingPagepages/edit-holding-page.tsx
EditProfilePagepages/edit-profile-page.tsx
ViewProfilePagepages/view-profile-page.tsx
ViewAccountSettingsPagepages/view-account-settings-page.tsx
EditAccountSettingsPagepages/edit-account-settings-page.tsx
ViewCardPagepages/view-card-page.tsx
AddCardPagepages/add-card-page.tsx
EditCardPagepages/edit-card-page.tsx
UserDashboardPagepages/user-dashboard.tsx
WalletPortfolioPagepages/wallet-portfolio.tsx
WalletAddressBookPagepages/wallet-address-book.tsx

3. Data Model

Profiles

ColumnTypeConstraints
iduuidPK
fullNametext
homeAddressHashFK to address table
websitetext
emailcitext
dateOfBirthdate
phonetext
fileHashFK to files table (profile image)
linksjsonb{ linkedIn, facebook, twitter, instagram }

Users

ColumnTypeConstraints
iduuidPK
emailcitextUNIQUE
usernametext
emailVerifiedboolean
acceptedTermsboolean

UserAccounts

ColumnTypeConstraints
iduuidPK
pinnumber4-digit signing PIN

UserStates

ColumnTypeConstraints
useruuidPK, FK to Users
datajsonbArbitrary user state blob

Colors

ColumnTypeConstraints
useruuidComposite PK
targettextComposite PK (holding/security ID)
valuetextHex color code without # prefix

WalletAddresses

ColumnTypeConstraints
addressHashPK
entityHashFK to user or organization
globalNametextENS or equivalent display name
nametextUser-given label

4. API Endpoints

MethodPathAuthDescription
GET/api/v1/profile/:idSessionRetrieve profile by user ID
PUT/api/v1/profile/:idSessionUpdate profile fields
POST/api/v1/profile/:id/fileSessionUpload profile image (PNG/JPG/JPEG)
GET/api/v1/account/:userSessionGet account settings (PIN status)
PUT/api/v1/account/:userSessionUpdate account settings (PIN)
GET/api/v1/colors/:userSessionGet user color assignments
PUT/api/v1/colors/:userSessionSet color for a holding/security
GET/api/v1/addresses/:entitySessionList wallet addresses
POST/api/v1/addresses/:entitySessionAdd a wallet address
PUT/api/v1/addresses/:entity/:addressSessionUpdate wallet address label
DELETE/api/v1/addresses/:entity/:addressSessionRemove wallet address
GET/api/v1/holdings/expandedSessionGet expanded holdings with portfolio data

5. Frontend Components

Module: equa-web/src/modules/profile/

ComponentFilePurpose
ProfileFormcomponents/profile-form.tsxForm for editing name, image, phone, DOB, links, website
AccountSettingsFormcomponents/account-settings-form.tsx4-digit PIN setup with confirmation
DashboardComponentcomponents/dashboard-component.tsxMain user dashboard with holdings, orgs, personal info
WalletInfocomponents/wallet-info.tsxNet worth display with token categories
WalletPortcomponents/wallet-port.tsxWallet portfolio display
WalletAddresscomponents/wallet-address.tsxSingle wallet address display
UserDashRainbowBarcomponents/user-dash-rainbow-bar.tsxColor bar visualization of portfolio allocation
Settingscomponents/settings.tsxSettings page container
ProfileModalscomponents/profile-modals.tsxModal dialogs for profile actions
ProfileDetailsSharedcomponents/profile-details-shared.tsxShared profile display layout
HoldingFormcomponents/holding-form.tsxAdd/edit personal holding
NewCardFormcomponents/new-card-form.tsxPayment card entry form
ConnectWalletModalcomponents/modal/connect-wallet-modal.tsxWallet connection flow
EditWalletAddresscomponents/modal/edit-wallet-address.tsxEdit wallet label modal
SuccessModalcomponents/modal/success-modal.tsxConfirmation after successful action
AddressBookDropcomponents/address-book-drop.tsxDropdown for saved addresses

Module: equa-web/src/modules/user-dashboard/

ComponentFilePurpose
UserDashboarddashboard.tsxEntry point — routes to welcome, org, or org list

6. Business Rules

  1. Profile image must be PNG, JPG, or JPEG. Square images are recommended.
  2. PIN must be exactly 4 numeric digits. The confirmation PIN must match.
  3. Email field on profile is distinct from the login email on the Users table. Profile email is editable; login email requires verification.
  4. Wallet net worth is calculated as: wallet + savings + claimable + vault - debt.
  5. Color assignments persist per user and apply across the dashboard and portfolio views. If no color is assigned, the system cycles through the 8-color fallback palette.
  6. Dashboard redirects: zero orgs → welcome page; one org → that org’s page; multiple orgs → org list.
  7. Guest users see a limited dashboard with prompts to add personal information and organizations.
  8. Profile links (LinkedIn, Facebook, Twitter, Instagram, Website) are validated as URLs before save.
  9. Copy to clipboard is available for email and phone number fields on the dashboard.

7. Acceptance Criteria

  • User can view their dashboard with holdings summary (Total Investment, Total Current Value, Lifetime Growth USD/%)
  • User can edit profile: name, photo, phone, DOB, address, social links, website
  • User can set and update their 4-digit signing PIN
  • User can view, add, edit, and remove blockchain wallet addresses
  • Wallet portfolio displays net worth with category breakdown (Wallet, Savings, Claimable, Debt)
  • Dashboard shows up to 3 organizations alphabetically sorted
  • Rainbow bar chart reflects portfolio allocation by security
  • Color assignments persist across sessions
  • Guest users see appropriate empty-state prompts
  • Profile image upload accepts PNG/JPG/JPEG only

8. Risks

RiskImpactMitigation
Zapper-fi token icon URLs may be deprecatedBroken wallet token imagesCache icons locally or use a fallback icon service
PIN stored as plain numberSecurity exposure if DB is compromisedHash PIN before storage (currently not hashed per code review)
No pagination on wallet addressesPerformance degradation with many addressesAdd pagination or virtual scrolling
Color palette limited to 8 fallback colorsVisual overlap with many securitiesExtend palette or auto-generate distinct colors
Wallet data fetching from external blockchain APIsLatency, availabilityImplement caching layer with stale-while-revalidate