PhoenixKitUserConnections

Social relationships module for PhoenixKit — follows, mutual connections, and blocking.

Features

Installation

Add to your mix.exs dependencies:

{:phoenix_kit_user_connections, "~> 0.1.0"}

The module is auto-discovered by PhoenixKit at startup — no additional configuration needed.

Usage

# Follow a user
PhoenixKitUserConnections.follow(current_user, other_user)

# Request a mutual connection
PhoenixKitUserConnections.request_connection(current_user, other_user)

# Accept a connection request
PhoenixKitUserConnections.accept_connection(connection)

# Block a user (removes existing follows/connections)
PhoenixKitUserConnections.block(current_user, other_user, "reason")

# Get full relationship status
PhoenixKitUserConnections.get_relationship(current_user, other_user)
# => %{following: true, followed_by: false, connected: false, ...}

Business Rules

License

MIT — see LICENSE.