Overview
EpiNeko provides a comprehensive profile system where users can view their anime statistics, manage account settings, and track their viewing habits. The profile system is built on Supabase Auth with custom profile data stored in a separate profiles table.Profile Dashboard
View personalized stats and viewing analytics
Account Settings
Update profile information and preferences
Library Stats
Track progress across different watch statuses
Activity Summary
Monitor viewing efficiency and completion rates
Profile Structure
User profiles extend Supabase Auth with additional metadata:Profile Statistics
Calculated Metrics
The profile page calculates real-time statistics from your library:Viewing Efficiency
Track completion rate as a percentage:- Large percentage display
- “completado versus total” subtitle
- Visual prominence on profile page
Profile Page Components
Profile Card
The left sidebar displays user identity and basic info:1
Avatar
Gradient-bordered circular avatar with fallback to first letter of name
2
Display Name
Shows
full_name or email username as fallback3
Username
Displays @username handle
4
Member Since
Shows account creation date in Spanish format
5
Edit Button
Links to settings page for profile updates
Statistics Cards
Four summary cards showing key metrics:Total Animes
Total count of all library itemsIcon: 📊
Viendo
Currently watching countIcon: 📺
Completado
Completed series countIcon: ✅
Pendiente
Plan to watch countIcon: ⏳
Activity Summary
Visual progress bars showing distribution across statuses:- Progress Bars
- Implementation
Quick Navigation
Two action cards linking to main sections:- Mi Biblioteca - Navigate to library page
- Descubrir - Navigate to discovery/homepage
- Hover effects with color transitions
- Icon arrows with background color change
- Subtle descriptions of each section
Settings Page
Editable Profile Fields
Users can update their profile information:string
required
Unique identifier, minimum 3 charactersValidation: Database constraint enforces uniqueness and length
string
Display name shown throughout the app
string
Optional personal website URL
string
URL to profile picture image
Updating Profile
Profile updates use Supabase upsert for insert-or-update:- Uses
upsertto handle both insert and update - Updates
updated_attimestamp automatically - Displays success/error messages to user
- Disables button during save operation
Form Components
Settings form with controlled inputs:- Username field with validation hint
- Email field (disabled, cannot be changed)
- Save button with loading state
- Success/error alert messages
- Back to profile navigation button
Security Features
Row-Level Security
Profile access is controlled by PostgreSQL policies:- Users cannot modify other users’ profiles
- Profile creation is automatic via trigger
- All operations validated at database level
Automatic Profile Creation
New users automatically get a profile via database trigger:- User signs up via Supabase Auth
- Trigger fires after user creation
- Profile row is automatically inserted
- Metadata from signup is copied to profile
Authentication Flow
Checking Login Status
Profile and settings pages verify authentication:- Checks for authenticated user
- Shows login prompt if not authenticated
- Displays loading spinner during check
Fetching User Data
Combine auth data with profile data:Loading States
Both pages implement proper loading states:Message System
Settings page shows feedback messages:Best Practices
Username Validation
Validate username format client-side before submission
Optimistic Updates
Update UI immediately while save is in progress
Error Handling
Display user-friendly error messages for all failure cases
Loading States
Always show loading indicators during async operations
Related Features
- Library Management - Stats source
- Authentication - Login system
- Database Schema - Table structures