Profile Overview
The Phoenix Profile system provides user profiles with names and avatars. Profiles are automatically created when first accessed, making it easy to display user information throughout your application.
The Phoenix Profile system provides user profiles with names and avatars. Profiles are automatically created when first accessed, making it easy to display user information throughout your application.
What Are Profiles?
Profiles store basic user information:
- Name - Display name (auto-generated if not provided)
- Avatar - Profile picture URL (auto-generated if not provided)
Profiles are created automatically when first accessed, so you don't need to set them up in advance.
Key Concepts
Automatic Creation
When you query a user's profile for the first time, the system automatically:
- Generates a random display name
- Creates an avatar URL based on the user ID
- Returns the new profile
Avatar Generation
Avatars are automatically generated using a service that creates unique images based on a seed (tenant ID + user ID). This ensures each user gets a consistent, unique avatar without requiring image uploads.
Profile Updates
Users can update their profile name and regenerate their avatar at any time. The system preserves the original creation timestamp.
How Profiles Work
First Access
- User profile is requested
- System checks if profile exists
- If not, creates profile with auto-generated name and avatar
- Returns the new profile
Updates
- User updates their profile (name or avatar)
- System updates the profile
- Updated profile is returned
Integration with Other Features
Profiles are used throughout Phoenix to display user information:
- Leaderboards - Show user names and avatars in rankings
- Streaks - Display user info in streak tracking
- Achievements - Show user profiles in achievement displays
- Any feature - Profiles provide consistent user identity across all features
Next Steps
- Creating Profiles - Learn how to create and update profiles
- Querying Profiles - Learn how to retrieve profile information