Subtrackr is a comprehensive subscription tracking application that helps users manage and monitor their recurring subscriptions across multiple services.
- Track subscriptions from various services
- Monitor billing cycles and payment dates
- Receive notifications before payments are due
- Analyze spending patterns across services
- OAuth integration with popular services
This application includes a complete Spotify OAuth integration that allows users to:
- Connect their Spotify accounts securely
- Automatically sync subscription information
- View Spotify subscription details alongside other services
The Spotify integration is implemented with:
- Secure OAuth Flow: Implements the Authorization Code flow with PKCE for enhanced security
- Token Management: Secure storage and automatic refresh of access tokens
- API Client: Robust client for interacting with Spotify's Web API with rate limiting and error handling
- Data Mapping: Converts Spotify API responses to the application's internal subscription format
- Comprehensive Testing: Full test coverage for all components
SpotifyProvider: Main OAuth provider implementationSpotifyApiClient: Client for Spotify Web API interactionsSpotifyDataMapper: Maps Spotify data to internal formatSpotifyTypes: Type definitions and utilities
To enable Spotify integration, set the following environment variables:
SPOTIFY_CLIENT_ID=your_spotify_client_id
SPOTIFY_CLIENT_SECRET=your_spotify_client_secret
SPOTIFY_REDIRECT_URI=http://localhost:5173/oauth/callback/spotifyThe integration requests the following Spotify scopes:
user-read-private: Access to user's subscription leveluser-read-email: Access to user's email addressuser-read-playback-state: Access to user's current playback state
Run tests with:
npm test- Node.js 16+
- npm or yarn
- Supabase account for backend services
npm installnpm run devnpm run buildThe application uses Supabase for data storage with a schema that includes:
- OAuth connections
- Service provider configurations
- Subscription data
- Sync logs
- Webhook events
Database migrations are located in the database/migrations directory.
- All OAuth tokens are encrypted before storage
- PKCE is used for secure token exchange
- Rate limiting prevents API abuse
- Proper error handling prevents information leakage
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a pull request
MIT License - see LICENSE file for details.