feat: implement X (Twitter) integration module - #1112
Merged
Akanimoh12 merged 3 commits intoJul 25, 2026
Merged
Conversation
- Add X API client for fetching follower/engagement metrics (closes Akanimoh12#971) - Implement graceful degradation with cached fallback (closes Akanimoh12#977) - Add comprehensive mocked tests with fixtures (closes Akanimoh12#978) - Create complete X integration documentation (closes Akanimoh12#979) - Add ServiceUnavailableError to AppError classes - Mount X router at /api/v1/x - Add TipStatus enum to Prisma schema - Update User model relations in schema Features: - Fetch X metrics from API v2 with bearer token auth - Cache metrics in PostgreSQL XAccount model - Fallback to cached data when API unavailable - Configurable cache expiration (maxCacheAge) - Rate limit and error handling - Engagement score calculation - No real network calls in tests (fully mocked)
|
@Georgechisom Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Owner
|
Please resolve conflicts |
Contributor
Author
|
fixed |
Akanimoh12
merged commit Jul 25, 2026
95179f7
into
Akanimoh12:test-implement-drips
4 of 5 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete X (Twitter) integration module with API client, caching, graceful degradation, comprehensive mocked tests, and full documentation. All implementations follow backend module conventions with Zod validation and AppError handling.
Changes
Fetch X Follower/Engagement Metrics
x.service.tswith XApiClient for X API v2 integrationGraceful Degradation When X is Down
X Integration Tests (Mocked)
X Integration Documentation
Module Structure
API Endpoints
GET /api/v1/x/metrics/:handle
Fetches fresh metrics with optional fallback
GET /api/v1/x/cached/:handle
Retrieves cached metrics without API call
Key Features
Additional Changes
Environment Variables
Cache Strategy
Closes #979
Closes #971
Closes #978
Closes #977