Skip to content

feat: strava integration with encryption and enhanced plugin system - #24

Open
FrancescoRoveda wants to merge 1 commit into
Ti-03:mainfrom
FrancescoRoveda:feature/strava-integration
Open

FrancescoRoveda wants to merge 1 commit into
Ti-03:mainfrom
FrancescoRoveda:feature/strava-integration

Conversation

@FrancescoRoveda

Copy link
Copy Markdown
image

Summary

This PR introduces a full Strava integration, allowing users to visualize their physical activities directly on their Year View wallpaper. It extends the plugin system with new primitives for modifying daily cell colors and rendering custom legends, and includes industry-standard encryption for securing user tokens at rest.

Key Changes

Strava Integration & Security

  • OAuth Flow: Implemented secure OAuth 2.0 flow with Strava.
  • Token Encryption: Added AES-256-CBC encryption for access and refresh tokens before storage in Firestore. This ensures user tokens are never stored in plain text.
  • Token Management: Implemented automatic token refreshing and secure server-side storage using Firebase Admin.
  • Data Fetching: Efficiently fetches and caches athlete activities for the current year.

Strava Plugin

  • New Plugin: Added strava-plugin.ts to the core plugin registry.
  • Configurable Modes:
    • Types mode: Distinct colors for Runs, Rides, Swims, and Other activities.
    • Simple mode: Single color for any active day.
  • Advanced Customization:
    • Sport Toggles: Enable/disable specific sports (Run/Swim/Ride/Other).
    • Colors: Fully customizable hex colors for each activity type.
    • Legend Options: Toggle legend visibility and choose between "Activity Count" or "Percentage" display modes.

Rendering Engine Updates (year-view-enhanced.tsx)

  • New Render Primitives:
    • day-color-modifier: Allows plugins to override the color of specific calendar days.
    • legend-data: Standardized way for plugins to inject data into the wallpaper footer.
  • Layout Support: Ensured custom legends and color modifiers work correctly in both "Months" (grid) and "Days" (continuous) layouts.
  • Architecture: Refactored data extraction to happen before layout logic, ensuring consistency across different view modes.

Core Infrastructure

  • Type Definitions: Updated PluginExecutionContext to include user settings and extended PluginRenderElement to support new primitives.
  • Environment: Added STRAVA_ENCRYPTION_KEY requirement for secure token handling.

Setup Instructions

To enable the Strava integration, you need to configure the following environment variables:

  1. Create a Strava Application:

  2. Generate Encryption Key:
    Run this command to generate a secure 32-byte key:
    openssl rand -hex 16

  3. Configure Environment Variables:
    Add these to your .env.local and deployment secrets:
    # Strava API Credentials
    STRAVA_CLIENT_ID=your_client_id
    STRAVA_CLIENT_SECRET=your_client_secret
    # Security
    STRAVA_ENCRYPTION_KEY=your_generated_32_char_key
    # App URL
    NEXT_PUBLIC_BASE_URL=your_production_url

This is my first time contributing to a project on github be kind :)

@vercel

vercel Bot commented Jan 20, 2026

Copy link
Copy Markdown
Contributor

@FrancescoRoveda is attempting to deploy a commit to the qutibah's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Ti-03
Ti-03 self-requested a review January 22, 2026 15:03
@FrancescoRoveda

Copy link
Copy Markdown
Author

Hey bro love the project! Can you please merge this functionality? I think it would be very cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant