Skip to content

Explore: ActivityPub integration for federated fitness tracking #153

@apermo

Description

@apermo

Vision

Users self-host Body Refactoring as a WordPress plugin. When they complete workouts, hit milestones, or set PRs, these events are published via ActivityPub. Other users — on Body Refactoring, Mastodon, or any Fediverse client — can follow along.

Decentralized Strava/Hevy, owned by each user.

Integration with ActivityPub Plugin

The ActivityPub plugin (maintained by Automattic/Matthias Pfefferle) handles federation. Body Refactoring would:

  1. Register custom post types that the AP plugin federates
  2. Optionally add structured metadata (exercise data, stats) to AP objects
  3. Handle incoming interactions (likes, replies on workouts)

Key Technical Questions

  • Transformers: Does the AP plugin support custom transformers to control how a br_workout CPT becomes an ActivityPub object? Or is it purely based on post content?
  • Attachments/metadata: Can we attach structured data (JSON-LD, microformats) so that other Body Refactoring instances can render workouts richly while Mastodon shows a text fallback?
  • Interactions: When someone on Mastodon replies to a workout post, how does that surface in WordPress? Could we show "cheers" from followers in the app?
  • Profile enrichment: Can the AP actor profile include fitness stats (current streak, level, total workouts)?

Example Federation Flow

1. User completes workout in Body Refactoring PWA
2. App saves to WordPress database via REST API
3. Plugin creates br_workout post (private or public based on user setting)
4. If public: ActivityPub plugin federates to followers
5. Follower on Mastodon sees: "Christoph completed Upper Body — Day 42 🔥"
6. Follower on Body Refactoring sees: rich workout card with exercises, weights, streak
7. Follower reacts → reaction appears in the user's app

Dependencies

  • ActivityPub plugin (wp.org)
  • Custom post types (#issue for CPTs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions