Implemented a comprehensive Creators feature for FToolbox to track and analyze Fansly creator statistics, similar to the existing Tags feature.
-
Created
Creatormodel (backend-go/models/creator.go):- Stores creator data: ID, username, display name, media likes, post likes, followers, image/video counts
- Includes deletion tracking and timestamps
-
Created
CreatorHistorymodel (backend-go/models/creator_history.go):- Tracks historical snapshots of creator statistics
- Records changes for media likes, post likes, and followers
- Enables trend analysis and change visualization
- Updated
backend-go/database/migrate.goto include Creator and CreatorHistory models in auto-migration
- Consolidated multiple calls to
contentdiscovery/media/suggestionsnewendpoint - Created unified
GetSuggestionsDatamethod that returns posts, creators, and suggestions - Added
FanslyAccounttype to represent creator data from API - Removed duplicate code and improved API efficiency
- Created
CreatorHandler(backend-go/handlers/creator_handler.go):GET /api/creatorsendpoint with:- Pagination support (page, limit)
- Search functionality (by username or display name)
- Sorting options (followers, mediaLikes, postLikes, updatedAt, change)
- History inclusion with date range filtering
- Change calculation from historical data
- Updated
backend-go/routes/routes.goto register the creators endpoint
-
Extended
tag_discovery.go:- Added
discoverCreatorsfunction to discover new creators during tag discovery - Fetches creators from top 5 tags by view count
- Efficiently reuses API calls already being made for tag discovery
- Added
-
Extended
tag_updater.go:- Added
updateCreatorsfunction to update creator statistics - Updates creators on 24-hour cycle (same as tags)
- Fetches up to 20 creators per run that need updating
- Creates history entries with calculated changes
- Handles deletion detection when creators disappear from API
- Added
-
Created
frontend/src/routes/creators/+page.ts- Page load function with:- URL parameter handling for pagination, search, sorting
- History date range support
- Error handling and default values
-
Created
frontend/src/routes/creators/+page.svelte- Main creators page with:- Search functionality
- Date range picker for history filtering
- Sortable table columns
- Expandable rows for history visualization
- Change indicators with trend icons
- Pagination controls
- Responsive design
- Created
frontend/src/lib/components/CreatorHistory.svelte:- Multi-series line chart for visualizing creator metrics over time
- Toggle between viewing all metrics or individual metrics
- Chart.js integration with proper date handling
- Data table showing historical values and changes
- Color-coded metrics (followers: blue, media likes: green, post likes: orange)
- Updated
frontend/src/lib/components/AppSidebar.svelte:- Added Creators menu item with Users icon
- Maintains active state highlighting
- Updated
frontend/src/lib/utils.tswith:formatNumber()- Consistent number formattingformatDate()- Date formatting with Unix timestamp supportcalculateChange()- Calculate change and percentage from history data
- Reused Existing Patterns: Followed the same architecture as Tags feature for consistency
- Extended Workers: Rather than creating new workers, extended existing ones to minimize resource usage
- Unified API Calls: Consolidated Fansly API calls to reduce duplication and improve efficiency
- 24-Hour Update Cycle: Matches the tag update frequency to maintain consistency
- Batch Processing: Limited to 20 creators per update cycle to manage API rate limits
- All Go code formatted with
go fmt - All Go code validated with
go vet - All TypeScript/Svelte code formatted with Prettier
- All TypeScript/Svelte code validated with ESLint and svelte-check
- No compilation or linting errors
- Created dedicated
creator_updater.gofile withCreatorUpdaterWorkerstruct - Implemented
ProcessCreatorsfunction that:- Creates new creators with initial history entry
- Updates existing creators if last check was more than 24 hours ago
- Handles both creation and updates in a single method
- Uses database transactions for data consistency
- Properly tracks changes between updates
- Removed creator-related code from
tag_updater.go - Updated
tag_discovery.goto use the newCreatorUpdaterWorker
- Fixed
tag_handler.goto properly handle the newTagResponseDatastructure returned byGetTagWithContext
- Add creator request functionality (similar to tag requests)
- Implement creator search/discovery by username
- Add export functionality for creator data
- Consider adding more detailed analytics views